]> xenbits.xensource.com Git - libvirt.git/commit
Introduce and use virDomainDiskEmptySource
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 31 Mar 2017 13:59:54 +0000 (15:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 3 Apr 2017 06:35:57 +0000 (08:35 +0200)
commit462c4b66fa70a93a548c4ad4a1103ac9a32b9faf
treeb2a00deec8c1d21729ac6e6c047eb2813f147669
parentc3a83bad2aa69a26d03ee8a0b817234f0f78b4a5
Introduce and use virDomainDiskEmptySource

Currently, if we want to zero out disk source (e,g, due to
startupPolicy when starting up a domain) we use
virDomainDiskSetSource(disk, NULL). This works well for file
based storage (storage type file, dir, or block). But it doesn't
work at all for other types like volume and network.

So imagine that you have a domain that has a CDROM configured
which source is a volume from an inactive pool. Because it is
startupPolicy='optional', the CDROM is empty when the domain
starts. However, the source element is not cleared out in the
status XML and thus when the daemon restarts and tries to
reconnect to the domain it refreshes the disks (which fails - the
storage pool is still not running) and thus the domain is killed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
src/qemu/qemu_domain.c
src/qemu/qemu_process.c