[libvirt] [PATCH 4/5] save domain status during vm creation and remove it on shutdown.

Guido Günther agx at sigxcpu.org
Mon Dec 15 20:27:39 UTC 2008

On Mon, Dec 15, 2008 at 05:48:25PM +0100, Gerd v. Egidy wrote:
> Hi Guido,
> > This patch does the actual saving and removal of the vm status. It does
> > so only at vm creation time at the moment. We need to update the config
> > every time the life config changes later.
> sorry for asking such "dumb" questions here on a developer-list, but would you 
> mind to tell a bit how libvirt with qemu/kvm should work with your patches 
> (all 5 you posted + something you plan for the near future):
First on the list is to make qemu/kvm survive daemon restarts (e.g.
updates) and crashes.

> - libvirt is shut down gracefully, qemu-domain still running
> Will the qemu-domain get a (soft) shutdown and libvirt waits some time 
> (configurable?) until the domain is down?
Currently we simply kill of qemu/kvm vms on daemon shutdown - this is
not the best solution. At least being able to signal shutdown first and
kill off later should be an option - maybe suspend/resume later.

> Or will libvirt make a snapshot of the domain state and save it into some 
> file?
> Or can I select between these two modes of operation with some config value?
> The last one would be my favorite as it is often faster and more reliable.
This should then be configurable per vm in the vms XML. "Huge" vms with
lots of memory might be quicker to shut down instead of dumping GBs onto
the hard disk.

> - libvirt starts, a qemu-domain has autostart enabled, memory/state is saved 
> to a file into a special directory
> will the snapshot be loaded or the domain started from scratch (with unclean 
> filesystem)?
I think we'll handle that once we're there. Data consistency should be
first priority.

> what will happen if there is a error during loading the state?
> - libvirt is buggy and gets a segfault, qemu-domain (autostart set) still 
> running, libvirt is restarted 
> what will happen to the still-running qemu?
The current code does qemudReconnectVMs before qemudAutostartVMs so if
the domain is still running nothing bad will happen cause it gets
"reconnected" to libvirtd first and autostart doesn't do anything since
it's already there and running.
Hope this helps,
 -- Guido

More information about the libvir-list mailing list