From: Anthony Liguori <anthony@codemonkey.ws>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Make netdev_del delete the netdev even when it's in use
Date: Mon, 14 Jun 2010 11:27:27 -0500 [thread overview]
Message-ID: <4C16586F.7070102@codemonkey.ws> (raw)
In-Reply-To: <m3pqzxkbe9.fsf@blackfin.pond.sub.org>
On 06/11/2010 07:21 AM, Markus Armbruster wrote:
> To hot-unplug guest and host part of a network device, you do:
>
> device_del NIC-ID
> netdev_del NETDEV-ID
>
> For PCI devices, device_del merely tells ACPI to unplug the device.
> The device goes away for real only after the guest processed the ACPI
> unplug event.
>
> You have to wait until then (e.g. by polling info pci) before you can
> unplug the netdev. Not good.
>
> Fix by removing the "in use" check from do_netdev_del(). Deleting a
> netdev while it's in use is safe; packets simply get routed to the bit
> bucket.
>
> Signed-off-by: Markus Armbruster<armbru@redhat.com>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> I can add a force option instead, if you think that's better.
>
> net.c | 4 ----
> 1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/net.c b/net.c
> index 4cb93ed..0703698 100644
> --- a/net.c
> +++ b/net.c
> @@ -1221,10 +1221,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
> qerror_report(QERR_DEVICE_NOT_FOUND, id);
> return -1;
> }
> - if (vc->peer) {
> - qerror_report(QERR_DEVICE_IN_USE, id);
> - return -1;
> - }
> qemu_del_vlan_client(vc);
> qemu_opts_del(qemu_opts_find(&qemu_netdev_opts, id));
> return 0;
>
prev parent reply other threads:[~2010-06-14 16:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-11 12:21 [Qemu-devel] [PATCH] Make netdev_del delete the netdev even when it's in use Markus Armbruster
2010-06-14 16:27 ` Anthony Liguori [this message]
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=4C16586F.7070102@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).