Commit 48384854 authored by Markus Armbruster's avatar Markus Armbruster Committed by Kevin Wolf
Browse files

blockdev: Fix error message for invalid -drive CHS



When cyls, heads or secs are out of range, the error message prints
buf, which points to the value of option "if".  Bogus, may even be
null.  Drop that.
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 77358b59
......@@ -224,15 +224,15 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
if (cyls || heads || secs) {
if (cyls < 1 || (type == IF_IDE && cyls > 16383)) {
fprintf(stderr, "qemu: '%s' invalid physical cyls number\n", buf);
fprintf(stderr, "qemu: invalid physical cyls number\n");
return NULL;
}
if (heads < 1 || (type == IF_IDE && heads > 16)) {
fprintf(stderr, "qemu: '%s' invalid physical heads number\n", buf);
fprintf(stderr, "qemu: invalid physical heads number\n");
return NULL;
}
if (secs < 1 || (type == IF_IDE && secs > 63)) {
fprintf(stderr, "qemu: '%s' invalid physical secs number\n", buf);
fprintf(stderr, "qemu: invalid physical secs number\n");
return NULL;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment