From: Peter Krempa Date: Mon, 9 Nov 2015 12:44:29 +0000 (+0100) Subject: qemu: hotplug: Reject VFIO hotplug if setting RLIMIT_MEMLOCK fails X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=baf55e1fa41a6aa77a5373891d70947ef24acadd;p=libvirt.git qemu: hotplug: Reject VFIO hotplug if setting RLIMIT_MEMLOCK fails Check the return value of virCommandSetMaxMemLock when hotplugging VFIO PCI hostdevs and reject the hotplug if the memory limit can't be set. --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index b02e9050f2..13a4b300fd 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1279,7 +1279,10 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, } /* setup memory locking limits, that are necessary for VFIO */ - virProcessSetMaxMemLock(vm->pid, qemuDomainGetMlockLimitBytes(vm->def)); + if (virProcessSetMaxMemLock(vm->pid, + qemuDomainGetMlockLimitBytes(vm->def)) < 0) + goto error; + break; default: