From 74abc3deac6e14ffa9151e425c6e6cd2b075aac5 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 6 Jan 2016 20:43:15 -0500 Subject: [PATCH] qemu: Handle SecurityManagerVerify in post parse Rather than open coding calls. I can't see any reason not to --- src/qemu/qemu_domain.c | 3 +++ src/qemu/qemu_driver.c | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c14ff4561a..00c780d841 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1255,6 +1255,9 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuCanonicalizeMachine(def, qemuCaps) < 0) goto cleanup; + if (virSecurityManagerVerify(driver->securityManager, def) < 0) + goto cleanup; + ret = 0; cleanup: virObjectUnref(qemuCaps); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 114627e6ff..e2134ee36b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1723,9 +1723,6 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, if (virDomainCreateXMLEnsureACL(conn, def) < 0) goto cleanup; - if (virSecurityManagerVerify(driver->securityManager, def) < 0) - goto cleanup; - if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator))) goto cleanup; @@ -7502,9 +7499,6 @@ static virDomainPtr qemuDomainDefineXMLFlags(virConnectPtr conn, const char *xml if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0) goto cleanup; - if (virSecurityManagerVerify(driver->securityManager, def) < 0) - goto cleanup; - if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator))) goto cleanup; -- GitLab