* [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled
@ 2016-05-12 9:45 Greg Kurz
2016-07-21 9:24 ` Greg Kurz
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kurz @ 2016-05-12 9:45 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel
Without presuming if we got there because of a user mistake or some
more subtile bug in the tooling, it doesn't hurt to log somewhere that
the device won't be functional.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
hw/virtio/virtio-pci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 0f634d2d776e..a74978cb5e83 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1639,6 +1639,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
uint32_t size;
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+ if (!legacy && !modern) {
+ error_report("Warning: device is unserviceable when both legacy and modern modes are disabled. At least one of the disable-modern or disable-legacy properties should be set to false.");
+ }
+
config = proxy->pci_dev.config;
if (proxy->class_code) {
pci_config_set_class(config, proxy->class_code);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled
2016-05-12 9:45 [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled Greg Kurz
@ 2016-07-21 9:24 ` Greg Kurz
2016-07-21 11:07 ` Cornelia Huck
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kurz @ 2016-07-21 9:24 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel, Cornelia Huck
On Thu, 12 May 2016 11:45:58 +0200
Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> Without presuming if we got there because of a user mistake or some
> more subtile bug in the tooling, it doesn't hurt to log somewhere that
> the device won't be functional.
>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> ---
Michael,
This patch still applies to your tree. Please nack if this is not worth
being upstreamed.
Cc'ing Connie for broader audience :)
Cheers.
--
Greg
> hw/virtio/virtio-pci.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 0f634d2d776e..a74978cb5e83 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -1639,6 +1639,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
> uint32_t size;
> VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
>
> + if (!legacy && !modern) {
> + error_report("Warning: device is unserviceable when both legacy and modern modes are disabled. At least one of the disable-modern or disable-legacy properties should be set to false.");
> + }
> +
> config = proxy->pci_dev.config;
> if (proxy->class_code) {
> pci_config_set_class(config, proxy->class_code);
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled
2016-07-21 9:24 ` Greg Kurz
@ 2016-07-21 11:07 ` Cornelia Huck
2016-07-21 14:43 ` Greg Kurz
0 siblings, 1 reply; 6+ messages in thread
From: Cornelia Huck @ 2016-07-21 11:07 UTC (permalink / raw)
To: Greg Kurz; +Cc: Michael S. Tsirkin, qemu-devel
On Thu, 21 Jul 2016 11:24:45 +0200
Greg Kurz <groug@kaod.org> wrote:
> On Thu, 12 May 2016 11:45:58 +0200
> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> > Without presuming if we got there because of a user mistake or some
> > more subtile bug in the tooling, it doesn't hurt to log somewhere that
s/subtile/subtle/
> > the device won't be functional.
> >
> > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > ---
>
> Michael,
>
> This patch still applies to your tree. Please nack if this is not worth
> being upstreamed.
>
> Cc'ing Connie for broader audience :)
>
> Cheers.
>
> --
> Greg
>
> > hw/virtio/virtio-pci.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > index 0f634d2d776e..a74978cb5e83 100644
> > --- a/hw/virtio/virtio-pci.c
> > +++ b/hw/virtio/virtio-pci.c
> > @@ -1639,6 +1639,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
> > uint32_t size;
> > VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
> >
> > + if (!legacy && !modern) {
> > + error_report("Warning: device is unserviceable when both legacy and modern modes are disabled. At least one of the disable-modern or disable-legacy properties should be set to false.");
> > + }
Do you maybe want to fail this at the realize stage already? A device
that is neither legacy nor modern should not exist at all.
> > +
> > config = proxy->pci_dev.config;
> > if (proxy->class_code) {
> > pci_config_set_class(config, proxy->class_code);
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled
2016-07-21 11:07 ` Cornelia Huck
@ 2016-07-21 14:43 ` Greg Kurz
2016-07-21 15:32 ` Marcel Apfelbaum
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kurz @ 2016-07-21 14:43 UTC (permalink / raw)
To: Cornelia Huck; +Cc: Michael S. Tsirkin, qemu-devel
On Thu, 21 Jul 2016 13:07:46 +0200
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> On Thu, 21 Jul 2016 11:24:45 +0200
> Greg Kurz <groug@kaod.org> wrote:
>
> > On Thu, 12 May 2016 11:45:58 +0200
> > Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> > > Without presuming if we got there because of a user mistake or some
> > > more subtile bug in the tooling, it doesn't hurt to log somewhere that
>
> s/subtile/subtle/
>
Frenglish stroke again :)
> > > the device won't be functional.
> > >
> > > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > > ---
> >
> > Michael,
> >
> > This patch still applies to your tree. Please nack if this is not worth
> > being upstreamed.
> >
> > Cc'ing Connie for broader audience :)
> >
> > Cheers.
> >
> > --
> > Greg
> >
> > > hw/virtio/virtio-pci.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > > index 0f634d2d776e..a74978cb5e83 100644
> > > --- a/hw/virtio/virtio-pci.c
> > > +++ b/hw/virtio/virtio-pci.c
> > > @@ -1639,6 +1639,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
> > > uint32_t size;
> > > VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
> > >
> > > + if (!legacy && !modern) {
> > > + error_report("Warning: device is unserviceable when both legacy and modern modes are disabled. At least one of the disable-modern or disable-legacy properties should be set to false.");
> > > + }
>
> Do you maybe want to fail this at the realize stage already? A device
> that is neither legacy nor modern should not exist at all.
>
Makes sense. I'll send a v2. Thanks !
> > > +
> > > config = proxy->pci_dev.config;
> > > if (proxy->class_code) {
> > > pci_config_set_class(config, proxy->class_code);
> > >
> > >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled
2016-07-21 14:43 ` Greg Kurz
@ 2016-07-21 15:32 ` Marcel Apfelbaum
2016-07-21 16:20 ` Greg Kurz
0 siblings, 1 reply; 6+ messages in thread
From: Marcel Apfelbaum @ 2016-07-21 15:32 UTC (permalink / raw)
To: Greg Kurz, Cornelia Huck; +Cc: qemu-devel, Michael S. Tsirkin
On 07/21/2016 05:43 PM, Greg Kurz wrote:
> On Thu, 21 Jul 2016 13:07:46 +0200
> Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
>
>> On Thu, 21 Jul 2016 11:24:45 +0200
>> Greg Kurz <groug@kaod.org> wrote:
>>
>>> On Thu, 12 May 2016 11:45:58 +0200
>>> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
>>>> Without presuming if we got there because of a user mistake or some
>>>> more subtile bug in the tooling, it doesn't hurt to log somewhere that
>>
>> s/subtile/subtle/
>>
>
> Frenglish stroke again :)
>
>>>> the device won't be functional.
>>>>
>>>> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
>>>> ---
>>>
>>> Michael,
>>>
>>> This patch still applies to your tree. Please nack if this is not worth
>>> being upstreamed.
>>>
>>> Cc'ing Connie for broader audience :)
>>>
>>> Cheers.
>>>
>>> --
>>> Greg
>>>
>>>> hw/virtio/virtio-pci.c | 4 ++++
>>>> 1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
>>>> index 0f634d2d776e..a74978cb5e83 100644
>>>> --- a/hw/virtio/virtio-pci.c
>>>> +++ b/hw/virtio/virtio-pci.c
>>>> @@ -1639,6 +1639,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
>>>> uint32_t size;
>>>> VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
>>>>
>>>> + if (!legacy && !modern) {
>>>> + error_report("Warning: device is unserviceable when both legacy and modern modes are disabled. At least one of the disable-modern or disable-legacy properties should be set to false.");
>>>> + }
>>
>> Do you maybe want to fail this at the realize stage already? A device
>> that is neither legacy nor modern should not exist at all.
>>
>
> Makes sense. I'll send a v2. Thanks !
>
I suggest to rebase it on top of:
https://lists.gnu.org/archive/html/qemu-devel/2016-07/msg04744.html
which touches the same area... or the maintainer will deal with it :)
Thanks,
Marcel
>>>> +
>>>> config = proxy->pci_dev.config;
>>>> if (proxy->class_code) {
>>>> pci_config_set_class(config, proxy->class_code);
>>>>
>>>>
>>>
>>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled
2016-07-21 15:32 ` Marcel Apfelbaum
@ 2016-07-21 16:20 ` Greg Kurz
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kurz @ 2016-07-21 16:20 UTC (permalink / raw)
To: Marcel Apfelbaum; +Cc: Cornelia Huck, qemu-devel, Michael S. Tsirkin
On Thu, 21 Jul 2016 18:32:40 +0300
Marcel Apfelbaum <marcel.apfelbaum@gmail.com> wrote:
> On 07/21/2016 05:43 PM, Greg Kurz wrote:
> > On Thu, 21 Jul 2016 13:07:46 +0200
> > Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> >
> >> On Thu, 21 Jul 2016 11:24:45 +0200
> >> Greg Kurz <groug@kaod.org> wrote:
> >>
> >>> On Thu, 12 May 2016 11:45:58 +0200
> >>> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> >>>> Without presuming if we got there because of a user mistake or some
> >>>> more subtile bug in the tooling, it doesn't hurt to log somewhere that
> >>
> >> s/subtile/subtle/
> >>
> >
> > Frenglish stroke again :)
> >
> >>>> the device won't be functional.
> >>>>
> >>>> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> >>>> ---
> >>>
> >>> Michael,
> >>>
> >>> This patch still applies to your tree. Please nack if this is not worth
> >>> being upstreamed.
> >>>
> >>> Cc'ing Connie for broader audience :)
> >>>
> >>> Cheers.
> >>>
> >>> --
> >>> Greg
> >>>
> >>>> hw/virtio/virtio-pci.c | 4 ++++
> >>>> 1 file changed, 4 insertions(+)
> >>>>
> >>>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> >>>> index 0f634d2d776e..a74978cb5e83 100644
> >>>> --- a/hw/virtio/virtio-pci.c
> >>>> +++ b/hw/virtio/virtio-pci.c
> >>>> @@ -1639,6 +1639,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
> >>>> uint32_t size;
> >>>> VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
> >>>>
> >>>> + if (!legacy && !modern) {
> >>>> + error_report("Warning: device is unserviceable when both legacy and modern modes are disabled. At least one of the disable-modern or disable-legacy properties should be set to false.");
> >>>> + }
> >>
> >> Do you maybe want to fail this at the realize stage already? A device
> >> that is neither legacy nor modern should not exist at all.
> >>
> >
> > Makes sense. I'll send a v2. Thanks !
> >
>
> I suggest to rebase it on top of:
> https://lists.gnu.org/archive/html/qemu-devel/2016-07/msg04744.html
> which touches the same area... or the maintainer will deal with it :)
>
Oh I had missed this patch... and I would never leave the chore to
the Maintainer :)
I'll rebase and send a v3.
> Thanks,
> Marcel
>
Thanks Marcel for raising the flag !
Cheers.
--
Greg
> >>>> +
> >>>> config = proxy->pci_dev.config;
> >>>> if (proxy->class_code) {
> >>>> pci_config_set_class(config, proxy->class_code);
> >>>>
> >>>>
> >>>
> >>
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-21 16:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-12 9:45 [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled Greg Kurz
2016-07-21 9:24 ` Greg Kurz
2016-07-21 11:07 ` Cornelia Huck
2016-07-21 14:43 ` Greg Kurz
2016-07-21 15:32 ` Marcel Apfelbaum
2016-07-21 16:20 ` Greg Kurz
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.