All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: qemu-devel@nongnu.org, xen-devel@lists.xen.org
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Qemu-devel] get a handle for the tap device to shut it down
Date: Tue, 2 Dec 2014 16:53:00 +0100	[thread overview]
Message-ID: <20141202155300.GC26732@aepfle.de> (raw)
In-Reply-To: <20141128154749.GA6749@aepfle.de>

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

WARNING: multiple messages have this Message-ID (diff)
From: Olaf Hering <olaf@aepfle.de>
To: qemu-devel@nongnu.org, xen-devel@lists.xen.org
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: get a handle for the tap device to shut it down
Date: Tue, 2 Dec 2014 16:53:00 +0100	[thread overview]
Message-ID: <20141202155300.GC26732@aepfle.de> (raw)
In-Reply-To: <20141128154749.GA6749@aepfle.de>

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

  reply	other threads:[~2014-12-02 16:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28 15:47 get a handle for the tap device to shut it down Olaf Hering
2014-12-02 15:53 ` Olaf Hering [this message]
2014-12-02 15:53   ` Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141202155300.GC26732@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.