All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	QEMU <qemu-devel@nongnu.org>, "Thomas Huth" <thuth@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional
Date: Thu, 10 Jan 2019 15:01:25 +0000	[thread overview]
Message-ID: <20190110150125.GF2589@work-vm> (raw)
In-Reply-To: <20190110091140-mutt-send-email-mst@kernel.org>

* Michael S. Tsirkin (mst@redhat.com) wrote:
> On Thu, Jan 10, 2019 at 11:31:23AM -0200, Eduardo Habkost wrote:
> > On Thu, Jan 10, 2019 at 12:35:26PM +0400, Marc-André Lureau wrote:
> > > Hi
> > > 
> > > On Thu, Jan 10, 2019 at 6:05 AM Eduardo Habkost <ehabkost@redhat.com> wrote:
> > > >
> > > > The disable-legacy and disable-modern properties apply only to
> > > > some virtio-pci devices.  Make those properties optional.
> > > >
> > > > This fixes the crash introduced by commit f6e501a28ef9 ("virtio: Provide
> > > > version-specific variants of virtio PCI devices"):
> > > >
> > > >   $ 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)
> > > >
> > > > Reported-by: Thomas Huth <thuth@redhat.com>
> > > > Fixes: f6e501a28ef9 ("virtio: Provide version-specific variants of virtio PCI devices")
> > > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > > > ---
> > > >  hw/core/machine.c | 5 +++--
> > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/hw/core/machine.c b/hw/core/machine.c
> > > > index 5530b71981..a19143aa44 100644
> > > > --- a/hw/core/machine.c
> > > > +++ b/hw/core/machine.c
> > > > @@ -91,8 +91,9 @@ const size_t hw_compat_2_7_len = G_N_ELEMENTS(hw_compat_2_7);
> > > >
> > > >  GlobalProperty hw_compat_2_6[] = {
> > > >      { "virtio-mmio", "format_transport_address", "off" },
> > > > -    { "virtio-pci", "disable-modern", "on" },
> > > > -    { "virtio-pci", "disable-legacy", "off" },
> > > > +    /* Optional because not all virtio-pci devices support legacy mode */
> > > > +    { "virtio-pci", "disable-modern", "on",  .optional = true },
> > > > +    { "virtio-pci", "disable-legacy", "off", .optional = true },
> > > 
> > > Could the generic devices implement a specific interface instead?
> > > virtio-pci-generic?
> > 
> > This is the kind of complexity I wanted to avoid.  We already
> > have too many interface names for subsets of PCI and virtio
> > devices.
> > 
> > > 
> > > Adding "optional" handling looks like it may hide some other errors.
> > 
> > What if we just make "optional" mean "skip if the property
> > doesn't exist", as suggested by Cornelia and Dave?
> 
> That's the more standard meaning of the word optional, isn't it?

Well the word is a separate issue; 'optional' is probably a bad choice
but that's less important than what it actually does.
I'd go for skip_if_missing  which is explicit.

Dave

> 
> > -- 
> > Eduardo
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2019-01-10 15:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  2:02 [Qemu-devel] [PATCH v2 0/3] Fix virtio-*(-non)-transitional crash on 2.6 machine-types Eduardo Habkost
2019-01-10  2:02 ` [Qemu-devel] [PATCH v2 1/3] qom: Don't keep error value between object_property_parse() calls Eduardo Habkost
2019-01-10  2:43   ` Eric Blake
2019-01-10  8:30   ` Marc-André Lureau
2019-01-10 10:42   ` Cornelia Huck
2019-01-10  2:02 ` [Qemu-devel] [PATCH v2 2/3] globals: Allow global properties to be optional Eduardo Habkost
2019-01-10 10:52   ` Cornelia Huck
2019-01-10  2:02 ` [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional Eduardo Habkost
2019-01-10  8:35   ` Marc-André Lureau
2019-01-10 11:15     ` Dr. David Alan Gilbert
2019-01-10 13:31     ` Eduardo Habkost
2019-01-10 14:12       ` Michael S. Tsirkin
2019-01-10 15:01         ` Dr. David Alan Gilbert [this message]
2019-01-10 18:07           ` Eduardo Habkost
2019-01-10 21:06             ` Marc-André Lureau
2019-01-11  8:22               ` Cornelia Huck

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=20190110150125.GF2589@work-vm \
    --to=dgilbert@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=marcandre.lureau@gmail.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 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.