From: Anthony Liguori <anthony@codemonkey.ws>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] net: delay peer host device delete
Date: Mon, 20 Sep 2010 15:20:59 -0500 [thread overview]
Message-ID: <4C97C22B.3010502@codemonkey.ws> (raw)
In-Reply-To: <20100920194415.GK30611@redhat.com>
On 09/20/2010 02:44 PM, Michael S. Tsirkin wrote:
>
>> I think the only workable approach that doesn't involve new commands
>> is to change the semantics of the existing ones.
>>
>> Make netdev_del work regardless of whether the device is still present.
>>
>> You would need to reference count the actual netdev structure and
>> have each device using it unref on delete. You make netdev_del mark
>> the device as deleted and when a device is deleted, any calls into
>> the device effectively become nops.
>>
>> You have to go through most of the cleanup process to ensure that
>> tap device gets closed even before your reference count goes to
>> zero.
>>
> I think you mean 'does not get closed': we need the fd to get the flags etc.
>
No, I actually meant does get closed.
When you do netdev_del, it should result in the fd getting closed.
The actual netdev structure then becomes a zombie that's completely
useless until the device goes away.
> Note that it will mostly work unless when it'll crash.
> Issue is we don't have any documentation so
> people get the command set by trial and error.
>
> So how can we prove it's a user bug and not qemu bug?
> I guess we should blame ourselves until proven innocent.
>
Here's what I'm now suggesting:
device_del -> may or may not unplug a device from a guest when it
returns. To figure out if it does, you have to run info qdm.
netdev_del -> always destroys a netdev device when it returns. May be
called at any point in time. If you destroy a netdev while the device
is still using it, all packets go into the bit bucket and the link
status is modified to be unplugged.
You're suggesting:
netdev_del -> may or may not destroy a netdev depending on when the
device delete completes. Eventually, when there's a reset, we will kill
the device. Even though the netdev is still active, we'll hide it from
the management tools.
I think the suggested semantics are totally unusable. If we can make
something deterministic for a management tool, that should be the path
we take.
Regards,
Anthony Liguori
next prev parent reply other threads:[~2010-09-20 20:23 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-20 16:30 [Qemu-devel] [PATCH] net: delay peer host device delete Michael S. Tsirkin
2010-09-20 16:41 ` Anthony Liguori
2010-09-20 16:47 ` Michael S. Tsirkin
2010-09-20 16:56 ` Anthony Liguori
2010-09-20 17:14 ` Michael S. Tsirkin
2010-09-20 18:14 ` Anthony Liguori
2010-09-20 18:19 ` Anthony Liguori
2010-09-20 18:59 ` [Qemu-devel] " Michael S. Tsirkin
2010-09-20 19:22 ` Anthony Liguori
2010-09-20 19:37 ` Michael S. Tsirkin
2010-09-20 20:15 ` Anthony Liguori
2010-09-20 20:15 ` Michael S. Tsirkin
2010-09-21 8:58 ` Daniel P. Berrange
2010-09-21 9:20 ` Michael S. Tsirkin
2010-09-21 12:47 ` Anthony Liguori
2010-09-20 18:24 ` Michael S. Tsirkin
2010-09-20 18:39 ` Anthony Liguori
2010-09-20 19:15 ` Michael S. Tsirkin
2010-09-20 19:28 ` Anthony Liguori
2010-09-20 19:44 ` Michael S. Tsirkin
2010-09-20 20:20 ` Anthony Liguori [this message]
2010-09-20 20:27 ` Michael S. Tsirkin
2010-09-20 20:38 ` Anthony Liguori
2010-09-20 20:37 ` Michael S. Tsirkin
2010-09-20 20:50 ` Anthony Liguori
2010-09-21 9:18 ` Michael S. Tsirkin
2010-09-21 12:42 ` Anthony Liguori
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=4C97C22B.3010502@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=mst@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).