From: aliguori Date: Fri, 13 Mar 2009 16:18:57 +0000 (+0000) Subject: make qemu_announce_self handle non contiguous net tables (Marcelo Tosatti) X-Git-Tag: xen-3.4.0-rc2~1^2~20^2~9 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4827c90ceff8db7de6627c57a8bb7b56daf3fc55;p=qemu-xen-3.4-testing.git make qemu_announce_self handle non contiguous net tables (Marcelo Tosatti) With hotplug nd_table might contain holes. Noticed by Eduardo Habkost. Signed-off-by: Marcelo Tosatti Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10_0@6846 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/savevm.c b/savevm.c index 3eb2000a..3b494144 100644 --- a/savevm.c +++ b/savevm.c @@ -118,7 +118,9 @@ void qemu_announce_self(void) VLANClientState *vc; uint8_t buf[256]; - for (i = 0; i < nb_nics; i++) { + for (i = 0; i < MAX_NICS; i++) { + if (!nd_table[i].used) + continue; len = announce_self_create(buf, nd_table[i].macaddr); vlan = nd_table[i].vlan; for(vc = vlan->first_client; vc != NULL; vc = vc->next) {