From patchwork Fri Jan 6 15:51:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 134672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2F578B6FBE for ; Sat, 7 Jan 2012 02:53:13 +1100 (EST) Received: from localhost ([::1]:42192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjC6K-0003jn-NJ for incoming@patchwork.ozlabs.org; Fri, 06 Jan 2012 10:53:04 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjC65-0003cd-5q for qemu-devel@nongnu.org; Fri, 06 Jan 2012 10:52:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjC63-0006WL-Ts for qemu-devel@nongnu.org; Fri, 06 Jan 2012 10:52:49 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:44367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjC63-0006WB-LV for qemu-devel@nongnu.org; Fri, 06 Jan 2012 10:52:47 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jan 2012 15:52:46 -0000 Received: from d06nrmr1407.portsmouth.uk.ibm.com ([9.149.38.185]) by e06smtp15.uk.ibm.com ([192.168.101.145]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 6 Jan 2012 15:52:44 -0000 Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q06FqhLF1892436 for ; Fri, 6 Jan 2012 15:52:43 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q06FqhNi030932 for ; Fri, 6 Jan 2012 08:52:43 -0700 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.31]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q06FqhAt030929; Fri, 6 Jan 2012 08:52:43 -0700 From: Stefan Hajnoczi To: Date: Fri, 6 Jan 2012 15:51:22 +0000 Message-Id: <1325865088-23897-4-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1325865088-23897-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1325865088-23897-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12010615-0342-0000-0000-000000870C2B X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.111 Cc: Anthony Liguori , Markus Armbruster , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 3/9] scsi virtio-blk usb-msd: Clean up device init error messages X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Markus Armbruster Replace error_report("DEVICE-NAME: MESSAGE"); by just error_report("MESSAGE"); in block device init functions. DEVICE-NAME is bogus in some cases: it's "scsi-disk" for device scsi-hd and scsi-cd, "virtio-blk-pci" for virtio-blk-s390, and "usb-msd" for usb-storage. There is no real need to put a device name in the message, because error_report() points to the offending command line option already: $ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb -device virtio-blk-pci upstream-qemu: -device virtio-blk-pci: virtio-blk-pci: drive property not set upstream-qemu: -device virtio-blk-pci: Device 'virtio-blk-pci' could not be initialized And for a monitor command, it's obvious anyway: $ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb (qemu) device_add virtio-blk-pci virtio-blk-pci: drive property not set Device 'virtio-blk-pci' could not be initialized Reported-by: Amit Shah Signed-off-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- hw/scsi-disk.c | 4 ++-- hw/scsi-generic.c | 8 ++++---- hw/usb-msd.c | 2 +- hw/virtio-blk.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 505accd..5d8bf53 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -1515,7 +1515,7 @@ static int scsi_initfn(SCSIDevice *dev) DriveInfo *dinfo; if (!s->qdev.conf.bs) { - error_report("scsi-disk: drive property not set"); + error_report("drive property not set"); return -1; } @@ -1537,7 +1537,7 @@ static int scsi_initfn(SCSIDevice *dev) } if (bdrv_is_sg(s->qdev.conf.bs)) { - error_report("scsi-disk: unwanted /dev/sg*"); + error_report("unwanted /dev/sg*"); return -1; } diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 6f7d3db..0aebcdd 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -374,13 +374,13 @@ static int scsi_generic_initfn(SCSIDevice *s) struct sg_scsi_id scsiid; if (!s->conf.bs) { - error_report("scsi-generic: drive property not set"); + error_report("drive property not set"); return -1; } /* check we are really using a /dev/sg* file */ if (!bdrv_is_sg(s->conf.bs)) { - error_report("scsi-generic: not /dev/sg*"); + error_report("not /dev/sg*"); return -1; } @@ -396,13 +396,13 @@ static int scsi_generic_initfn(SCSIDevice *s) /* check we are using a driver managing SG_IO (version 3 and after */ if (bdrv_ioctl(s->conf.bs, SG_GET_VERSION_NUM, &sg_version) < 0 || sg_version < 30000) { - error_report("scsi-generic: scsi generic interface too old"); + error_report("scsi generic interface too old"); return -1; } /* get LUN of the /dev/sg? */ if (bdrv_ioctl(s->conf.bs, SG_GET_SCSI_ID, &scsiid)) { - error_report("scsi-generic: SG_GET_SCSI_ID ioctl failed"); + error_report("SG_GET_SCSI_ID ioctl failed"); return -1; } diff --git a/hw/usb-msd.c b/hw/usb-msd.c index 4c06950..b87b929 100644 --- a/hw/usb-msd.c +++ b/hw/usb-msd.c @@ -517,7 +517,7 @@ static int usb_msd_initfn(USBDevice *dev) DriveInfo *dinfo; if (!bs) { - error_report("usb-msd: drive property not set"); + error_report("drive property not set"); return -1; } diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index ef27421..5e81f53 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -569,7 +569,7 @@ VirtIODevice *virtio_blk_init(DeviceState *dev, BlockConf *conf, DriveInfo *dinfo; if (!conf->bs) { - error_report("virtio-blk-pci: drive property not set"); + error_report("drive property not set"); return NULL; } if (!bdrv_is_inserted(conf->bs)) {