]> xenbits.xensource.com Git - libvirt.git/commit
conf: Assign newDef of active domain as persistent conf if it is NULL
authorOsier Yang <jyang@redhat.com>
Thu, 1 Sep 2011 13:33:29 +0000 (21:33 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 20 Sep 2011 03:15:44 +0000 (11:15 +0800)
commitb4c3be5943d90a7222eeef860f4554c994b7fe0b
treecffafc9c86c9d30792538d0a8c7bd496a8b07291
parent891c6fd74f1d485ab81eff34b8a15a79528373f1
conf: Assign newDef of active domain as persistent conf if it is NULL

Libvirt loads the domain conf from status XML if it's running when
starting up. The problem is there is no record of the original conf.
(dom->newDef is NULL here).

So libvirt won't be able to restore the domain conf to original one
when destroying/shutdown. E.g.

1) attach a device without "--persistent"
2) restart libvirtd
3) destroy domain
4) start domain

One will see the the disk still exists.

This patch is to fix the peoblem by assigning persistent domain conf
to dom->newDef if it's NULL and the domain is running.
src/conf/domain_conf.c