[virt-tools-list] [PATCH virt-manager 2/2] network: refresh the XML definition on state update

Cole Robinson crobinso at redhat.com
Fri Jul 4 22:27:17 UTC 2014


On 07/03/2014 08:13 AM, Giuseppe Scrivano wrote:
> The XML definition returned by libvirt can change on a state
> transition. vmmNetwork.force_update_status invalidates the old
> definition.
> 
> Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
> ---
>  virtManager/network.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/virtManager/network.py b/virtManager/network.py
> index 4ad4c94..ad1102f 100644
> --- a/virtManager/network.py
> +++ b/virtManager/network.py
> @@ -87,6 +87,7 @@ class vmmNetwork(vmmLibvirtObject):
>              return
>  
>          try:
> +            self.refresh_xml()
>              self._set_active(self._backend_get_active())
>          except:
>              logging.debug("force_update_status: Triggering network "
> 

I'd stick this in _set_active, once we confirm the guest status has actually
changed. That's what's done in the similar function in domain.py (we should
really unify the internal APIs here, but that's a separate task)

- Cole




More information about the virt-tools-list mailing list