提交 1eb53f05 编写于 作者: M Martin Kletzander

virsh: don't list unknown domains

When the list of domains is fetched and being printed, but in the
meantime one domain was undefined before its status was fetched, the
output then includes domain with "no state".  With this patch, such
domain is skipped over as consecutive 'virsh list --all' (or the same
one ran a second later) wouldn't list it anyway.
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 b3880bbe
......@@ -1916,6 +1916,11 @@ cmdList(vshControl *ctl, const vshCmd *cmd)
ignore_value(virStrcpyStatic(id_buf, "-"));
state = vshDomainState(ctl, dom, NULL);
/* 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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册