From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvq2h-0002nJ-Ji for qemu-devel@nongnu.org; Tue, 02 Dec 2014 11:11:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xvq2a-0000c2-8A for qemu-devel@nongnu.org; Tue, 02 Dec 2014 11:11:11 -0500 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::9]:26566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvq2a-0000b7-22 for qemu-devel@nongnu.org; Tue, 02 Dec 2014 11:11:04 -0500 Date: Tue, 2 Dec 2014 16:53:00 +0100 From: Olaf Hering Message-ID: <20141202155300.GC26732@aepfle.de> References: <20141128154749.GA6749@aepfle.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20141128154749.GA6749@aepfle.de> Subject: Re: [Qemu-devel] get a handle for the tap device to shut it down List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, xen-devel@lists.xen.org Cc: Stefano Stabellini On Fri, Nov 28, Olaf Hering wrote: > I wonder if the missing disable of the tap device is intentional, or > just an oversight, or if its just to complicated to get from a > "PCIDevice *" to the other end and call the ->cleanup function. qemu-traditional did just close all tap devices. With qemu-upstream a helper function exists to do all the cleanup. I think in a xen guest there are just emulated network devices, so the "wipe all remaining" could be done without breaking anything. What about something like this? Index: xen-4.4.1-testing/tools/qemu-xen-dir-remote/hw/xen/xen_platform.c =================================================================== --- xen-4.4.1-testing.orig/tools/qemu-xen-dir-remote/hw/xen/xen_platform.c +++ xen-4.4.1-testing/tools/qemu-xen-dir-remote/hw/xen/xen_platform.c @@ -99,9 +99,11 @@ static void unplug_nic(PCIBus *b, PCIDev } } +extern void net_cleanup(void); static void pci_unplug_nics(PCIBus *bus) { pci_for_each_device(bus, 0, unplug_nic, NULL); + net_cleanup(); } static void unplug_disks(PCIBus *b, PCIDevice *d, void *o) Olaf From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: get a handle for the tap device to shut it down Date: Tue, 2 Dec 2014 16:53:00 +0100 Message-ID: <20141202155300.GC26732@aepfle.de> References: <20141128154749.GA6749@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20141128154749.GA6749@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: qemu-devel@nongnu.org, xen-devel@lists.xen.org Cc: Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, Nov 28, Olaf Hering wrote: > I wonder if the missing disable of the tap device is intentional, or > just an oversight, or if its just to complicated to get from a > "PCIDevice *" to the other end and call the ->cleanup function. qemu-traditional did just close all tap devices. With qemu-upstream a helper function exists to do all the cleanup. I think in a xen guest there are just emulated network devices, so the "wipe all remaining" could be done without breaking anything. What about something like this? Index: xen-4.4.1-testing/tools/qemu-xen-dir-remote/hw/xen/xen_platform.c =================================================================== --- xen-4.4.1-testing.orig/tools/qemu-xen-dir-remote/hw/xen/xen_platform.c +++ xen-4.4.1-testing/tools/qemu-xen-dir-remote/hw/xen/xen_platform.c @@ -99,9 +99,11 @@ static void unplug_nic(PCIBus *b, PCIDev } } +extern void net_cleanup(void); static void pci_unplug_nics(PCIBus *bus) { pci_for_each_device(bus, 0, unplug_nic, NULL); + net_cleanup(); } static void unplug_disks(PCIBus *b, PCIDevice *d, void *o) Olaf