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

[Xen-changelog] [xen-unstable] hvm: Exceed maximum number of ioemu's NIC for VNIF.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1180605502 -3600
# Node ID e2ba95ed2b091333984e1cc7283255323db9058f
# Parent  4c2b8ca4842cd584102bdf98a24d9e26642228ad
hvm: Exceed maximum number of ioemu's NIC for VNIF.

QEMU should ignore excess NICs instead of failing to initialise.

Signed-off-by: Takanori Kasai <kasai.takanori@xxxxxxxxxxxxxx>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@xxxxxxxxxxxxxx>
---
 tools/ioemu/vl.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff -r 4c2b8ca4842c -r e2ba95ed2b09 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Thu May 31 10:53:11 2007 +0100
+++ b/tools/ioemu/vl.c  Thu May 31 10:58:22 2007 +0100
@@ -3965,30 +3965,30 @@ static int net_client_init(const char *s
         NICInfo *nd;
         uint8_t *macaddr;
 
-        if (nb_nics >= MAX_NICS) {
+        if (nb_nics < MAX_NICS) {
+            nd = &nd_table[nb_nics];
+            macaddr = nd->macaddr;
+            macaddr[0] = 0x52;
+            macaddr[1] = 0x54;
+            macaddr[2] = 0x00;
+            macaddr[3] = 0x12;
+            macaddr[4] = 0x34;
+            macaddr[5] = 0x56 + nb_nics;
+
+            if (get_param_value(buf, sizeof(buf), "macaddr", p)) {
+                if (parse_macaddr(macaddr, buf) < 0) {
+                    fprintf(stderr, "invalid syntax for ethernet address\n");
+                    return -1;
+                }
+            }
+            if (get_param_value(buf, sizeof(buf), "model", p)) {
+                nd->model = strdup(buf);
+            }
+            nd->vlan = vlan;
+            nb_nics++;
+        } else {
             fprintf(stderr, "Too Many NICs\n");
-            return -1;
-        }
-        nd = &nd_table[nb_nics];
-        macaddr = nd->macaddr;
-        macaddr[0] = 0x52;
-        macaddr[1] = 0x54;
-        macaddr[2] = 0x00;
-        macaddr[3] = 0x12;
-        macaddr[4] = 0x34;
-        macaddr[5] = 0x56 + nb_nics;
-
-        if (get_param_value(buf, sizeof(buf), "macaddr", p)) {
-            if (parse_macaddr(macaddr, buf) < 0) {
-                fprintf(stderr, "invalid syntax for ethernet address\n");
-                return -1;
-            }
-        }
-        if (get_param_value(buf, sizeof(buf), "model", p)) {
-            nd->model = strdup(buf);
-        }
-        nd->vlan = vlan;
-        nb_nics++;
+       }
         ret = 0;
     } else
     if (!strcmp(device, "none")) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.