From nobody Sun May 5 18:04:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497881465437149.9671951273673; Mon, 19 Jun 2017 07:11:05 -0700 (PDT) Received: from localhost ([::1]:42865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMxOQ-0007XX-H3 for importer@patchew.org; Mon, 19 Jun 2017 10:11:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMrur-00007D-7U for qemu-devel@nongnu.org; Mon, 19 Jun 2017 04:20:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMrum-0002e8-Fb for qemu-devel@nongnu.org; Mon, 19 Jun 2017 04:20:09 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:14410) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMrum-0002aq-A6 for qemu-devel@nongnu.org; Mon, 19 Jun 2017 04:20:04 -0400 X-IronPort-AV: E=Sophos;i="5.39,360,1493683200"; d="scan'208";a="436940142" From: Ross Lagerwall To: Date: Mon, 19 Jun 2017 09:19:45 +0100 Message-ID: <20170619081945.30001-1-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 X-Mailman-Approved-At: Mon, 19 Jun 2017 10:09:29 -0400 Subject: [Qemu-devel] [PATCH] xen-platform: Cleanup network infrastructure when emulated NICs are unplugged X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Eduardo Habkost , "Michael S. Tsirkin" , Ross Lagerwall , Anthony Perard , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the guest unplugs the emulated NICs, call net_cleanup() to cleanup the network infrastructure in QEMU as it is not needed anymore. Most importantly, this allows the tap interfaces which QEMU holds open to be closed and removed. Signed-off-by: Ross Lagerwall --- hw/i386/xen/xen_platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 1419fc9..180abc7 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -105,6 +105,7 @@ static void unplug_nic(PCIBus *b, PCIDevice *d, void *o) static void pci_unplug_nics(PCIBus *bus) { pci_for_each_device(bus, 0, unplug_nic, NULL); + net_cleanup(); } =20 static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque) --=20 2.9.4