The getters have a different set of flags. Add a variable for the getter
to avoid having to construct flags when calling the getter.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tools/virsh-domain.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 2d1889c71e..cac50dba51 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8341,12 +8341,15 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd)
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
bool ret = false;
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
+ unsigned int queryflags = 0;
VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
- if (config)
+ if (config) {
flags |= VIR_DOMAIN_AFFECT_CONFIG;
+ queryflags |= VIR_DOMAIN_XML_INACTIVE;
+ }
if (live)
flags |= VIR_DOMAIN_AFFECT_LIVE;
@@ -8370,8 +8373,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd)
if (edit || desc) {
if (!desc) {
- desc = virshGetDomainDescription(ctl, dom, title,
- config?VIR_DOMAIN_XML_INACTIVE:0);
+ desc = virshGetDomainDescription(ctl, dom, title, queryflags);
if (!desc)
goto cleanup;
}
@@ -8420,8 +8422,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd)
title ? _("Domain title updated successfully") :
_("Domain description updated successfully"));
} else {
- desc = virshGetDomainDescription(ctl, dom, title,
- config?VIR_DOMAIN_XML_INACTIVE:0);
+ desc = virshGetDomainDescription(ctl, dom, title, queryflags);
if (!desc)
goto cleanup;
--
2.35.1