diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 803666162a..e9fd64f93c 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -1131,9 +1131,7 @@ bhyveDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - bhyveConnPtr privconn = dom->conn->privateData; virDomainObjPtr vm; - virCapsPtr caps = NULL; char *ret = NULL; if (!(vm = bhyveDomObjFromDomain(dom))) @@ -1142,14 +1140,9 @@ bhyveDomainGetMetadata(virDomainPtr dom, if (virDomainGetMetadataEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (!(caps = bhyveDriverGetCapabilities(privconn))) - goto cleanup; - - ret = virDomainObjGetMetadata(vm, type, uri, caps, - privconn->xmlopt, flags); + ret = virDomainObjGetMetadata(vm, type, uri, flags); cleanup: - virObjectUnref(caps); virObjectUnlock(vm); return ret; } diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index da5a42b23f..f6ab45cd2f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24781,9 +24781,7 @@ virDomainDefFindDevice(virDomainDefPtr def, char * virDomainObjGetMetadata(virDomainObjPtr vm, int type, - const char *uri ATTRIBUTE_UNUSED, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt, + const char *uri, unsigned int flags) { virDomainDefPtr def; @@ -24798,13 +24796,9 @@ virDomainObjGetMetadata(virDomainObjPtr vm, goto cleanup; } - if (virDomainLiveConfigHelperMethod(caps, xmlopt, vm, &flags, &def) < 0) + if (!(def = virDomainObjGetOneDef(vm, flags))) goto cleanup; - /* use correct domain definition according to flags */ - if (flags & VIR_DOMAIN_AFFECT_LIVE) - def = vm->def; - switch ((virDomainMetadataType) type) { case VIR_DOMAIN_METADATA_DESCRIPTION: if (VIR_STRDUP(ret, def->description) < 0) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ba0ad5fda8..4ebafbe93b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3052,8 +3052,6 @@ void virDomainChrSourceDefClear(virDomainChrSourceDefPtr def); char *virDomainObjGetMetadata(virDomainObjPtr vm, int type, const char *uri, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt, unsigned int flags); int virDomainObjSetMetadata(virDomainObjPtr vm, diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 9c3d9f2912..46af05d439 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -5381,8 +5381,6 @@ lxcDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virCapsPtr caps = NULL; virDomainObjPtr vm; char *ret = NULL; @@ -5392,14 +5390,10 @@ lxcDomainGetMetadata(virDomainPtr dom, if (virDomainGetMetadataEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (!(caps = virLXCDriverGetCapabilities(driver, false))) - goto cleanup; - - ret = virDomainObjGetMetadata(vm, type, uri, caps, driver->xmlopt, flags); + ret = virDomainObjGetMetadata(vm, type, uri, flags); cleanup: virDomainObjEndAPI(&vm); - virObjectUnref(caps); return ret; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2d7e07b243..f9a3b15223 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17576,8 +17576,6 @@ qemuDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virCapsPtr caps = NULL; virDomainObjPtr vm; char *ret = NULL; @@ -17587,14 +17585,10 @@ qemuDomainGetMetadata(virDomainPtr dom, if (virDomainGetMetadataEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; - - ret = virDomainObjGetMetadata(vm, type, uri, caps, driver->xmlopt, flags); + ret = virDomainObjGetMetadata(vm, type, uri, flags); cleanup: virDomainObjEndAPI(&vm); - virObjectUnref(caps); return ret; } diff --git a/src/test/test_driver.c b/src/test/test_driver.c index baff085606..4ed631b048 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2659,7 +2659,6 @@ static char *testDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - testDriverPtr privconn = dom->conn->privateData; virDomainObjPtr privdom; char *ret; @@ -2669,8 +2668,7 @@ static char *testDomainGetMetadata(virDomainPtr dom, if (!(privdom = testDomObjFromDomain(dom))) return NULL; - ret = virDomainObjGetMetadata(privdom, type, uri, privconn->caps, - privconn->xmlopt, flags); + ret = virDomainObjGetMetadata(privdom, type, uri, flags); virDomainObjEndAPI(&privdom); return ret;