Re: [libvirt] [PATCH 1/3] support for "Internal" network in libvirt

2009-05-11 Thread Daniel Veillard
On Wed, May 06, 2009 at 06:11:42PM +0200, Pritesh Kothari wrote:
> Hi All,
> 
> As discussed on the list resending the networking patch's. the patch's are as 
> below:
> 
> [PATCH 1/3]: contains support for "Internal" network in libvirt
[...]
> +case VIR_DOMAIN_NET_TYPE_INTERNAL:
> +if (internal == NULL) {
> +virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
> +"No  'name' attribute specified with  type='internal'/>");

  Okay, looks fine, I just had to mark that diagnostic string for
localization as pointed out by "make syntax-check".

  The patch being standalone, applied and commited,

 thanks !

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] [PATCH 1/3] support for "Internal" network in libvirt

2009-05-06 Thread Daniel P. Berrange
On Wed, May 06, 2009 at 06:11:42PM +0200, Pritesh Kothari wrote:
> Hi All,
> 
> As discussed on the list resending the networking patch's. the patch's are as 
> below:
> 
> [PATCH 1/3]: contains support for "Internal" network in libvirt

ACK

> commit 34a1776a7049ad5b5678739d597e441686aa6e7e
> Author: pk221555 
> Date:   Wed May 6 17:05:32 2009 +0200
> 
> libvirt: Added support for "Internal" network in libvirt
> 
> diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
> index 2f784e1..f1fc8c7 100644
> --- a/docs/schemas/domain.rng
> +++ b/docs/schemas/domain.rng
> @@ -586,6 +586,20 @@
>  
>
>  
> +
> +  
> +internal
> +  
> +  
> +
> +  
> +
> +  
> +  
> +
> +
> +  
> +
>
>  
>
> diff --git a/src/domain_conf.c b/src/domain_conf.c
> index dde4020..878cd5e 100644
> --- a/src/domain_conf.c
> +++ b/src/domain_conf.c
> @@ -119,7 +119,8 @@ VIR_ENUM_IMPL(virDomainNet, VIR_DOMAIN_NET_TYPE_LAST,
>"client",
>"mcast",
>"network",
> -  "bridge")
> +  "bridge",
> +  "internal")
>  
>  VIR_ENUM_IMPL(virDomainChr, VIR_DOMAIN_CHR_TYPE_LAST,
>"null",
> @@ -310,6 +311,10 @@ void virDomainNetDefFree(virDomainNetDefPtr def)
>  VIR_FREE(def->data.bridge.script);
>  VIR_FREE(def->data.bridge.ipaddr);
>  break;
> +
> +case VIR_DOMAIN_NET_TYPE_INTERNAL:
> +VIR_FREE(def->data.internal.name);
> +break;
>  }
>  
>  VIR_FREE(def->ifname);
> @@ -887,6 +892,7 @@ virDomainNetDefParseXML(virConnectPtr conn,
>  char *address = NULL;
>  char *port = NULL;
>  char *model = NULL;
> +char *internal = NULL;
>  
>  if (VIR_ALLOC(def) < 0) {
>  virReportOOMError(conn);
> @@ -914,6 +920,10 @@ virDomainNetDefParseXML(virConnectPtr conn,
> (def->type == VIR_DOMAIN_NET_TYPE_NETWORK) &&
> (xmlStrEqual(cur->name, BAD_CAST "source"))) {
>  network = virXMLPropString(cur, "network");
> +} else if ((internal == NULL) &&
> +   (def->type == VIR_DOMAIN_NET_TYPE_INTERNAL) &&
> +   (xmlStrEqual(cur->name, BAD_CAST "source"))) {
> +internal = virXMLPropString(cur, "name");
>  } else if ((network == NULL) &&
> (def->type == VIR_DOMAIN_NET_TYPE_BRIDGE) &&
> (xmlStrEqual(cur->name, BAD_CAST "source"))) {
> @@ -1029,6 +1039,15 @@ virDomainNetDefParseXML(virConnectPtr conn,
>  def->data.socket.address = address;
>  address = NULL;
>  }
> +case VIR_DOMAIN_NET_TYPE_INTERNAL:
> +if (internal == NULL) {
> +virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
> +"No  'name' attribute specified with  type='internal'/>");
> +goto error;
> +}
> +def->data.internal.name = internal;
> +internal = NULL;
> +break;
>  }
>  
>  if (ifname != NULL) {
> @@ -1066,6 +1085,7 @@ cleanup:
>  VIR_FREE(bridge);
>  VIR_FREE(model);
>  VIR_FREE(type);
> +VIR_FREE(internal);
>  
>  return def;
>  
> @@ -3047,6 +3067,12 @@ virDomainNetDefFormat(virConnectPtr conn,
>  else
>  virBufferVSprintf(buf, "  \n",
>def->data.socket.port);
> +
> +case VIR_DOMAIN_NET_TYPE_INTERNAL:
> +virBufferEscapeString(buf, "  \n",
> +  def->data.internal.name);
> +break;
> +
>  }
>  
>  if (def->ifname)
> diff --git a/src/domain_conf.h b/src/domain_conf.h
> index d4e7442..e79f1d5 100644
> --- a/src/domain_conf.h
> +++ b/src/domain_conf.h
> @@ -138,6 +138,7 @@ enum virDomainNetType {
>  VIR_DOMAIN_NET_TYPE_MCAST,
>  VIR_DOMAIN_NET_TYPE_NETWORK,
>  VIR_DOMAIN_NET_TYPE_BRIDGE,
> +VIR_DOMAIN_NET_TYPE_INTERNAL,
>  
>  VIR_DOMAIN_NET_TYPE_LAST,
>  };
> @@ -168,6 +169,9 @@ struct _virDomainNetDef {
>  char *script;
>  char *ipaddr;
>  } bridge;
> +struct {
> +char *name;
> +} internal;
>  } data;
>  char *ifname;
>  };

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


