[libvirt] [PATCH] Fix bug with loading bridge name for active domain during libvirtd start

Peter Krempa pkrempa at redhat.com
Wed Sep 24 08:48:35 UTC 2014


On 09/18/14 15:31, Pavel Hrdina wrote:
> If you have a bridge network in running domain and libvirtd is restarted
> the information about host bridge interface is lost from live xml.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140085
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  src/conf/domain_conf.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 3ccec1c..fa4166c 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -6837,6 +6837,10 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
>              goto error;
>          }
>          VIR_FREE(class_id);
> +    } else if (actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
> +        char *brname = virXPathString("string(./source/@bridge)", ctxt);
> +        if (brname)
> +            actual->data.bridge.brname = brname;
>      }
>  
>      bandwidth_node = virXPathNode("./bandwidth", ctxt);
> 

Parsers for other network types error out if the requested field is not
present. Also the intermediate variable shouldn't be necessary.

I'd like to see a version with the error before I ACK it, although the
idea is ok.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140924/9dae3833/attachment-0001.sig>


More information about the libvir-list mailing list