From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60875 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTfw-0001CP-LN for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:10:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhTfr-0007Vd-U4 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:10:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhTfr-0007VP-N4 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:10:07 -0500 From: Kevin Wolf Date: Mon, 24 Jan 2011 22:10:45 +0100 Message-Id: <1295903452-18017-17-git-send-email-kwolf@redhat.com> In-Reply-To: <1295903452-18017-1-git-send-email-kwolf@redhat.com> References: <1295903452-18017-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 16/23] blockdev: Fix error message for invalid -drive CHS List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Markus Armbruster 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: Markus Armbruster Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- blockdev.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 662f7a9..28c051b 100644 --- a/blockdev.c +++ b/blockdev.c @@ -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; } } -- 1.7.2.3