-- 
|: 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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 1/3] support for "Internal" network in libvirt

2009-05-06 Thread Pritesh Kothari
Hi All,

As discussed on the list resending the networking patch's. the patch's are as 
below:

[PATCH 1/3]: contains support for "Internal" network in libvirt
[PATCH 2/3]: contains support for "Host only" and "Internal" networks in 
VirtualBox driver
[PATCH 3/3]: contains networking API for hostonly networks in VirtualBox 
driver in libvirt (it contains all the fix's proposed on list along with two 
extra *DefinedNetworks functions)

The patches work as per cvs checkin today. (git SHA1 ID: 
9136ae2056b45ea83854d3fe31d860f645b8c883)

Regards,
Pritesh



commit 34a1776a7049ad5b5678739d597e441686aa6e7e
Author: pk221555 
Date:   Wed May 6 17:05:32 2009 +0200

libvirt: Added support for "Internal" network in libvirt

diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 2f784e1..f1fc8c7 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -586,6 +586,20 @@
 
   
 
+
+  
+internal
+  
+  
+
+  
+
+  
+  
+
+
+  
+
   
 
   
diff --git a/src/domain_conf.c b/src/domain_conf.c
index dde4020..878cd5e 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -119,7 +119,8 @@ VIR_ENUM_IMPL(virDomainNet, VIR_DOMAIN_NET_TYPE_LAST,
   "client",
   "mcast",
   "network",
-  "bridge")
+  "bridge",
+  "internal")
 
 VIR_ENUM_IMPL(virDomainChr, VIR_DOMAIN_CHR_TYPE_LAST,
   "null",
@@ -310,6 +311,10 @@ void virDomainNetDefFree(virDomainNetDefPtr def)
 VIR_FREE(def->data.bridge.script);
 VIR_FREE(def->data.bridge.ipaddr);
 break;
+
+case VIR_DOMAIN_NET_TYPE_INTERNAL:
+VIR_FREE(def->data.internal.name);
+break;
 }
 
 VIR_FREE(def->ifname);
@@ -887,6 +892,7 @@ virDomainNetDefParseXML(virConnectPtr conn,
 char *address = NULL;
 char *port = NULL;
 char *model = NULL;
+char *internal = NULL;
 
 if (VIR_ALLOC(def) < 0) {
 virReportOOMError(conn);
@@ -914,6 +920,10 @@ virDomainNetDefParseXML(virConnectPtr conn,
(def->type == VIR_DOMAIN_NET_TYPE_NETWORK) &&
(xmlStrEqual(cur->name, BAD_CAST "source"))) {
 network = virXMLPropString(cur, "network");
+} else if ((internal == NULL) &&
+   (def->type == VIR_DOMAIN_NET_TYPE_INTERNAL) &&
+   (xmlStrEqual(cur->name, BAD_CAST "source"))) {
+internal = virXMLPropString(cur, "name");
 } else if ((network == NULL) &&
(def->type == VIR_DOMAIN_NET_TYPE_BRIDGE) &&
(xmlStrEqual(cur->name, BAD_CAST "source"))) {
@@ -1029,6 +1039,15 @@ virDomainNetDefParseXML(virConnectPtr conn,
 def->data.socket.address = address;
 address = NULL;
 }
+case VIR_DOMAIN_NET_TYPE_INTERNAL:
+if (internal == NULL) {
+virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+"No  'name' attribute specified with ");
+goto error;
+}
+def->data.internal.name = internal;
+internal = NULL;
+break;
 }
 
 if (ifname != NULL) {
@@ -1066,6 +1085,7 @@ cleanup:
 VIR_FREE(bridge);
 VIR_FREE(model);
 VIR_FREE(type);
+VIR_FREE(internal);
 
 return def;
 
@@ -3047,6 +3067,12 @@ virDomainNetDefFormat(virConnectPtr conn,
 else
 virBufferVSprintf(buf, "  \n",
   def->data.socket.port);
+
+case VIR_DOMAIN_NET_TYPE_INTERNAL:
+virBufferEscapeString(buf, "  \n",
+  def->data.internal.name);
+break;
+
 }
 
 if (def->ifname)
diff --git a/src/domain_conf.h b/src/domain_conf.h
index d4e7442..e79f1d5 100644
--- a/src/domain_conf.h
+++ b/src/domain_conf.h
@@ -138,6 +138,7 @@ enum virDomainNetType {
 VIR_DOMAIN_NET_TYPE_MCAST,
 VIR_DOMAIN_NET_TYPE_NETWORK,
 VIR_DOMAIN_NET_TYPE_BRIDGE,
+VIR_DOMAIN_NET_TYPE_INTERNAL,
 
 VIR_DOMAIN_NET_TYPE_LAST,
 };
@@ -168,6 +169,9 @@ struct _virDomainNetDef {
 char *script;
 char *ipaddr;
 } bridge;
+struct {
+char *name;
+} internal;
 } data;
 char *ifname;
 };
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list