[PATCH 3/6] qemu: hotplug: Use disk target in debug/warning messages where appropriate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 src/qemu/qemu_hotplug.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 6bec69a5d..f00d4f546 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -364,7 +364,6 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
     bool secobjAdded = false;
     bool encobjAdded = false;
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
-    const char *src = virDomainDiskGetSource(disk);
     virJSONValuePtr secobjProps = NULL;
     virJSONValuePtr encobjProps = NULL;
     qemuDomainDiskPrivatePtr diskPriv;
@@ -481,7 +480,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
     qemuDomainDelDiskSrcTLSObject(driver, vm, disk->src);

     if (releaseaddr)
-        qemuDomainReleaseDeviceAddress(vm, &disk->info, src);
+        qemuDomainReleaseDeviceAddress(vm, &disk->info, disk->dst);

     ignore_value(qemuDomainPrepareDisk(driver, vm, disk, NULL, true));
     goto cleanup;
@@ -855,12 +854,11 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
     virDomainDiskDefPtr disk = dev->data.disk;
     virDomainDiskDefPtr orig_disk = NULL;
     int ret = -1;
-    const char *src = virDomainDiskGetSource(disk);

     if (STRNEQ_NULLABLE(virDomainDiskGetDriver(disk), "qemu")) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("unsupported driver name '%s' for disk '%s'"),
-                       virDomainDiskGetDriver(disk), src);
+                       virDomainDiskGetDriver(disk), disk->dst);
         goto cleanup;
     }

-- 
2.14.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux