qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Trivial patches for 20 to 22 December 2011
@ 2011-12-22 10:31 Stefan Hajnoczi
  2011-12-22 10:31 ` [Qemu-devel] [PATCH 1/3] qemu-options.hx: fix tls-channel help text Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-12-22 10:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

The last trivial-patches pull request before I head off on vacation.  I'll be
back on the 30th of December.  Happy holidays!

The following changes since commit 03ecd2c80a64d030a22fe67cc7a60f24e17ff211:

  virtio-serial-bus: Ports are expected to implement 'have_data' callback (2011-12-21 15:00:29 -0600)

are available in the git repository at:
  personal_github:stefanha/qemu.git trivial-patches

Alon Levy (1):
      qemu-options.hx: fix tls-channel help text

Markus Armbruster (2):
      Strip trailing '\n' from error_report()'s first argument (again)
      scsi virtio-blk usb-msd: Clean up device init error messages

 hw/scsi-disk.c    |    4 ++--
 hw/scsi-generic.c |    8 ++++----
 hw/usb-bus.c      |   12 ++++++------
 hw/usb-msd.c      |    2 +-
 hw/virtio-blk.c   |    2 +-
 qemu-options.hx   |    4 ++--
 usb-redir.c       |    4 ++--
 7 files changed, 18 insertions(+), 18 deletions(-)

-- 
1.7.7.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 1/3] qemu-options.hx: fix tls-channel help text
  2011-12-22 10:31 [Qemu-devel] [PATCH 0/3] Trivial patches for 20 to 22 December 2011 Stefan Hajnoczi
@ 2011-12-22 10:31 ` Stefan Hajnoczi
  2011-12-22 10:31 ` [Qemu-devel] [PATCH 2/3] Strip trailing '\n' from error_report()'s first argument (again) Stefan Hajnoczi
  2011-12-22 10:31 ` [Qemu-devel] [PATCH 3/3] scsi virtio-blk usb-msd: Clean up device init error messages Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-12-22 10:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Alon Levy, Stefan Hajnoczi

From: Alon Levy <alevy@redhat.com>

Remove the default compiled out tunnel channel, add the always available
cursor channel. Optimally the man page would depend on compiled in
options, but that's harder to do.

RHBZ: 688586

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 qemu-options.hx |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index a60191f..3c3bda8 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -857,8 +857,8 @@ The x509 file names can also be configured individually.
 @item tls-ciphers=<list>
 Specify which ciphers to use.
 
