mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
qemu: hotplug: Don't format NULL in %s in qemuHotplugPrepareDiskAccess
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 <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f952dccb8f
commit
13f763fcdd
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user