bkearney | 6 Aug 14:20
Favicon

[PATCH] Multiple nic patch with DLutterkort's second comments applied

# HG changeset patch
# User bkearney@...
# Date 1217876425 14400
# Node ID b0886fb88ca8f5ae62fafd84e727555be259ee55
# Parent  6a207373b908ab521d33cd675c7c8d3854bdc1f1
multiple nic support for virt-image. Added support to allow multiple
interface elements in the virt-image.xml. The command line can specify
any number of -w or -b elements and the tool will add default networks
up to the number of nics specified. It is assumbed that eth0 is the first
item specified eth1 is the second, etc. The user can also specify any number mac address up to the number of
networks specified. If they specify less, then they are auto assigned

diff -r 6a207373b908 -r b0886fb88ca8 doc/image.rng
--- a/doc/image.rng	Tue Jul 29 11:21:07 2008 -0400
+++ b/doc/image.rng	Mon Aug 04 15:00:25 2008 -0400
@@ -47,8 +47,10 @@
       <element name="vcpu"><ref name="countCPU"/></element>
       <!-- Size of memory (in kB) -->
       <element name="memory"><ref name="memoryKB"/></element>
-      <!-- Whether the VM should have a network interface -->
-      <element name="interface"><empty/></element>
+      <!--The number of network interfaces which should exist -->
+      <zeroOrMore>
+        <element name="interface"><empty/></element>
+      </zeroOrMore>
       <!-- Whether the VM has a graphical interface -->
       <element name="graphics"><empty/></element>
     </element>
diff -r 6a207373b908 -r b0886fb88ca8 tests/image.py
--- a/tests/image.py	Tue Jul 29 11:21:07 2008 -0400
(Continue reading)

David Lutterkort | 6 Aug 19:15
Favicon

Re: [PATCH] Multiple nic patch with DLutterkort's second comments applied

On Wed, 2008-08-06 at 08:22 -0400, bkearney@... wrote:
> # HG changeset patch
> # User bkearney@...
> # Date 1217876425 14400
> # Node ID b0886fb88ca8f5ae62fafd84e727555be259ee55
> # Parent  6a207373b908ab521d33cd675c7c8d3854bdc1f1
> multiple nic support for virt-image. Added support to allow multiple
> interface elements in the virt-image.xml. The command line can specify
> any number of -w or -b elements and the tool will add default networks
> up to the number of nics specified. It is assumbed that eth0 is the first
> item specified eth1 is the second, etc. The user can also specify any number mac address up to the number of
networks specified. If they specify less, then they are auto assigned

Sorry for doing this drip-torture style, but I just noticed one more
thing:

> diff -r 6a207373b908 -r b0886fb88ca8 virtinst/cli.py
> --- a/virtinst/cli.py	Tue Jul 29 11:21:07 2008 -0400
> +++ b/virtinst/cli.py	Mon Aug 04 15:00:25 2008 -0400
> @@ -262,41 +262,46 @@
>          fail(_("Unknown network type ") + network)
>      guest.nics.append(n)
>  
> -def digest_networks(macs, bridges, networks):
> +def digest_networks(macs, bridges, networks, nics = 1):

That restricts virt-install to one NIC, since virt-install calls
digest_networks w/o a nics argument. The default needs to be something
that indicates 'unbounded/unknown number of nics' - could just make the
default 10000, which clearly is infinite; cleaner default of course is
(Continue reading)

Bryan Kearney | 6 Aug 19:52
Favicon

Re: [PATCH] Multiple nic patch with DLutterkort's second comments applied


David Lutterkort wrote:
> On Wed, 2008-08-06 at 08:22 -0400, bkearney@... wrote:
>> # HG changeset patch
>> # User bkearney@...
>> # Date 1217876425 14400
>> # Node ID b0886fb88ca8f5ae62fafd84e727555be259ee55
>> # Parent  6a207373b908ab521d33cd675c7c8d3854bdc1f1
>> multiple nic support for virt-image. Added support to allow multiple
>> interface elements in the virt-image.xml. The command line can specify
>> any number of -w or -b elements and the tool will add default networks
>> up to the number of nics specified. It is assumbed that eth0 is the first
>> item specified eth1 is the second, etc. The user can also specify any number mac address up to the number of
networks specified. If they specify less, then they are auto assigned
> 
> Sorry for doing this drip-torture style, but I just noticed one more
> thing:
> 
>> diff -r 6a207373b908 -r b0886fb88ca8 virtinst/cli.py
>> --- a/virtinst/cli.py	Tue Jul 29 11:21:07 2008 -0400
>> +++ b/virtinst/cli.py	Mon Aug 04 15:00:25 2008 -0400
>> @@ -262,41 +262,46 @@
>>          fail(_("Unknown network type ") + network)
>>      guest.nics.append(n)
>>  
>> -def digest_networks(macs, bridges, networks):
>> +def digest_networks(macs, bridges, networks, nics = 1):
> 
> That restricts virt-install to one NIC, since virt-install calls
> digest_networks w/o a nics argument. The default needs to be something
(Continue reading)


Gmane