[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] How to avoid the disk still persistent after no persistent hotplug and with restarting libvirtd then.

于 2011年08月20日 01:16, Eric Blake 写道:
On 08/19/2011 08:17 AM, Osier Yang wrote:
Libvirt loads the domain conf from the status file
if the domain is running, the problem if one restart libvirtd just after
some changing on the domain conf, and then destroy/start the guest.
libvirt will never known what the original domain conf is then.
(vm->newdef is NULL at this moment, generally libvirt restore the domain
to the original conf (vm->newDef) when destroying and shutdown).

Sounds to me like this is a bug in libvirtd reloading. For a running persistent guest, libvirt should be looking in two files: both the running state (/var/run/libvirt/qemu/$dom.xml) and the next-boot state (/etc/lib/libvirt/qemu/$dom.xml); and if they differ, then assign vm->newDef to the persistent definition.

Is this too expensive? Need to compare most of the properties of the
domain conf (except the auto-generated info, and some other fixed info
such as domain name, UUID, etc. All other info which could be changed
lively should be compared).

Instead remeber if there was live changes in XML cost low, though need
to modify much of the functions I guess.

In other words, the bug is that vm->newdef was NULL after libvirtd restart.


The solution in my mind is to add some attribute to the status XML, such
as "live_updated=1", and do the checking when loading the domain conf
from status XML:

Shouldn't need any XML changes; rather, libvirtd just needs to be taught to properly reconstruct its state from multiple files, instead of assuming that the first file that worked was all the state it needed.

For a transient domain, we still have no way to get the original domain
that means one will still be surprised when seeing the the disk is still

For a transient domain, it is already forbidden to request a persistent change. So you can't get into this situation in the first place unless you have a persistent domain.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]