From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQBpi-0006Xf-DJ for qemu-devel@nongnu.org; Thu, 21 Jul 2016 07:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQBpe-00026i-0N for qemu-devel@nongnu.org; Thu, 21 Jul 2016 07:08:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50955 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQBpd-00026d-Pf for qemu-devel@nongnu.org; Thu, 21 Jul 2016 07:07:57 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6LAwwUO113976 for ; Thu, 21 Jul 2016 07:07:57 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 24as6fse4u-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 21 Jul 2016 07:07:57 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Jul 2016 12:07:54 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 14EE517D8056 for ; Thu, 21 Jul 2016 12:09:21 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6LB7oVP2621906 for ; Thu, 21 Jul 2016 11:07:50 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6LB7olR003295 for ; Thu, 21 Jul 2016 05:07:50 -0600 Date: Thu, 21 Jul 2016 13:07:46 +0200 From: Cornelia Huck In-Reply-To: <20160721112445.093999b7@bahia.lan> References: <146304635825.4689.14165883840595728421.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <20160721112445.093999b7@bahia.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160721130746.254a6947.cornelia.huck@de.ibm.com> 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: Greg Kurz Cc: "Michael S. Tsirkin" , qemu-devel@nongnu.org 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/ > > 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. > > + > > config = proxy->pci_dev.config; > > if (proxy->class_code) { > > pci_config_set_class(config, proxy->class_code); > > > > >