From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>,
Cornelia Huck <cohuck@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] compat: Use explicit type names on HW_COMPAT_2_6
Date: Fri, 4 Jan 2019 10:12:00 +0000 [thread overview]
Message-ID: <20190104101200.GA2494@work-vm> (raw)
In-Reply-To: <20190103232012-mutt-send-email-mst@kernel.org>
* Michael S. Tsirkin (mst@redhat.com) wrote:
> On Fri, Jan 04, 2019 at 01:22:26AM -0200, Eduardo Habkost wrote:
> > The virtio-pci entries in HW_COMPAT_2_6 had an implicit
> > assumption: that all virtio-pci subclasses support the
> > disable-legacy and disable-modern options.
> >
> > That assumption was broken by commit f6e501a28ef9 ("virtio:
> > Provide version-specific variants of virtio PCI devices"). This
> > caused QEMU to crash if using the new -non-transitional or
> > -transitional device types:
> >
> > $ qemu-system-x86_64 -machine pc-i440fx-2.6 \
> > -device virtio-net-pci-non-transitional
> > Unexpected error in object_property_find() at qom/object.c:1092:
> > qemu-system-x86_64: -device virtio-net-pci-non-transitional: can't apply \
> > global virtio-pci.disable-modern=on: Property '.disable-modern' not found
> > Aborted (core dumped)
> >
> > Replace the virtio-pci.disable-legacy=off and
> > virtio-pci.disable-modern=on entries on HW_COMPAT_2_6 with
> > explicit entries for each generic virtio device type.
> >
> > The full list of generic virtio device types was extracted by
> > just grepping for ".generic_name". Note that we don't need to
> > worry about listing new virtio-pci devices in HW_COMPAT_2_6 in
> > the future, because new devices won't require QEMU 2.6
> > compatibility.
>
> I fully expect that e.g. packed ring support will need
> to affect all virtio devices too. And it's likely
> that we'll have some new virtio-pci transport features too.
>
> > This makes the compat entries annoyingly verbose, but is simpler
> > than the alternative of making the virtio-pci type inheritance
> > rules even more complex.
>
> God forbid we forgot something, the only way to notice is to
> run a cross version migration with an old qemu.
> I think we need to come up with something less verbose and fragile.
I guess we could use a script like tests/acceptance/virtio_version.py to
do a check?
As for something less verbose, I guess something is doable with a few
macros (more complex but less verbose); or I guess you could add these
properties to the other devices but just refuse to operate when they
were set the wrong way.
Dave
>
> > Reported-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> > ---
> > include/hw/compat.h | 140 +++++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 138 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/hw/compat.h b/include/hw/compat.h
> > index 3ca85b037c..fbb6c1138a 100644
> > --- a/include/hw/compat.h
> > +++ b/include/hw/compat.h
> > @@ -163,11 +163,147 @@
> > .property = "format_transport_address",\
> > .value = "off",\
> > },{\
> > - .driver = "virtio-pci",\
> > + .driver = "vhost-scsi-pci",\
> > .property = "disable-modern",\
> > .value = "on",\
> > },{\
> > - .driver = "virtio-pci",\
> > + .driver = "vhost-scsi-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "vhost-user-blk-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "vhost-user-blk-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "vhost-user-scsi-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "vhost-user-scsi-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "vhost-vsock-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "vhost-vsock-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-9p-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-9p-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-balloon-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-balloon-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-blk-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-blk-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-crypto-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-crypto-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-gpu-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-gpu-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-input-host-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-input-host-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-keyboard-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-keyboard-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-mouse-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-mouse-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-net-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-net-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-rng-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-rng-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-scsi-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-scsi-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-serial-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-serial-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-tablet-pci",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-tablet-pci",\
> > + .property = "disable-legacy",\
> > + .value = "off",\
> > + },{\
> > + .driver = "virtio-vga",\
> > + .property = "disable-modern",\
> > + .value = "on",\
> > + },{\
> > + .driver = "virtio-vga",\
> > .property = "disable-legacy",\
> > .value = "off",\
> > },
> > --
> > 2.18.0.rc1.1.g3f1ff2140
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2019-01-04 10:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-04 3:22 [Qemu-devel] [PATCH] compat: Use explicit type names on HW_COMPAT_2_6 Eduardo Habkost
2019-01-04 4:23 ` Michael S. Tsirkin
2019-01-04 9:37 ` Cornelia Huck
2019-01-04 10:12 ` Dr. David Alan Gilbert [this message]
2019-01-04 17:54 ` Eduardo Habkost
2019-01-04 20:09 ` Eduardo Habkost
2019-01-04 20:48 ` Michael S. Tsirkin
2019-01-04 21:06 ` Eduardo Habkost
2019-01-04 21:13 ` Michael S. Tsirkin
2019-01-04 22:00 ` Eduardo Habkost
2019-01-07 8:12 ` Cornelia Huck
2019-01-07 19:26 ` Eduardo Habkost
2019-01-04 16:08 ` Eduardo Habkost
2019-01-04 9:49 ` Cornelia Huck
2019-01-04 16:11 ` Eduardo Habkost
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=20190104101200.GA2494@work-vm \
--to=dgilbert@redhat.com \
--cc=cohuck@redhat.com \
--cc=ehabkost@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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).