Message ID | 4410eb25e13925ff94a0a71cd9de86971bf2dc1e.1548278585.git.crobinso@redhat.com |
---|---|
State | New |
Headers | show |
Series | qemu: virtio-{non-}transitional support | expand |
On Wed, 2019-01-23 at 16:32 -0500, Cole Robinson wrote: > This adds QEMU_CAPS flags for the following devices > > virtio-blk-pci-non-transitional > virtio-net-pci-transitional > virtio-net-pci-non-transitional > vhost-scsi-pci-transitional > vhost-scsi-pci-non-transitional > virtio-rng-pci-transitional > virtio-rng-pci-non-transitional > virtio-9p-pci-transitional > virtio-9p-pci-non-transitional > virtio-balloon-pci-transitional > virtio-balloon-pci-non-transitional > vhost-vsock-pci-transitional > vhost-vsock-pci-non-transitional > virtio-input-host-pci-transitional > virtio-input-host-pci-non-transitional > virtio-scsi-pci-transitional > virtio-scsi-pci-non-transitional > virtio-serial-pci-transitional > virtio-serial-pci-non-transitional > > Signed-off-by: Cole Robinson <crobinso@redhat.com> > --- > src/qemu/qemu_capabilities.c | 48 +++++++++++++++++++ > src/qemu/qemu_capabilities.h | 28 +++++++++++ > .../caps_4.0.0.x86_64.xml | 20 ++++++++ > 3 files changed, 96 insertions(+) Reviewed-by: Andrea Bolognani <abologna@redhat.com> -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On Wed, Jan 23, 2019 at 04:32:38PM -0500, Cole Robinson wrote: >This adds QEMU_CAPS flags for the following devices > > virtio-blk-pci-transitional > virtio-blk-pci-non-transitional > virtio-net-pci-transitional > virtio-net-pci-non-transitional > vhost-scsi-pci-transitional > vhost-scsi-pci-non-transitional > virtio-rng-pci-transitional > virtio-rng-pci-non-transitional > virtio-9p-pci-transitional > virtio-9p-pci-non-transitional > virtio-balloon-pci-transitional > virtio-balloon-pci-non-transitional > vhost-vsock-pci-transitional > vhost-vsock-pci-non-transitional > virtio-input-host-pci-transitional > virtio-input-host-pci-non-transitional > virtio-scsi-pci-transitional > virtio-scsi-pci-non-transitional > virtio-serial-pci-transitional > virtio-serial-pci-non-transitional > >Signed-off-by: Cole Robinson <crobinso@redhat.com> >--- > src/qemu/qemu_capabilities.c | 48 +++++++++++++++++++ > src/qemu/qemu_capabilities.h | 28 +++++++++++ > .../caps_4.0.0.x86_64.xml | 20 ++++++++ > 3 files changed, 96 insertions(+) This seems excessive, is there a plan to retire the transitional devices? I don't expect anyone creating a QEMU build that e.g.: a) supports virtio-rng-pci-transitional but not virtio-rng-pci-non-transitional b) supports virtio-scsi-pci-transitional but not virtio-input-host-pci-transitional For the disable-legacy property, we only have QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, that is checked on multiple (but not all possible) PCI devices. Jano -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On Tue, 2019-01-29 at 15:48 +0100, Ján Tomko wrote: > On Wed, Jan 23, 2019 at 04:32:38PM -0500, Cole Robinson wrote: > > This adds QEMU_CAPS flags for the following devices > > > > virtio-blk-pci-transitional > > virtio-blk-pci-non-transitional > > virtio-net-pci-transitional > > virtio-net-pci-non-transitional > > vhost-scsi-pci-transitional > > vhost-scsi-pci-non-transitional > > virtio-rng-pci-transitional > > virtio-rng-pci-non-transitional > > virtio-9p-pci-transitional > > virtio-9p-pci-non-transitional > > virtio-balloon-pci-transitional > > virtio-balloon-pci-non-transitional > > vhost-vsock-pci-transitional > > vhost-vsock-pci-non-transitional > > virtio-input-host-pci-transitional > > virtio-input-host-pci-non-transitional > > virtio-scsi-pci-transitional > > virtio-scsi-pci-non-transitional > > virtio-serial-pci-transitional > > virtio-serial-pci-non-transitional > > This seems excessive, is there a plan to retire the transitional > devices? I don't expect anyone creating a QEMU build that e.g.: > a) supports virtio-rng-pci-transitional but not virtio-rng-pci-non-transitional > b) supports virtio-scsi-pci-transitional but not virtio-input-host-pci-transitional > > For the disable-legacy property, we only have > QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, that is checked on multiple (but > not all possible) PCI devices. That's a very good point! We could have a single capability QEMU_CAPS_VIRTIO_PCI_NON_TRANSITIONAL that is set if any out of a bunch of {,non-}transitional devices is present, and key everything else off that... Eduardo, do you think we might ever get in trouble if we did that? For example, because of QEMU dropping transitional devices but leaving non-transitional devices in?
On 1/29/19 11:05 AM, Andrea Bolognani wrote: > On Tue, 2019-01-29 at 15:48 +0100, Ján Tomko wrote: >> On Wed, Jan 23, 2019 at 04:32:38PM -0500, Cole Robinson wrote: >>> This adds QEMU_CAPS flags for the following devices >>> >>> virtio-blk-pci-transitional >>> virtio-blk-pci-non-transitional >>> virtio-net-pci-transitional >>> virtio-net-pci-non-transitional >>> vhost-scsi-pci-transitional >>> vhost-scsi-pci-non-transitional >>> virtio-rng-pci-transitional >>> virtio-rng-pci-non-transitional >>> virtio-9p-pci-transitional >>> virtio-9p-pci-non-transitional >>> virtio-balloon-pci-transitional >>> virtio-balloon-pci-non-transitional >>> vhost-vsock-pci-transitional >>> vhost-vsock-pci-non-transitional >>> virtio-input-host-pci-transitional >>> virtio-input-host-pci-non-transitional >>> virtio-scsi-pci-transitional >>> virtio-scsi-pci-non-transitional >>> virtio-serial-pci-transitional >>> virtio-serial-pci-non-transitional >> >> This seems excessive, is there a plan to retire the transitional >> devices? I don't expect anyone creating a QEMU build that e.g.: >> a) supports virtio-rng-pci-transitional but not virtio-rng-pci-non-transitional >> b) supports virtio-scsi-pci-transitional but not virtio-input-host-pci-transitional >> >> For the disable-legacy property, we only have >> QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, that is checked on multiple (but >> not all possible) PCI devices. > > That's a very good point! We could have a single capability > > QEMU_CAPS_VIRTIO_PCI_NON_TRANSITIONAL > > that is set if any out of a bunch of {,non-}transitional devices > is present, and key everything else off that... > > Eduardo, do you think we might ever get in trouble if we did that? > For example, because of QEMU dropping transitional devices but > leaving non-transitional devices in? > I believe eduardo is offline for the next few weeks, so I'll make this change in the next version to just track a single capability QEMU_CAPS_VIRTIO_PCI_NON_TRANSITIONAL We can always add the fine grained capabilities later if needed. Thanks, Cole -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On Wed, 2019-02-06 at 11:12 -0500, Cole Robinson wrote: > On 1/29/19 11:05 AM, Andrea Bolognani wrote: > > Eduardo, do you think we might ever get in trouble if we did that? > > For example, because of QEMU dropping transitional devices but > > leaving non-transitional devices in? > > I believe eduardo is offline for the next few weeks, so I'll make this > change in the next version to just track a single capability > QEMU_CAPS_VIRTIO_PCI_NON_TRANSITIONAL > > We can always add the fine grained capabilities later if needed. Sounds good, let's just make sure he has a chance to veto the approach *before* it ends up in a stable libvirt release, to avoid compatibility headaches in case we were wrong O:-) -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On 2/6/19 11:54 AM, Andrea Bolognani wrote: > On Wed, 2019-02-06 at 11:12 -0500, Cole Robinson wrote: >> On 1/29/19 11:05 AM, Andrea Bolognani wrote: >>> Eduardo, do you think we might ever get in trouble if we did that? >>> For example, because of QEMU dropping transitional devices but >>> leaving non-transitional devices in? >> >> I believe eduardo is offline for the next few weeks, so I'll make this >> change in the next version to just track a single capability >> QEMU_CAPS_VIRTIO_PCI_NON_TRANSITIONAL >> >> We can always add the fine grained capabilities later if needed. > > Sounds good, let's just make sure he has a chance to veto the > approach *before* it ends up in a stable libvirt release, to avoid > compatibility headaches in case we were wrong O:-) > If there's a chance I'm going to have redo the series and edit every qemu_command.c patch again to use the fine grained capabilities, then I'll just wait for his response. But I don't really think it's necessary. Presumably if -transitional or -non-transitional devices are compiled out of qemu, the equivalent disable-legacy/disable-modern config should be rejected too. So if our qemuCaps detection is wrong, and we determine -transitional/-non-transitional is supported when it is actually compiled out, the user request is never going to work anyways. So even if eduardo suggests using the fine grained capabilities, we could do it as a follow on patch. The one place it may actually matter is in domaincapabilities; we don't want to incorrectly report that virtio-transitional is supported for a device, because apps may make programmatic decisions based on what we report. So we could defer the disk domaincapabilities patch until we get a clear answer. FWIW that was my original motivation for going fine grained with the qemuCaps values, I expect to eventually expose all of them in domaincapabilities. Thanks, Cole -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On Wed, Feb 06, 2019 at 12:14:36PM -0500, Cole Robinson wrote: > On 2/6/19 11:54 AM, Andrea Bolognani wrote: > > On Wed, 2019-02-06 at 11:12 -0500, Cole Robinson wrote: > > > On 1/29/19 11:05 AM, Andrea Bolognani wrote: > > > > Eduardo, do you think we might ever get in trouble if we did that? > > > > For example, because of QEMU dropping transitional devices but > > > > leaving non-transitional devices in? > > > > > > I believe eduardo is offline for the next few weeks, so I'll make this > > > change in the next version to just track a single capability > > > QEMU_CAPS_VIRTIO_PCI_NON_TRANSITIONAL > > > > > > We can always add the fine grained capabilities later if needed. > > > > Sounds good, let's just make sure he has a chance to veto the > > approach *before* it ends up in a stable libvirt release, to avoid > > compatibility headaches in case we were wrong O:-) > > > > If there's a chance I'm going to have redo the series and edit every > qemu_command.c patch again to use the fine grained capabilities, then I'll > just wait for his response. > > But I don't really think it's necessary. Presumably if -transitional or > -non-transitional devices are compiled out of qemu, the equivalent > disable-legacy/disable-modern config should be rejected too. So if our > qemuCaps detection is wrong, and we determine > -transitional/-non-transitional is supported when it is actually compiled > out, the user request is never going to work anyways. So even if eduardo > suggests using the fine grained capabilities, we could do it as a follow on > patch. > > The one place it may actually matter is in domaincapabilities; we don't want > to incorrectly report that virtio-transitional is supported for a device, > because apps may make programmatic decisions based on what we report. So we > could defer the disk domaincapabilities patch until we get a clear answer. > FWIW that was my original motivation for going fine grained with the > qemuCaps values, I expect to eventually expose all of them in > domaincapabilities. I just found this message on my inbox, sorry for missing it. Predicting the future is hard, and predicting the decisions of every downstream packagers of QEMU is harder. But I don't expect anybody to compile out just a few of the (-non)-transitional devices. This unlikely scenario doesn't seem worth the extra complexity of a large set of new capability flags. -- Eduardo -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f504db7d05..ee471787d9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -520,6 +520,34 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 325 */ "memory-backend-file.pmem", "nvdimm.unarmed", + "virtio-blk-pci-transitional", + "virtio-blk-pci-non-transitional", + "virtio-net-pci-transitional", + + /* 330 */ + "virtio-net-pci-non-transitional", + "vhost-scsi-pci-transitional", + "vhost-scsi-pci-non-transitional", + "virtio-rng-pci-transitional", + "virtio-rng-pci-non-transitional", + + /* 335 */ + "virtio-9p-pci-transitional", + "virtio-9p-pci-non-transitional", + "virtio-balloon-pci-transitional", + "virtio-balloon-pci-non-transitional", + "vhost-vsock-pci-transitional", + + /* 340 */ + "vhost-vsock-pci-non-transitional", + "virtio-input-host-pci-transitional", + "virtio-input-host-pci-non-transitional", + "virtio-scsi-pci-transitional", + "virtio-scsi-pci-non-transitional", + + /* 345 */ + "virtio-serial-pci-transitional", + "virtio-serial-pci-non-transitional", ); @@ -1108,6 +1136,26 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP }, { "zpci", QEMU_CAPS_DEVICE_ZPCI }, { "memory-backend-memfd", QEMU_CAPS_OBJECT_MEMORY_MEMFD }, + { "virtio-blk-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_BLK_PCI_TRANSITIONAL }, + { "virtio-blk-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_BLK_PCI_NON_TRANSITIONAL }, + { "virtio-net-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_NET_PCI_TRANSITIONAL }, + { "virtio-net-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_NET_PCI_NON_TRANSITIONAL }, + { "vhost-scsi-pci-transitional", QEMU_CAPS_DEVICE_VHOST_SCSI_PCI_TRANSITIONAL }, + { "vhost-scsi-pci-non-transitional", QEMU_CAPS_DEVICE_VHOST_SCSI_PCI_NON_TRANSITIONAL }, + { "virtio-rng-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_TRANSITIONAL }, + { "virtio-rng-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_NON_TRANSITIONAL }, + { "virtio-9p-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_9P_PCI_TRANSITIONAL }, + { "virtio-9p-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_9P_PCI_NON_TRANSITIONAL }, + { "virtio-balloon-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_BALLOON_PCI_TRANSITIONAL }, + { "virtio-balloon-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_BALLOON_PCI_NON_TRANSITIONAL }, + { "vhost-vsock-pci-transitional", QEMU_CAPS_DEVICE_VHOST_VSOCK_PCI_TRANSITIONAL }, + { "vhost-vsock-pci-non-transitional", QEMU_CAPS_DEVICE_VHOST_VSOCK_PCI_NON_TRANSITIONAL }, + { "virtio-input-host-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_INPUT_HOST_PCI_TRANSITIONAL }, + { "virtio-input-host-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_INPUT_HOST_PCI_NON_TRANSITIONAL }, + { "virtio-scsi-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_SCSI_PCI_TRANSITIONAL }, + { "virtio-scsi-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_SCSI_PCI_NON_TRANSITIONAL }, + { "virtio-serial-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_SERIAL_PCI_TRANSITIONAL }, + { "virtio-serial-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_SERIAL_PCI_NON_TRANSITIONAL }, }; static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 6d5ed8a3cc..cff3506355 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -504,6 +504,34 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 325 */ QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM, /* -object memory-backend-file,pmem= */ QEMU_CAPS_DEVICE_NVDIMM_UNARMED, /* -device nvdimm,unarmed= */ + QEMU_CAPS_DEVICE_VIRTIO_BLK_PCI_TRANSITIONAL, /* -device virtio-blk-pci-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_BLK_PCI_NON_TRANSITIONAL, /* -device virtio-blk-pci-non-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_NET_PCI_TRANSITIONAL, /* -device virtio-net-pci-transitional */ + + /* 330 */ + QEMU_CAPS_DEVICE_VIRTIO_NET_PCI_NON_TRANSITIONAL, /* -device virtio-net-pci-non-transitional */ + QEMU_CAPS_DEVICE_VHOST_SCSI_PCI_TRANSITIONAL, /* -device vhost-scsi-pci-transitional */ + QEMU_CAPS_DEVICE_VHOST_SCSI_PCI_NON_TRANSITIONAL, /* -device vhost-scsi-pci-non-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_TRANSITIONAL, /* -device virtio-blk-rng-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_NON_TRANSITIONAL, /* -device virtio-rng-pci-non-transitional */ + + /* 335 */ + QEMU_CAPS_DEVICE_VIRTIO_9P_PCI_TRANSITIONAL, /* -device virtio-9p-pci-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_9P_PCI_NON_TRANSITIONAL, /* -device virtio-9p-pci-non-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_BALLOON_PCI_TRANSITIONAL, /* -device virtio-balloon-pci-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_BALLOON_PCI_NON_TRANSITIONAL, /* -device virtio-balloon-pci-transitional */ + QEMU_CAPS_DEVICE_VHOST_VSOCK_PCI_TRANSITIONAL, /* -device vhost-vsock-pci-transitional */ + + /* 340 */ + QEMU_CAPS_DEVICE_VHOST_VSOCK_PCI_NON_TRANSITIONAL, /* -device vhost-vsock-pci-non-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_INPUT_HOST_PCI_TRANSITIONAL, /* -device virtio-input-host-pci-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_INPUT_HOST_PCI_NON_TRANSITIONAL, /* -device virtio-input-host-pci-non-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_SCSI_PCI_TRANSITIONAL, /* -device virtio-scsi-pci-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_SCSI_PCI_NON_TRANSITIONAL, /* -device virtio-scsi-pci-non-transitional */ + + /* 345 */ + QEMU_CAPS_DEVICE_VIRTIO_SERIAL_PCI_TRANSITIONAL, /* -device virtio-serial-pci-transitional */ + QEMU_CAPS_DEVICE_VIRTIO_SERIAL_PCI_NON_TRANSITIONAL, /* -device virtio-serial-pci-non-transitional */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml index c2db392e83..aaf7d404eb 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -212,6 +212,26 @@ <flag name='memory-backend-file.align'/> <flag name='memory-backend-file.pmem'/> <flag name='nvdimm.unarmed'/> + <flag name='virtio-blk-pci-transitional'/> + <flag name='virtio-blk-pci-non-transitional'/> + <flag name='virtio-net-pci-transitional'/> + <flag name='virtio-net-pci-non-transitional'/> + <flag name='vhost-scsi-pci-transitional'/> + <flag name='vhost-scsi-pci-non-transitional'/> + <flag name='virtio-rng-pci-transitional'/> + <flag name='virtio-rng-pci-non-transitional'/> + <flag name='virtio-9p-pci-transitional'/> + <flag name='virtio-9p-pci-non-transitional'/> + <flag name='virtio-balloon-pci-transitional'/> + <flag name='virtio-balloon-pci-non-transitional'/> + <flag name='vhost-vsock-pci-transitional'/> + <flag name='vhost-vsock-pci-non-transitional'/> + <flag name='virtio-input-host-pci-transitional'/> + <flag name='virtio-input-host-pci-non-transitional'/> + <flag name='virtio-scsi-pci-transitional'/> + <flag name='virtio-scsi-pci-non-transitional'/> + <flag name='virtio-serial-pci-transitional'/> + <flag name='virtio-serial-pci-non-transitional'/> <version>3001050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>446361</microcodeVersion>
This adds QEMU_CAPS flags for the following devices virtio-blk-pci-transitional virtio-blk-pci-non-transitional virtio-net-pci-transitional virtio-net-pci-non-transitional vhost-scsi-pci-transitional vhost-scsi-pci-non-transitional virtio-rng-pci-transitional virtio-rng-pci-non-transitional virtio-9p-pci-transitional virtio-9p-pci-non-transitional virtio-balloon-pci-transitional virtio-balloon-pci-non-transitional vhost-vsock-pci-transitional vhost-vsock-pci-non-transitional virtio-input-host-pci-transitional virtio-input-host-pci-non-transitional virtio-scsi-pci-transitional virtio-scsi-pci-non-transitional virtio-serial-pci-transitional virtio-serial-pci-non-transitional Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_capabilities.c | 48 +++++++++++++++++++ src/qemu/qemu_capabilities.h | 28 +++++++++++ .../caps_4.0.0.x86_64.xml | 20 ++++++++ 3 files changed, 96 insertions(+) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list