[PATCH 1/9] Remove VIR_STRDUP usage that snuck in

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

 



Fixes: 224d269f19f0a6c496dd2218f934a54742d51708

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9c517597bb..ffac73dd42 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -12835,8 +12835,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
             if (!usb)
                 goto cleanup;
 
-            if (VIR_STRDUP(tmpPath, virUSBDeviceGetPath(usb)) < 0)
-                goto cleanup;
+            tmpPath = g_strdup(virUSBDeviceGetPath(usb));
             perm = VIR_CGROUP_DEVICE_RW;
             break;
 
@@ -12857,8 +12856,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
                 if (!scsi)
                     goto cleanup;
 
-                if (VIR_STRDUP(tmpPath, virSCSIDeviceGetPath(scsi)) < 0)
-                    goto cleanup;
+                tmpPath = g_strdup(virSCSIDeviceGetPath(scsi));
                 perm = virSCSIDeviceGetReadonly(scsi) ?
                     VIR_CGROUP_DEVICE_READ : VIR_CGROUP_DEVICE_RW;
             }
@@ -12870,8 +12868,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
                 if (!(host = virSCSIVHostDeviceNew(hostsrc->wwpn)))
                     goto cleanup;
 
-                if (VIR_STRDUP(tmpPath, virSCSIVHostDeviceGetPath(host)) < 0)
-                    goto cleanup;
+                tmpPath = g_strdup(virSCSIVHostDeviceGetPath(host));
                 perm = VIR_CGROUP_DEVICE_RW;
             }
             break;
-- 
2.21.0

--
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