[libvirt] RFC: add new API to known if domain has been updated

Daniel P. Berrange berrange at redhat.com
Mon Nov 15 10:56:58 UTC 2010


On Mon, Nov 15, 2010 at 10:26:22AM +0800, Osier Yang wrote:
> Hi, all
> 
> Suppose that one updated a domain, and want to restart the
> domain with original configuration.
> 
> However, currently, unless shutdown the domain first, and then
> restart or reload libvirtd, otherwise domain will still be started
> with changed configuration. e.g.
> 
> # virsh list --all
>  Id Name                 State
> ----------------------------------
>   1 f14                  running
> 
> # virsh dumpxml f14 | grep -A 7 cdrom
>     <disk type='file' device='cdrom'>
>       <driver name='qemu' type='raw'/>
>       <source file='/var/lib/libvirt/images/cd1.iso'/>
>       <target dev='hdc' bus='ide'/>
>       <readonly/>
>       <alias name='ide0-1-0'/>
>       <address type='drive' controller='0' bus='1' unit='0'/>
>     </disk>
> 
> # virsh update-device f14 cd2.xml
> 
> # virsh dumpxml f14 | grep -A 7 cdrom
>     <disk type='file' device='cdrom'>
>       <driver name='qemu' type='raw'/>
>       <source file='/var/lib/libvirt/images/cd2.iso'/>
>       <target dev='hdc' bus='ide'/>
>       <readonly/>
>       <alias name='ide0-1-0'/>
>       <address type='drive' controller='0' bus='1' unit='0'/>
>     </disk>
> 
> # virsh destroy f14
> # virsh start f14
> 
> # virsh dumpxml f14 | grep -A 7 cdrom
>     <disk type='file' device='cdrom'>
>       <driver name='qemu' type='raw'/>
>       <source file='/var/lib/libvirt/images/cd2.iso'/>
>       <target dev='hdc' bus='ide'/>
>       <readonly/>
>       <alias name='ide0-1-0'/>
>       <address type='drive' controller='0' bus='1' unit='0'/>
>     </disk>
> 
> it's caused by libvirtd doesn't known if a domain is updated or not,
> it updated the domain configuration in memory, but client could
> not known about it.
> 
> As a result, one wants to start the domain with original configuration,
> he has to shutdown the domain first, and then restart libvirt.

This is a bug. libvirt should save a copy of the original configuration
at the time the guest starts, so any live changes only remain for the
duration of that boot and automatically revert at shutdown.

Regards,
Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list