[libvirt] [PATCH] {domain, network}_conf: disable autostart when deleting config

Peter Krempa pkrempa at redhat.com
Wed Mar 11 06:33:48 UTC 2015


On Wed, Mar 11, 2015 at 13:20:28 +1100, Michael Chapman wrote:
> Undefining a running, autostarted domain removes the autostart link, but
> dom->autostart is not cleared. If the domain is subsequently redefined,
> libvirt thinks it is already autostarted and will not create the link
> even if requested:
> 
>   # virsh dominfo example | grep Autostart
>   Autostart:      enable
> 
>   # ls /etc/libvirt/qemu/autostart/example.xml
>   /etc/libvirt/qemu/autostart/example.xml
> 
>   # virsh undefine example
>   Domain example has been undefined
> 
>   # virsh define example.xml
>   Domain example defined from example.xml
> 
>   # virsh dominfo example | grep Autostart
>   Autostart:      enable
> 
>   # virsh autostart example
>   Domain example marked as autostarted
> 
>   # ls /etc/libvirt/qemu/autostart/example.xml
>   ls: cannot access /etc/libvirt/qemu/autostart/example.xml: No such file or directory
> 
> This commit ensures dom->autostart is cleared whenever the config and
> autostart link (if present) are removed.
> 
> The bridge network driver cleared this flag itself in networkUndefine.
> This commit moves this into virNetworkDeleteConfig for symmetry with
> virDomainDeleteConfig, and to ensure it is not missed in future network
> drivers.
> 
> Signed-off-by: Michael Chapman <mike at very.puzzling.org>
> ---
>  src/conf/domain_conf.c      | 1 +
>  src/conf/network_conf.c     | 1 +
>  src/network/bridge_driver.c | 1 -
>  3 files changed, 2 insertions(+), 1 deletion(-)

ACK && pushed. Thanks for taking time to write up the reproducer steps.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150311/1759e3bd/attachment-0001.sig>


More information about the libvir-list mailing list