提交 3c437ebf 编写于 作者: P Peter Krempa

qemu: hotplug: Use disk target in debug/warning messages where appropriate

Some messages deal with the disk itself thus using the disk target is
better than using the disk source name which can be NULL in some cases.
上级 c01a2e05
...@@ -364,7 +364,6 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, ...@@ -364,7 +364,6 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
bool secobjAdded = false; bool secobjAdded = false;
bool encobjAdded = false; bool encobjAdded = false;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
const char *src = virDomainDiskGetSource(disk);
virJSONValuePtr secobjProps = NULL; virJSONValuePtr secobjProps = NULL;
virJSONValuePtr encobjProps = NULL; virJSONValuePtr encobjProps = NULL;
qemuDomainDiskPrivatePtr diskPriv; qemuDomainDiskPrivatePtr diskPriv;
...@@ -481,7 +480,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, ...@@ -481,7 +480,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
qemuDomainDelDiskSrcTLSObject(driver, vm, disk->src); qemuDomainDelDiskSrcTLSObject(driver, vm, disk->src);
if (releaseaddr) if (releaseaddr)
qemuDomainReleaseDeviceAddress(vm, &disk->info, src); qemuDomainReleaseDeviceAddress(vm, &disk->info, disk->dst);
ignore_value(qemuDomainPrepareDisk(driver, vm, disk, NULL, true)); ignore_value(qemuDomainPrepareDisk(driver, vm, disk, NULL, true));
goto cleanup; goto cleanup;
...@@ -855,12 +854,11 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, ...@@ -855,12 +854,11 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
virDomainDiskDefPtr disk = dev->data.disk; virDomainDiskDefPtr disk = dev->data.disk;
virDomainDiskDefPtr orig_disk = NULL; virDomainDiskDefPtr orig_disk = NULL;
int ret = -1; int ret = -1;
const char *src = virDomainDiskGetSource(disk);
if (STRNEQ_NULLABLE(virDomainDiskGetDriver(disk), "qemu")) { if (STRNEQ_NULLABLE(virDomainDiskGetDriver(disk), "qemu")) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported driver name '%s' for disk '%s'"), _("unsupported driver name '%s' for disk '%s'"),
virDomainDiskGetDriver(disk), src); virDomainDiskGetDriver(disk), disk->dst);
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册