From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
pkrempa@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org,
mdroth@linux.vnet.ibm.com, liran.alon@oracle.com,
laine@redhat.com, ogerlitz@mellanox.com,
Jens Freimann <jfreimann@redhat.com>,
ailan@redhat.com, "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH 0/2] implement the failover feature for assigned network devices
Date: Mon, 08 Apr 2019 07:26:16 +0200 [thread overview]
Message-ID: <87sgutjcef.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190405234659.GJ7238@habkost.net> (Eduardo Habkost's message of "Fri, 5 Apr 2019 20:46:59 -0300")
Eduardo Habkost <ehabkost@redhat.com> writes:
> On Fri, Apr 05, 2019 at 07:22:35PM -0400, Michael S. Tsirkin wrote:
>> On Fri, Apr 05, 2019 at 09:56:29AM +0100, Dr. David Alan Gilbert wrote:
>> > * Jens Freimann (jfreimann@redhat.com) wrote:
>> > > On Fri, Mar 22, 2019 at 02:44:45PM +0100, Jens Freimann wrote:
> [...]
>> > > > 3. Management layer software should handle this. Open Stack already has
>> > > > components/code to handle unplug/replug VFIO devices and metadata to
>> > > > provide to the guest for detecting which devices should be paired.
>> > > > -> An approach that includes all software from firmware to
>> > > > higher-level management software wasn't tried in the last years. This is
>> > > > an attempt to keep it simple and contained in QEMU as much as possible.
>> > > > 4. Hotplugging a device and then making it part of a failover setup is
>> > > > not possible
>> > > > -> addressed by extending qdev hotplug functions to check for hidden
>> > > > attribute, so e.g. device_add can be used to plug a device.
>> > > >
>> > > > There are still some open issues:
>> > > >
>> > > > Migration: I'm looking for something like a pre-migration hook that I
>> > > > could use to unplug the vfio-pci device. I tried with a migration
>> > > > notifier but it is called to late, i.e. after migration is aborted due
>> > > > to vfio-pci marked unmigrateable. I worked around this by setting it
>> > > > to migrateable and used a migration notifier on the virtio-net device.
>> >
>> > Why not just let this happen at the libvirt level; then you do the
>> > hotunplug etc before you actually tell qemu anything about starting a
>> > migration?
>>
>> If qemu frees up resources (as it does on unplug) then libvirt
>> is not guaranteed it can roll the change back on e.g.
>> migration failure.
>
> Why should we always free up resources on unplug?
>
> Unplug of a disk device doesn't close the corresponding -blockdev.
It does for block backends created with -drive, and that was a mistake
we corrected with -blockdev.
> Unplug of a serial device doesn't close the corresponding -chardev.
> Unplug of a memory device doesn't close the corresponding memory backend.
> Unplug of a crypto device doesn't close the corresponding crypto backend.
>
> Why do we expect device_del of a passthrough PCI device to always
> release the host side PCI device? We can provide a better API
> than that.
device_del should free what device_add allocates.
Does device_add allocate the host side PCI device? If yes, should it?
[...]
WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: pkrempa@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>,
armbru@redhat.com, qemu-devel@nongnu.org,
mdroth@linux.vnet.ibm.com, liran.alon@oracle.com,
laine@redhat.com, ogerlitz@mellanox.com,
Jens Freimann <jfreimann@redhat.com>,
ailan@redhat.com, "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH 0/2] implement the failover feature for assigned network devices
Date: Mon, 08 Apr 2019 07:26:16 +0200 [thread overview]
Message-ID: <87sgutjcef.fsf@dusky.pond.sub.org> (raw)
Message-ID: <20190408052616.TGAe2G3M-Bxxq-sb35DusUBENgZxTlAd9Ltttw0RilI@z> (raw)
In-Reply-To: <20190405234659.GJ7238@habkost.net> (Eduardo Habkost's message of "Fri, 5 Apr 2019 20:46:59 -0300")
Eduardo Habkost <ehabkost@redhat.com> writes:
> On Fri, Apr 05, 2019 at 07:22:35PM -0400, Michael S. Tsirkin wrote:
>> On Fri, Apr 05, 2019 at 09:56:29AM +0100, Dr. David Alan Gilbert wrote:
>> > * Jens Freimann (jfreimann@redhat.com) wrote:
>> > > On Fri, Mar 22, 2019 at 02:44:45PM +0100, Jens Freimann wrote:
> [...]
>> > > > 3. Management layer software should handle this. Open Stack already has
>> > > > components/code to handle unplug/replug VFIO devices and metadata to
>> > > > provide to the guest for detecting which devices should be paired.
>> > > > -> An approach that includes all software from firmware to
>> > > > higher-level management software wasn't tried in the last years. This is
>> > > > an attempt to keep it simple and contained in QEMU as much as possible.
>> > > > 4. Hotplugging a device and then making it part of a failover setup is
>> > > > not possible
>> > > > -> addressed by extending qdev hotplug functions to check for hidden
>> > > > attribute, so e.g. device_add can be used to plug a device.
>> > > >
>> > > > There are still some open issues:
>> > > >
>> > > > Migration: I'm looking for something like a pre-migration hook that I
>> > > > could use to unplug the vfio-pci device. I tried with a migration
>> > > > notifier but it is called to late, i.e. after migration is aborted due
>> > > > to vfio-pci marked unmigrateable. I worked around this by setting it
>> > > > to migrateable and used a migration notifier on the virtio-net device.
>> >
>> > Why not just let this happen at the libvirt level; then you do the
>> > hotunplug etc before you actually tell qemu anything about starting a
>> > migration?
>>
>> If qemu frees up resources (as it does on unplug) then libvirt
>> is not guaranteed it can roll the change back on e.g.
>> migration failure.
>
> Why should we always free up resources on unplug?
>
> Unplug of a disk device doesn't close the corresponding -blockdev.
It does for block backends created with -drive, and that was a mistake
we corrected with -blockdev.
> Unplug of a serial device doesn't close the corresponding -chardev.
> Unplug of a memory device doesn't close the corresponding memory backend.
> Unplug of a crypto device doesn't close the corresponding crypto backend.
>
> Why do we expect device_del of a passthrough PCI device to always
> release the host side PCI device? We can provide a better API
> than that.
device_del should free what device_add allocates.
Does device_add allocate the host side PCI device? If yes, should it?
[...]
next prev parent reply other threads:[~2019-04-08 5:35 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190322134447.14831-1-jfreimann@redhat.com>
2019-04-04 8:29 ` [Qemu-devel] [RFC PATCH 0/2] implement the failover feature for assigned network devices Jens Freimann
2019-04-05 8:56 ` Dr. David Alan Gilbert
2019-04-05 8:56 ` Dr. David Alan Gilbert
2019-04-05 9:20 ` Jens Freimann
2019-04-05 9:20 ` Jens Freimann
2019-04-08 5:53 ` Markus Armbruster
2019-04-08 5:53 ` Markus Armbruster
2019-04-05 23:22 ` Michael S. Tsirkin
2019-04-05 23:22 ` Michael S. Tsirkin
2019-04-05 23:46 ` Eduardo Habkost
2019-04-05 23:46 ` Eduardo Habkost
2019-04-08 5:26 ` Markus Armbruster [this message]
2019-04-08 5:26 ` Markus Armbruster
2019-04-12 19:50 ` Eduardo Habkost
2019-04-12 19:50 ` Eduardo Habkost
2019-04-08 9:16 ` Dr. David Alan Gilbert
2019-04-08 9:16 ` Dr. David Alan Gilbert
2019-04-08 13:00 ` Jens Freimann
2019-04-08 13:00 ` Jens Freimann
2019-04-08 17:00 ` Dr. David Alan Gilbert
2019-04-08 17:00 ` Dr. David Alan Gilbert
2019-04-08 13:22 ` Michael S. Tsirkin
2019-04-08 13:22 ` Michael S. Tsirkin
2019-05-29 0:35 ` si-wei liu
2019-05-29 2:47 ` Michael S. Tsirkin
2019-04-04 12:53 ` Daniel P. Berrangé
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=87sgutjcef.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=ailan@redhat.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jfreimann@redhat.com \
--cc=laine@redhat.com \
--cc=liran.alon@oracle.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=ogerlitz@mellanox.com \
--cc=pkrempa@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 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.