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.
This commit is contained in:
Peter Krempa 2015-11-09 13:44:29 +01:00
parent ec90b34acf
commit baf55e1fa4

View File

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