WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm: Exceed maximum number of ioemu's NIC for VNIF.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 04 Jun 2007 03:16:19 -0700
Delivery-date: Mon, 04 Jun 2007 03:18:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] hvm: Exceed maximum number of ioemu's NIC for VNIF., Xen patchbot-unstable <=