mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 17:24:53 +00:00
Print SCSI address attributes bus, target, unit as unsigned integer
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>
This commit is contained in:
parent
f714f52882
commit
3b7983ad6d
@ -427,7 +427,7 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
|
|||||||
} else {
|
} else {
|
||||||
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
|
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
|
||||||
&scsisrc->u.host;
|
&scsisrc->u.host;
|
||||||
if (virAsprintfQuiet(&address, "%s:%d:%d:%d",
|
if (virAsprintfQuiet(&address, "%s:%u:%u:%u",
|
||||||
scsihostsrc->adapter, scsihostsrc->bus,
|
scsihostsrc->adapter, scsihostsrc->bus,
|
||||||
scsihostsrc->target,
|
scsihostsrc->target,
|
||||||
scsihostsrc->unit) < 0) {
|
scsihostsrc->unit) < 0) {
|
||||||
|
@ -19102,7 +19102,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
|
|||||||
virBufferAsprintf(buf, "<adapter name='%s'/>\n",
|
virBufferAsprintf(buf, "<adapter name='%s'/>\n",
|
||||||
scsihostsrc->adapter);
|
scsihostsrc->adapter);
|
||||||
virBufferAsprintf(buf,
|
virBufferAsprintf(buf,
|
||||||
"<address %sbus='%d' target='%d' unit='%d'/>\n",
|
"<address %sbus='%u' target='%u' unit='%u'/>\n",
|
||||||
includeTypeInAddr ? "type='scsi' " : "",
|
includeTypeInAddr ? "type='scsi' " : "",
|
||||||
scsihostsrc->bus, scsihostsrc->target,
|
scsihostsrc->bus, scsihostsrc->target,
|
||||||
scsihostsrc->unit);
|
scsihostsrc->unit);
|
||||||
|
@ -1938,7 +1938,7 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn,
|
|||||||
} else {
|
} else {
|
||||||
virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
|
virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
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->adapter, scsihostsrc->bus,
|
||||||
scsihostsrc->target, scsihostsrc->unit);
|
scsihostsrc->target, scsihostsrc->unit);
|
||||||
}
|
}
|
||||||
@ -3873,7 +3873,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
|
|||||||
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
|
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
|
||||||
&scsisrc->u.host;
|
&scsisrc->u.host;
|
||||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
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->adapter, scsihostsrc->bus,
|
||||||
scsihostsrc->target, scsihostsrc->unit);
|
scsihostsrc->target, scsihostsrc->unit);
|
||||||
}
|
}
|
||||||
|
@ -1482,7 +1482,7 @@ virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
scsihostsrc->adapter, scsihostsrc->bus,
|
scsihostsrc->adapter, scsihostsrc->bus,
|
||||||
scsihostsrc->target, scsihostsrc->unit,
|
scsihostsrc->target, scsihostsrc->unit,
|
||||||
hostdev->readonly, hostdev->shareable))) {
|
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->adapter, scsihostsrc->bus, scsihostsrc->target,
|
||||||
scsihostsrc->unit, dom_name);
|
scsihostsrc->unit, dom_name);
|
||||||
return;
|
return;
|
||||||
@ -1492,7 +1492,7 @@ virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
* because qemuProcessStart could fail half way through. */
|
* because qemuProcessStart could fail half way through. */
|
||||||
|
|
||||||
if (!(tmp = virSCSIDeviceListFind(hostdev_mgr->activeSCSIHostdevs, scsi))) {
|
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",
|
"in list of active SCSI devices",
|
||||||
scsihostsrc->adapter, scsihostsrc->bus,
|
scsihostsrc->adapter, scsihostsrc->bus,
|
||||||
scsihostsrc->target, scsihostsrc->unit);
|
scsihostsrc->target, scsihostsrc->unit);
|
||||||
@ -1500,7 +1500,7 @@ virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
return;
|
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->adapter, scsihostsrc->bus, scsihostsrc->target,
|
||||||
scsihostsrc->unit, dom_name);
|
scsihostsrc->unit, dom_name);
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ virSCSIDeviceGetSgName(const char *sysfs_prefix,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (virAsprintf(&path,
|
if (virAsprintf(&path,
|
||||||
"%s/%d:%d:%d:%d/scsi_generic",
|
"%s/%d:%u:%u:%u/scsi_generic",
|
||||||
prefix, adapter_id, bus, target, unit) < 0)
|
prefix, adapter_id, bus, target, unit) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ virSCSIDeviceGetDevName(const char *sysfs_prefix,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (virAsprintf(&path,
|
if (virAsprintf(&path,
|
||||||
"%s/%d:%d:%d:%d/block",
|
"%s/%d:%u:%u:%u/block",
|
||||||
prefix, adapter_id, bus, target, unit) < 0)
|
prefix, adapter_id, bus, target, unit) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ virSCSIDeviceNew(const char *sysfs_prefix,
|
|||||||
if (virSCSIDeviceGetAdapterId(adapter, &dev->adapter) < 0)
|
if (virSCSIDeviceGetAdapterId(adapter, &dev->adapter) < 0)
|
||||||
goto cleanup;
|
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 ||
|
dev->bus, dev->target, dev->unit) < 0 ||
|
||||||
virAsprintf(&dev->sg_path, "%s/%s",
|
virAsprintf(&dev->sg_path, "%s/%s",
|
||||||
sysfs_prefix ? sysfs_prefix : "/dev", sg) < 0)
|
sysfs_prefix ? sysfs_prefix : "/dev", sg) < 0)
|
||||||
|
@ -724,8 +724,8 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
|
|||||||
} else if (STRPREFIX((const char *)target, "sd")) {
|
} else if (STRPREFIX((const char *)target, "sd")) {
|
||||||
if (diskAddr.type == DISK_ADDR_TYPE_SCSI) {
|
if (diskAddr.type == DISK_ADDR_TYPE_SCSI) {
|
||||||
virBufferAsprintf(&buf,
|
virBufferAsprintf(&buf,
|
||||||
"<address type='drive' controller='%d'"
|
"<address type='drive' controller='%u'"
|
||||||
" bus='%d' unit='%d' />\n",
|
" bus='%u' unit='%u' />\n",
|
||||||
diskAddr.addr.scsi.controller, diskAddr.addr.scsi.bus,
|
diskAddr.addr.scsi.controller, diskAddr.addr.scsi.bus,
|
||||||
diskAddr.addr.scsi.unit);
|
diskAddr.addr.scsi.unit);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user