mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemuConnectMonitor: fix a bug that would have masked SELinux failure
* src/qemu/qemu_driver.c (qemuConnectMonitor): Correct erroneous parenthesization in two expressions. Without this fix, failure to set or clear SELinux security context in the monitor would go undiagnosed. Also correct a diagnostic and split some long lines.
This commit is contained in:
parent
f9abc44ad5
commit
c1fd7d7b3e
@ -1194,10 +1194,12 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm)
|
|||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if ((driver->securityDriver &&
|
if (driver->securityDriver &&
|
||||||
driver->securityDriver->domainSetSecuritySocketLabel &&
|
driver->securityDriver->domainSetSecuritySocketLabel &&
|
||||||
driver->securityDriver->domainSetSecuritySocketLabel(driver->securityDriver,vm)) < 0) {
|
driver->securityDriver->domainSetSecuritySocketLabel
|
||||||
VIR_ERROR(_("Failed to set security context for monitor for %s"), vm->def->name);
|
(driver->securityDriver,vm) < 0) {
|
||||||
|
VIR_ERROR(_("Failed to set security context for monitor for %s"),
|
||||||
|
vm->def->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1213,10 +1215,12 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm)
|
|||||||
if (priv->mon == NULL)
|
if (priv->mon == NULL)
|
||||||
virDomainObjUnref(vm);
|
virDomainObjUnref(vm);
|
||||||
|
|
||||||
if ((driver->securityDriver &&
|
if (driver->securityDriver &&
|
||||||
driver->securityDriver->domainClearSecuritySocketLabel &&
|
driver->securityDriver->domainClearSecuritySocketLabel &&
|
||||||
driver->securityDriver->domainClearSecuritySocketLabel(driver->securityDriver,vm)) < 0) {
|
driver->securityDriver->domainClearSecuritySocketLabel
|
||||||
VIR_ERROR(_("Failed to set security context for monitor for %s"), vm->def->name);
|
(driver->securityDriver,vm) < 0) {
|
||||||
|
VIR_ERROR(_("Failed to clear security context for monitor for %s"),
|
||||||
|
vm->def->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user