]> xenbits.xensource.com Git - libvirt.git/commit
undefine: Extend virsh undefine to support the new flag
authorOsier Yang <jyang@redhat.com>
Wed, 20 Jul 2011 03:12:46 +0000 (11:12 +0800)
committerOsier Yang <jyang@redhat.com>
Wed, 20 Jul 2011 03:12:46 +0000 (11:12 +0800)
commit83e849c197caf09373d1ff7337d9e2b487ad905c
treebe2235ff4d415bd68e6da0b825911183059f472b
parent39babffb7348c794909be1ac50c7d84946507a63
undefine: Extend virsh undefine to support the new flag

If the domain has managed save image, and --managed-save is
not specified, then it fails with an error telling the user
that a managed save image still exists.

If the domain has managed save image, and --managed-save is
specified, it invokes virDomainUndefineFlags. If
virDomainUndefineFlags fails, then it tries to remove the managed
save image using virDomainManagedSaveRemove first, with
invoking virDomainUndefine following. (For compatibility between
new virsh with this patch and older libvirt without this patch).

Similarly if the domain has no managed save image. See the codes for
detail.

NOTE: Have not removing the codes checking if the domain is running
in function "cmdUndefine", it will go along with qemu driver's fix
(allow to undefine a running domain).
tools/virsh.c
tools/virsh.pod