---
src/conf/domain_conf.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 78e394d..1ae10ca 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -24813,24 +24813,24 @@ virDomainObjSetMetadata(virDomainObjPtr vm,
const char *configDir,
unsigned int flags)
{
+ virDomainDefPtr def;
virDomainDefPtr persistentDef;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1);
- if (virDomainLiveConfigHelperMethod(caps, xmlopt, vm, &flags,
- &persistentDef) < 0)
+ if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0)
return -1;
- if (flags & VIR_DOMAIN_AFFECT_LIVE) {
- if (virDomainDefSetMetadata(vm->def, type, metadata, key, uri) < 0)
+ if (def) {
+ if (virDomainDefSetMetadata(def, type, metadata, key, uri) < 0)
return -1;
if (virDomainSaveStatus(xmlopt, stateDir, vm, caps) < 0)
return -1;
}
- if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
+ if (persistentDef) {
if (virDomainDefSetMetadata(persistentDef, type, metadata, key,
uri) < 0)
return -1;
--
2.9.0