[libvirt] [PATCH v2] qemu: Unlink managed state file when a domain is undefined

Eric Blake eblake at redhat.com
Mon Apr 25 14:29:13 UTC 2011


On 04/25/2011 03:41 AM, Osier Yang wrote:
> The managed state file is not useful anymore after the domain is
> undefined, and perhaps cause confusion. E.g. define & start a domain
> which has same name but different UUID with previous undefined
> domain later.
> 
> v1 - v2:
>    * Try to delete the managed state file before delete domain
> config file, and goto fail if it failed to delete it.
> ---
>  src/qemu/qemu_driver.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)

Ouch.  virDomainUndefine doesn't have a flags argument.  But this is
changing behavior in a user-visible manner (arguably for the better, but
any change is risky)

We have two options:

1. Proceed with the change: virDomainUndefine removes all associated
snapshot data; but this is a silent change in behavior

2. Add a new API: virDomainUndefineFlags; flag 0 leaves snapshot data
around (but warns), flag VIR_DOMAIN_UNDEFINE_ALL_ASSOCIATED_DATA (or
some better name) guarantees that snapshots are also removed

Being an API question, I think danpb might need to weigh in before we
make a change.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110425/2b8d76f1/attachment-0001.sig>


More information about the libvir-list mailing list