Re: [libvirt] [PATCH 1/4] Support delay property in interface bridge xml.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 01, 2010 at 08:40:23PM -0500, Laine Stump wrote:
> ---
>  src/conf/interface_conf.c |   11 +++++++----
>  src/conf/interface_conf.h |    1 +
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
> index 3c99027..ca82208 100644
> --- a/src/conf/interface_conf.c
> +++ b/src/conf/interface_conf.c
> @@ -801,6 +801,7 @@ virInterfaceDefParseXML(virConnectPtr conn, xmlXPathContextPtr ctxt) {
>                  }
>                  VIR_FREE(tmp);
>              }
> +            def->data.bridge.delay = virXMLPropString(bridge, "delay");
>              ctxt->node = bridge;
>              virInterfaceDefParseBridge(conn, def, ctxt);
>              break;
> @@ -1038,12 +1039,14 @@ virInterfaceBridgeDefFormat(virConnectPtr conn, virBufferPtr buf,
>      int i;
>      int ret = 0;
>  
> +    virBufferAddLit(buf, "  <bridge");
>      if (def->data.bridge.stp == 1)
> -        virBufferAddLit(buf, "  <bridge stp='on'>\n");
> +        virBufferAddLit(buf, " stp='on'");
>      else if (def->data.bridge.stp == 0)
> -        virBufferAddLit(buf, "  <bridge stp='off'>\n");
> -    else
> -        virBufferAddLit(buf, "  <bridge>\n");
> +        virBufferAddLit(buf, " stp='off'");
> +    if (def->data.bridge.delay != NULL)
> +        virBufferVSprintf(buf, " delay='%s'", def->data.bridge.delay);
> +    virBufferAddLit(buf, ">\n");
>  
>      for (i = 0;i < def->data.bridge.nbItf;i++) {
>          if (virInterfaceBareDevDefFormat(conn, buf, def->data.bridge.itf[i])
> diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h
> index 2683eee..4216087 100644
> --- a/src/conf/interface_conf.h
> +++ b/src/conf/interface_conf.h
> @@ -97,6 +97,7 @@ typedef struct _virInterfaceBridgeDef virInterfaceBridgeDef;
>  typedef virInterfaceBridgeDef *virInterfaceBridgeDefPtr;
>  struct _virInterfaceBridgeDef {
>      int stp;         /* 0, 1 or -1 if undefined */
> +    char *delay;
>      int nbItf;       /* number of defined interfaces */
>      virInterfaceBareDefPtr *itf;/* interfaces */
>  };

ACK

Though, it'd be nice to convert this to an integer.

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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]