Cornelia Huck
2018-Jun-21 14:59 UTC
[virtio-dev] Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On Wed, 20 Jun 2018 22:48:58 +0300 "Michael S. Tsirkin" <mst at redhat.com> wrote:> On Wed, Jun 20, 2018 at 06:06:19PM +0200, Cornelia Huck wrote: > > In any case, I'm not sure anymore why we'd want the extra uuid. > > It's mostly so we can have e.g. multiple devices with same MAC > (which some people seem to want in order to then use > then with different containers). > > But it is also handy for when you assign a PF, since then you > can't set the MAC. >OK, so what about the following: - introduce a new feature bit, VIRTIO_NET_F_STANDBY_UUID that indicates that we have a new uuid field in the virtio-net config space - in QEMU, add a property for virtio-net that allows to specify a uuid, offer VIRTIO_NET_F_STANDBY_UUID if set - when configuring, set the property to the group UUID of the vfio-pci device - in the guest, use the uuid from the virtio-net device's config space if applicable; else, fall back to matching by MAC as done today That should work for all virtio transports.
Michael S. Tsirkin
2018-Jun-21 18:20 UTC
[virtio-dev] Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On Thu, Jun 21, 2018 at 04:59:13PM +0200, Cornelia Huck wrote:> On Wed, 20 Jun 2018 22:48:58 +0300 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > On Wed, Jun 20, 2018 at 06:06:19PM +0200, Cornelia Huck wrote: > > > In any case, I'm not sure anymore why we'd want the extra uuid. > > > > It's mostly so we can have e.g. multiple devices with same MAC > > (which some people seem to want in order to then use > > then with different containers). > > > > But it is also handy for when you assign a PF, since then you > > can't set the MAC. > > > > OK, so what about the following: > > - introduce a new feature bit, VIRTIO_NET_F_STANDBY_UUID that indicates > that we have a new uuid field in the virtio-net config space > - in QEMU, add a property for virtio-net that allows to specify a uuid, > offer VIRTIO_NET_F_STANDBY_UUID if set > - when configuring, set the property to the group UUID of the vfio-pci > device > - in the guest, use the uuid from the virtio-net device's config space > if applicable; else, fall back to matching by MAC as done today > > That should work for all virtio transports.True. I'm a bit unhappy that it's virtio net specific though since down the road I expect we'll have a very similar feature for scsi (and maybe others). But we do not have a way to have fields that are portable both across devices and transports, and I think it would be a useful addition. How would this work though? Any idea? -- MST
Siwei Liu
2018-Jun-22 01:21 UTC
[virtio-dev] Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On Thu, Jun 21, 2018 at 7:59 AM, Cornelia Huck <cohuck at redhat.com> wrote:> On Wed, 20 Jun 2018 22:48:58 +0300 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > >> On Wed, Jun 20, 2018 at 06:06:19PM +0200, Cornelia Huck wrote: >> > In any case, I'm not sure anymore why we'd want the extra uuid. >> >> It's mostly so we can have e.g. multiple devices with same MAC >> (which some people seem to want in order to then use >> then with different containers). >> >> But it is also handy for when you assign a PF, since then you >> can't set the MAC. >> > > OK, so what about the following: > > - introduce a new feature bit, VIRTIO_NET_F_STANDBY_UUID that indicates > that we have a new uuid field in the virtio-net config space > - in QEMU, add a property for virtio-net that allows to specify a uuid, > offer VIRTIO_NET_F_STANDBY_UUID if set > - when configuring, set the property to the group UUID of the vfio-pci > deviceIf feature negotiation fails on VIRTIO_NET_F_STANDBY_UUID, is it safe to still expose UUID in the config space on virtio-pci? I'm not even sure if it's sane to expose group UUID on the PCI bridge where the corresponding vfio-pci device attached to for a guest which doesn't support the feature (legacy). -Siwei> - in the guest, use the uuid from the virtio-net device's config space > if applicable; else, fall back to matching by MAC as done today > > That should work for all virtio transports.
Michael S. Tsirkin
2018-Jun-22 02:32 UTC
[virtio-dev] Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On Thu, Jun 21, 2018 at 06:21:55PM -0700, Siwei Liu wrote:> On Thu, Jun 21, 2018 at 7:59 AM, Cornelia Huck <cohuck at redhat.com> wrote: > > On Wed, 20 Jun 2018 22:48:58 +0300 > > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > >> On Wed, Jun 20, 2018 at 06:06:19PM +0200, Cornelia Huck wrote: > >> > In any case, I'm not sure anymore why we'd want the extra uuid. > >> > >> It's mostly so we can have e.g. multiple devices with same MAC > >> (which some people seem to want in order to then use > >> then with different containers). > >> > >> But it is also handy for when you assign a PF, since then you > >> can't set the MAC. > >> > > > > OK, so what about the following: > > > > - introduce a new feature bit, VIRTIO_NET_F_STANDBY_UUID that indicates > > that we have a new uuid field in the virtio-net config space > > - in QEMU, add a property for virtio-net that allows to specify a uuid, > > offer VIRTIO_NET_F_STANDBY_UUID if set > > - when configuring, set the property to the group UUID of the vfio-pci > > device > > If feature negotiation fails on VIRTIO_NET_F_STANDBY_UUID, is it safe > to still expose UUID in the config space on virtio-pci?Yes but guest is not supposed to read it.> I'm not even sure if it's sane to expose group UUID on the PCI bridge > where the corresponding vfio-pci device attached to for a guest which > doesn't support the feature (legacy). > > -SiweiYes but you won't add the primary behind such a bridge.> > > - in the guest, use the uuid from the virtio-net device's config space > > if applicable; else, fall back to matching by MAC as done today > > > > That should work for all virtio transports.
Cornelia Huck
2018-Jun-22 15:09 UTC
[virtio-dev] Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
On Thu, 21 Jun 2018 21:20:13 +0300 "Michael S. Tsirkin" <mst at redhat.com> wrote:> On Thu, Jun 21, 2018 at 04:59:13PM +0200, Cornelia Huck wrote: > > OK, so what about the following: > > > > - introduce a new feature bit, VIRTIO_NET_F_STANDBY_UUID that indicates > > that we have a new uuid field in the virtio-net config space > > - in QEMU, add a property for virtio-net that allows to specify a uuid, > > offer VIRTIO_NET_F_STANDBY_UUID if set > > - when configuring, set the property to the group UUID of the vfio-pci > > device > > - in the guest, use the uuid from the virtio-net device's config space > > if applicable; else, fall back to matching by MAC as done today > > > > That should work for all virtio transports. > > True. I'm a bit unhappy that it's virtio net specific though > since down the road I expect we'll have a very similar feature > for scsi (and maybe others). > > But we do not have a way to have fields that are portable > both across devices and transports, and I think it would > be a useful addition. How would this work though? Any idea?Can we introduce some kind of device-independent config space area? Pushing back the device-specific config space by a certain value if the appropriate feature is negotiated and use that for things like the uuid? But regardless of that, I'm not sure whether extending this approach to other device types is the way to go. Tying together two different devices is creating complicated situations at least in the hypervisor (even if it's fairly straightforward in the guest). [I have not come around again to look at the "how to handle visibility in QEMU" questions due to lack of cycles, sorry about that.] So, what's the goal of this approach? Only to allow migration with vfio-pci, or also to plug in a faster device and use it instead of an already attached paravirtualized device? What about migration of vfio devices that are not easily replaced by a paravirtualized device? I'm thinking of vfio-ccw, where our main (and currently only) supported device is dasd (disks) -- which can do a lot of specialized things that virtio-blk does not support (and should not or even cannot support). Would it be more helpful to focus on generic migration support for vfio instead of going about it device by device? This network device approach already seems far along, so it makes sense to continue with it. But I'm not sure whether we want to spend time and energy on that for other device types rather than working on a general solution for vfio migration.