-@item tls-channel=[main|display|inputs|record|playback|tunnel]
-@item plaintext-channel=[main|display|inputs|record|playback|tunnel]
+@item tls-channel=[main|display|cursor|inputs|record|playback]
+@item plaintext-channel=[main|display|cursor|inputs|record|playback]
 Force specific channel to be used with or without TLS encryption.  The
 options can be specified multiple times to configure multiple
 channels.  The special name "default" can be used to set the default
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/3] Strip trailing '\n' from error_report()'s first argument (again)
  2011-12-22 10:31 [Qemu-devel] [PATCH 0/3] Trivial patches for 20 to 22 December 2011 Stefan Hajnoczi
  2011-12-22 10:31 ` [Qemu-devel] [PATCH 1/3] qemu-options.hx: fix tls-channel help text Stefan Hajnoczi
@ 2011-12-22 10:31 ` Stefan Hajnoczi
  2011-12-22 10:31 ` [Qemu-devel] [PATCH 3/3] scsi virtio-blk usb-msd: Clean up device init error messages Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-12-22 10:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Markus Armbruster

From: Markus Armbruster <armbru@redhat.com>

Commit 6daf194d got rid of them, but Hans and Gerd added some more
lately.  Tracked down with this Coccinelle semantic patch:

@r@
    expression fmt;
    position p;
@@
    error_report(fmt, ...)@p
@script:python@
    fmt << r.fmt;
    p << r.p;
@@
if "\\n" in str(fmt):
    print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/usb-bus.c |   12 ++++++------
 usb-redir.c  |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 8203390..bd4afa7 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -137,7 +137,7 @@ USBDevice *usb_create(USBBus *bus, const char *name)
         bus = usb_bus_find(-1);
         if (!bus)
             return NULL;
-        error_report("%s: no bus specified, using \"%s\" for \"%s\"\n",
+        error_report("%s: no bus specified, using \"%s\" for \"%s\"",
                 __FUNCTION__, bus->qbus.name, name);
     }
 #endif
@@ -152,12 +152,12 @@ USBDevice *usb_create_simple(USBBus *bus, const char *name)
     int rc;
 
     if (!dev) {
-        error_report("Failed to create USB device '%s'\n", name);
+        error_report("Failed to create USB device '%s'", name);
         return NULL;
     }
     rc = qdev_init(&dev->qdev);
     if (rc < 0) {
-        error_report("Failed to initialize USB device '%s'\n", name);
+        error_report("Failed to initialize USB device '%s'", name);
         return NULL;
     }
     return dev;
@@ -244,7 +244,7 @@ int usb_claim_port(USBDevice *dev)
             }
         }
         if (port == NULL) {
-            error_report("Error: usb port %s (bus %s) not found (in use?)\n",
+            error_report("Error: usb port %s (bus %s) not found (in use?)",
                          dev->port_path, bus->qbus.name);
             return -1;
         }
@@ -255,7 +255,7 @@ int usb_claim_port(USBDevice *dev)
         }
         if (bus->nfree == 0) {
             error_report("Error: tried to attach usb device %s to a bus "
-                         "with no free ports\n", dev->product_desc);
+                         "with no free ports", dev->product_desc);
             return -1;
         }
         port = QTAILQ_FIRST(&bus->free);
@@ -302,7 +302,7 @@ int usb_device_attach(USBDevice *dev)
 
     if (!(port->speedmask & dev->speedmask)) {
         error_report("Warning: speed mismatch trying to attach "
-                     "usb device %s to bus %s\n",
+                     "usb device %s to bus %s",
                      dev->product_desc, bus->qbus.name);
         return -1;
     }
diff --git a/usb-redir.c b/usb-redir.c
index a36f2a7..2b53cf3 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -174,7 +174,7 @@ static void usbredir_log(void *priv, int level, const char *msg)
         return;
     }
 
-    error_report("%s\n", msg);
+    error_report("%s", msg);
 }
 
 static void usbredir_log_data(USBRedirDevice *dev, const char *desc,
@@ -193,7 +193,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc,
         for (j = 0; j < 8 && i + j < len; j++) {
             n += sprintf(buf + n, " %02X", data[i + j]);
         }
-        error_report("%s\n", buf);
+        error_report("%s", buf);
     }
 }
 
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 3/3] scsi virtio-blk usb-msd: Clean up device init error messages
  2011-12-22 10:31 [Qemu-devel] [PATCH 0/3] Trivial patches for 20 to 22 December 2011 Stefan Hajnoczi
  2011-12-22 10:31 ` [Qemu-devel] [PATCH 1/3] qemu-options.hx: fix tls-channel help text Stefan Hajnoczi
  2011-12-22 10:31 ` [Qemu-devel] [PATCH 2/3] Strip trailing '\n' from error_report()'s first argument (again) Stefan Hajnoczi
@ 2011-12-22 10:31 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-12-22 10:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Markus Armbruster, Stefan Hajnoczi

From: Markus Armbruster <armbru@redhat.com>

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 <amit.shah@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 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)) {
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-22 10:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22 10:31 [Qemu-devel] [PATCH 0/3] Trivial patches for 20 to 22 December 2011 Stefan Hajnoczi
2011-12-22 10:31 ` [Qemu-devel] [PATCH 1/3] qemu-options.hx: fix tls-channel help text Stefan Hajnoczi
2011-12-22 10:31 ` [Qemu-devel] [PATCH 2/3] Strip trailing '\n' from error_report()'s first argument (again) Stefan Hajnoczi
2011-12-22 10:31 ` [Qemu-devel] [PATCH 3/3] scsi virtio-blk usb-msd: Clean up device init error messages Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).