Re: [libvirt] [PATCH 03/10] qemu: hotplug: Don't format NULL in %s in qemuHotplugPrepareDiskAccess

2018-07-18 Thread Ján Tomko

On Tue, Jul 17, 2018 at 02:14:23PM +0200, Peter Krempa wrote:

The warning messages which include the disk source could potentially
format NULL using %s as virDomainDiskGetSource may return NULL for e.g.
NBD disks. As most of the APIs are NOOP for remote disks the usage of
the source string only should be fine for now.

Signed-off-by: Peter Krempa 
---
src/qemu/qemu_hotplug.c | 8 
1 file changed, 4 insertions(+), 4 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 03/10] qemu: hotplug: Don't format NULL in %s in qemuHotplugPrepareDiskAccess

2018-07-17 Thread Peter Krempa
The warning messages which include the disk source could potentially
format NULL using %s as virDomainDiskGetSource may return NULL for e.g.
NBD disks. As most of the APIs are NOOP for remote disks the usage of
the source string only should be fine for now.

Signed-off-by: Peter Krempa 
---
 src/qemu/qemu_hotplug.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 20efb01dbf..624341baa1 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -126,21 +126,21 @@ qemuHotplugPrepareDiskAccess(virQEMUDriverPtr driver,
  rollback_cgroup:
 if (qemuTeardownDiskCgroup(vm, disk) < 0)
 VIR_WARN("Unable to tear down cgroup access on %s",
- virDomainDiskGetSource(disk));
+ NULLSTR(virDomainDiskGetSource(disk)));
  rollback_label:
 if (qemuSecurityRestoreDiskLabel(driver, vm, disk) < 0)
 VIR_WARN("Unable to restore security label on %s",
- virDomainDiskGetSource(disk));
+ NULLSTR(virDomainDiskGetSource(disk)));

  rollback_namespace:
 if (qemuDomainNamespaceTeardownDisk(vm, disk->src) < 0)
 VIR_WARN("Unable to remove /dev entry for %s",
- virDomainDiskGetSource(disk));
+ NULLSTR(virDomainDiskGetSource(disk)));

  rollback_lock:
 if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0)
 VIR_WARN("Unable to release lock on %s",
- virDomainDiskGetSource(disk));
+ NULLSTR(virDomainDiskGetSource(disk)));

  cleanup:
 if (origsrc)
-- 
2.16.2

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