Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 340e01248478ba8b78a6d4d1809b1eff > files > 592

kvm-83-270.el5_11.src.rpm

From 604d57337166a39a4f8189e20f2d87e8ee21c4d3 Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Wed, 11 Mar 2009 15:25:03 -0300
Subject: [PATCH 3/3] make qemu_announce_self handle non contiguous net tables

With hotplug nd_table might contain holes.

Noticed by Eduardo Habkost.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Upstream-status: applied(qemu/trunk)
Bugzilla: 489992
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Gleb Natapov <gleb@redhat.com>
---
 qemu/savevm.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/qemu/savevm.c b/qemu/savevm.c
index 1b3ba89..2c28b5d 100644
--- a/qemu/savevm.c
+++ b/qemu/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) {
-- 
1.6.1