[libvirt] Proper behavior when "creating" a new transient domain with same name/uuid as existing persistent domain

Laine Stump laine at laine.org
Mon Apr 21 11:13:43 UTC 2014


Playing around with the network driver I found that if I net-define a
network, then net-create using a slightly modified version of the same
XML file (e.g. different bridge name, but same name/uuid) the following
will happen:

1) a network of that name is started, it is persistent, and it has the
properties from the modified XML file (the one given to net-create).

2) both "net-dumpxml" and "net-dumpxml --inactive" will show the
modified attributes.

3) when I net-destroy the network, the network will still exist (since
it is still persistent), but will have all of the modified attributes
rather than the originals.

Wanting the network driver to behave consistently with the qemu driver,
I did the same test with a qemu domain. I found exactly the same behavior.

I would have expected that when I tried to create a domain (or network)
with the same name & UUID as an existing persistent&inactive domain (or
network) that one of the following two things would happen:

1) the operation would fail because a persistent domain/network already
existed

2) the domain/network would be started with the modified attributes, but
the persistent definition would still show the original attributes,
which would remain after destroying the transient

3) upon creating the transient version, the domain/network would have
its persistent flag cleared, and would thus cease to exist when destroyed.

Was the current behavior consciously arrived at, or is it just an
accident of circumstances? If the latter, then what should the proper
behavior be? (I would vote for (2))




More information about the libvir-list mailing list