Sophie

Sophie

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

kvm-83-270.el5_11.src.rpm

From b9c916e5bba91b5566de0ddde9c457d37aa336f3 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc@redhat.com>
Date: Fri, 15 May 2009 12:33:01 +0100
Subject: [PATCH 12/16] Fix e1000 segfault during live migrate after NIC hot-unplug

https://bugzilla.redhat.com/500976

virtio-net registers a savevm handler which is not removed when
the NIC is hot-unplugged.

This patch just cherry-picks e1000_cleanup() from:

  http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commitdiff;h=a34b6eb776

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Message-Id: <1242387181.25932.7.camel@blaa>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Bugzilla: 501729
RH-Upstream-status: applied(qemu-kvm/master)
Acked-by: Glauber Costa <glommer@redhat.com>
Depends: <1242387172.25932.5.camel@blaa>
Depends: <1242387177.25932.6.camel@blaa>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
---
 qemu/hw/e1000.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/qemu/hw/e1000.c b/qemu/hw/e1000.c
index 97eb383..8ef494b 100644
--- a/qemu/hw/e1000.c
+++ b/qemu/hw/e1000.c
@@ -1035,6 +1035,14 @@ e1000_mmio_map(PCIDevice *pci_dev, int region_num,
                                      excluded_regs[i] - 4);
 }
 
+static void
+e1000_cleanup(VLANClientState *vc)
+{
+    E1000State *d = vc->opaque;
+
+    unregister_savevm("e1000", d);
+}
+
 static int
 pci_e1000_uninit(PCIDevice *dev)
 {
@@ -1101,6 +1109,7 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
 
     d->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
                                  e1000_receive, e1000_can_receive, d);
+    d->vc->cleanup = e1000_cleanup;
     d->vc->link_status_changed = e1000_set_link_status;
 
     qemu_format_nic_info_str(d->vc, d->nd->macaddr);
-- 
1.6.3.rc4.29.g8146