From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFCO-0004Yh-PK for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:43:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQFCK-00076d-RD for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:43:40 -0400 Received: from 4.mo178.mail-out.ovh.net ([46.105.49.171]:52518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFCK-00076W-Kl for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:43:36 -0400 Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id AED7B1004B64 for ; Thu, 21 Jul 2016 16:43:35 +0200 (CEST) Date: Thu, 21 Jul 2016 16:43:30 +0200 From: Greg Kurz Message-ID: <20160721164330.03c6f52a@bahia.lan> In-Reply-To: <20160721130746.254a6947.cornelia.huck@de.ibm.com> References: <146304635825.4689.14165883840595728421.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <20160721112445.093999b7@bahia.lan> <20160721130746.254a6947.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: "Michael S. Tsirkin" , qemu-devel@nongnu.org On Thu, 21 Jul 2016 13:07:46 +0200 Cornelia Huck wrote: > On Thu, 21 Jul 2016 11:24:45 +0200 > Greg Kurz wrote: > > > On Thu, 12 May 2016 11:45:58 +0200 > > Greg Kurz 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 > > > --- > > > > 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); > > > > > > > > >