mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl/src: make disk type detecton fail
When detecting disk type, the function disk_get_info() is called. It can fail for various reasons (e.g. when the logial target is not eligible for boot record installation). Once disk_get_info() fails, don't proceed with type detection. Return error instead. When applicable, mark the dump job with "is_ngdump" flag to avoid extra type detection calls. Acked-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
f43789e16a
commit
41da0f0809
+13
-5
@@ -2057,10 +2057,18 @@ job_get(int argc, char* argv[], struct job_data** data)
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool
|
||||
is_ngdump_enabled(struct job_data *job)
|
||||
void job_dump_check_set_ngdump(struct job_data *job,
|
||||
struct disk_ext_type *ext_type)
|
||||
{
|
||||
if (job->is_ldipl_dump)
|
||||
return true;
|
||||
return disk_is_nvme(job->data.dump.device, &job->target);
|
||||
assert(job->id == job_dump_partition);
|
||||
|
||||
if (job->is_ldipl_dump || disk_type_is_nvme(ext_type))
|
||||
job->data.dump.is_ngdump = true;
|
||||
}
|
||||
|
||||
bool job_dump_is_ngdump(struct job_data *job)
|
||||
{
|
||||
assert(job->id == job_dump_partition);
|
||||
|
||||
return job->data.dump.is_ngdump;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user