Daniel Veillard <veillard(a)redhat.com> wrote:
...
> With the patch below virsh tells what's wrong:
...
> It also adds a test that essentially does this:
>
> $ ./virsh -q -c test:///default undefine 1
> error: a running domain like 1 cannot be undefined;
> to undefine, first shutdown then undefine using its name or UUID
> [Exit 1]
> $ ./virsh -q -c test:///default undefine test
> libvir: Test error test: internal error Domain is still running
> error: Failed to undefine domain test
> [Exit 1]
> $ ./virsh -q -c test:///default 'shutdown 1; undefine test'
> Domain 1 is being shutdown
> Domain test has been undefined
Good idea !
+1
Thanks. Committed.