diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 7eb387d17e8b530b8578da12870dccfb936a84f8..7dcbc5cc4eb04ba59f355ea125f80d91dda93227 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1876,17 +1876,17 @@ cmdList(vshControl *ctl, const vshCmd *cmd) else ignore_value(virStrcpyStatic(id_buf, "-")); - state = virshDomainState(ctl, dom, NULL); + if (optTable) { + state = virshDomainState(ctl, dom, NULL); - /* Domain could've been removed in the meantime */ - if (state < 0) - continue; + /* Domain could've been removed in the meantime */ + if (state < 0) + continue; - if (optTable && managed && state == VIR_DOMAIN_SHUTOFF && - virDomainHasManagedSaveImage(dom, 0) > 0) - state = -2; + if (managed && state == VIR_DOMAIN_SHUTOFF && + virDomainHasManagedSaveImage(dom, 0) > 0) + state = -2; - if (optTable) { if (optTitle) { if (!(title = virshGetDomainDescription(ctl, dom, true, 0))) goto cleanup;