From patchwork Mon Jan 17 18:31:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 79208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EC27AB708B for ; Tue, 18 Jan 2011 05:36:27 +1100 (EST) Received: from localhost ([127.0.0.1]:49287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PetwB-00055w-7C for incoming@patchwork.ozlabs.org; Mon, 17 Jan 2011 13:36:19 -0500 Received: from [140.186.70.92] (port=53919 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Petrc-0002ZC-62 for qemu-devel@nongnu.org; Mon, 17 Jan 2011 13:31:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Petra-00022H-KE for qemu-devel@nongnu.org; Mon, 17 Jan 2011 13:31:36 -0500 Received: from oxygen.pond.sub.org ([213.239.205.148]:46213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Petra-00021Y-EY for qemu-devel@nongnu.org; Mon, 17 Jan 2011 13:31:34 -0500 Received: from blackfin.pond.sub.org (p5B32B9B0.dip.t-dialin.net [91.50.185.176]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 16D3F2DA96E for ; Mon, 17 Jan 2011 19:31:30 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 5344034; Mon, 17 Jan 2011 19:31:30 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 17 Jan 2011 19:31:26 +0100 Message-Id: <1295289090-18236-2-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1295289090-18236-1-git-send-email-armbru@redhat.com> References: <1295289090-18236-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH 1/5] blockdev: Fix error message for invalid -drive CHS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- blockdev.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index d7add36..b01a87c 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; } }