]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Print SCSI address attributes bus, target, unit as unsigned integer
authorEric Farman <farman@linux.vnet.ibm.com>
Wed, 17 Jun 2015 03:29:52 +0000 (23:29 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 22 Jun 2015 20:03:33 +0000 (16:03 -0400)
The address elements are all unsigned integers, so we should
use the appropriate print directive when printing it.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
src/conf/domain_audit.c
src/conf/domain_conf.c
src/qemu/qemu_hotplug.c
src/util/virhostdev.c
src/util/virscsi.c
tools/virsh-domain.c

index 1900039572d7b82c7331cfa1761cdd1768d7c5c4..89870443836234aece73c96ca9895748bf0d1e99 100644 (file)
@@ -427,7 +427,7 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
             } else {
                 virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
                     &scsisrc->u.host;
-                if (virAsprintfQuiet(&address, "%s:%d:%d:%d",
+                if (virAsprintfQuiet(&address, "%s:%u:%u:%u",
                                      scsihostsrc->adapter, scsihostsrc->bus,
                                      scsihostsrc->target,
                                      scsihostsrc->unit) < 0) {
index 0a871ac8daecce34d371ea60afe75a98aa344c3a..a05fc5fdf173f3551166c43819b92c3e5386414a 100644 (file)
@@ -19102,7 +19102,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
             virBufferAsprintf(buf, "<adapter name='%s'/>\n",
                               scsihostsrc->adapter);
             virBufferAsprintf(buf,
-                              "<address %sbus='%d' target='%d' unit='%d'/>\n",
+                              "<address %sbus='%u' target='%u' unit='%u'/>\n",
                               includeTypeInAddr ? "type='scsi' " : "",
                               scsihostsrc->bus, scsihostsrc->target,
                               scsihostsrc->unit);
index cc86a3bc5ed55027650b8463de43397b7cc1d801..01dc7768ff4b3678a9ad196e53530480d1ad4c5e 100644 (file)
@@ -1938,7 +1938,7 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn,
         } else {
             virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Unable to prepare scsi hostdev: %s:%d:%d:%d"),
+                           _("Unable to prepare scsi hostdev: %s:%u:%u:%u"),
                            scsihostsrc->adapter, scsihostsrc->bus,
                            scsihostsrc->target, scsihostsrc->unit);
         }
@@ -3873,7 +3873,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
                  virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
                      &scsisrc->u.host;
                  virReportError(VIR_ERR_OPERATION_FAILED,
-                                _("host scsi device %s:%d:%d.%d not found"),
+                                _("host scsi device %s:%u:%u.%u not found"),
                                 scsihostsrc->adapter, scsihostsrc->bus,
                                 scsihostsrc->target, scsihostsrc->unit);
             }
index 1c8f31e19b5202b6356ffecc953e871da720a5d3..e35ad48b0104fa26f13bf8a48daf6c9e3ad7dd13 100644 (file)
@@ -1482,7 +1482,7 @@ virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr hostdev_mgr,
                                   scsihostsrc->adapter, scsihostsrc->bus,
                                   scsihostsrc->target, scsihostsrc->unit,
                                   hostdev->readonly, hostdev->shareable))) {
-        VIR_WARN("Unable to reattach SCSI device %s:%d:%d:%d on domain %s",
+        VIR_WARN("Unable to reattach SCSI device %s:%u:%u:%u on domain %s",
                  scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target,
                  scsihostsrc->unit, dom_name);
         return;
@@ -1492,7 +1492,7 @@ virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr hostdev_mgr,
      * because qemuProcessStart could fail half way through. */
 
     if (!(tmp = virSCSIDeviceListFind(hostdev_mgr->activeSCSIHostdevs, scsi))) {
-        VIR_WARN("Unable to find device %s:%d:%d:%d "
+        VIR_WARN("Unable to find device %s:%u:%u:%u "
                  "in list of active SCSI devices",
                  scsihostsrc->adapter, scsihostsrc->bus,
                  scsihostsrc->target, scsihostsrc->unit);
@@ -1500,7 +1500,7 @@ virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr hostdev_mgr,
         return;
     }
 
-    VIR_DEBUG("Removing %s:%d:%d:%d dom=%s from activeSCSIHostdevs",
+    VIR_DEBUG("Removing %s:%u:%u:%u dom=%s from activeSCSIHostdevs",
                scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target,
                scsihostsrc->unit, dom_name);
 
index 9f5cf0daa1afe4edc271add1aa976d3ecbf099eb..288eb324012231915dc54c6c71b441b6b2fe9c6d 100644 (file)
@@ -123,7 +123,7 @@ virSCSIDeviceGetSgName(const char *sysfs_prefix,
         return NULL;
 
     if (virAsprintf(&path,
-                    "%s/%d:%d:%d:%d/scsi_generic",
+                    "%s/%d:%u:%u:%u/scsi_generic",
                     prefix, adapter_id, bus, target, unit) < 0)
         return NULL;
 
@@ -170,7 +170,7 @@ virSCSIDeviceGetDevName(const char *sysfs_prefix,
         return NULL;
 
     if (virAsprintf(&path,
-                    "%s/%d:%d:%d:%d/block",
+                    "%s/%d:%u:%u:%u/block",
                     prefix, adapter_id, bus, target, unit) < 0)
         return NULL;
 
@@ -227,7 +227,7 @@ virSCSIDeviceNew(const char *sysfs_prefix,
     if (virSCSIDeviceGetAdapterId(adapter, &dev->adapter) < 0)
         goto cleanup;
 
-    if (virAsprintf(&dev->name, "%d:%d:%d:%d", dev->adapter,
+    if (virAsprintf(&dev->name, "%d:%u:%u:%u", dev->adapter,
                     dev->bus, dev->target, dev->unit) < 0 ||
         virAsprintf(&dev->sg_path, "%s/%s",
                     sysfs_prefix ? sysfs_prefix : "/dev", sg) < 0)
index afdc61eef69ca5e88f8052b741541a8c723eb08b..cbaf954b66e9c1521d08cd00ebc47c82880464f1 100644 (file)
@@ -724,8 +724,8 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
         } else if (STRPREFIX((const char *)target, "sd")) {
             if (diskAddr.type == DISK_ADDR_TYPE_SCSI) {
                 virBufferAsprintf(&buf,
-                                  "<address type='drive' controller='%d'"
-                                  " bus='%d' unit='%d' />\n",
+                                  "<address type='drive' controller='%u'"
+                                  " bus='%u' unit='%u' />\n",
                                   diskAddr.addr.scsi.controller, diskAddr.addr.scsi.bus,
                                   diskAddr.addr.scsi.unit);
             } else {