aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-31 10:58:22 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-31 10:58:22 +0100
commit06bdfbd284b63c5ace60a0dfa58463e9e51163ee (patch)
treea8a0fa210d79038363240660aeba1c57643e5989
parentcdcecbefd44ebdc219753fa79786d5b44ce24829 (diff)
downloadxen-06bdfbd284b63c5ace60a0dfa58463e9e51163ee.tar.gz
xen-06bdfbd284b63c5ace60a0dfa58463e9e51163ee.tar.bz2
xen-06bdfbd284b63c5ace60a0dfa58463e9e51163ee.zip
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@jp.fujitsu.com> Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
-rw-r--r--tools/ioemu/vl.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c
index b1fe292d9b..50a0a5b0e0 100644
--- a/tools/ioemu/vl.c
+++ b/tools/ioemu/vl.c
@@ -3965,30 +3965,30 @@ static int net_client_init(const char *str)
NICInfo *nd;
uint8_t *macaddr;
- if (nb_nics >= MAX_NICS) {
- 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 (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++;
+ 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");
+ }
ret = 0;
} else
if (!strcmp(device, "none")) {