From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQK9e-0004XQ-Qz for qemu-devel@nongnu.org; Thu, 21 Jul 2016 16:01:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQK9a-0005Fp-Mh for qemu-devel@nongnu.org; Thu, 21 Jul 2016 16:01:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQK9a-0005Fk-Dt for qemu-devel@nongnu.org; Thu, 21 Jul 2016 16:01:06 -0400 References: <146911619705.23920.6002060635853247073.stgit@bahia.lan> From: Eric Blake Message-ID: <579129F3.3050406@redhat.com> Date: Thu, 21 Jul 2016 14:00:51 -0600 MIME-Version: 1.0 In-Reply-To: <146911619705.23920.6002060635853247073.stgit@bahia.lan> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bl6CrgwVbGU3f29BKF3iAaxBtknT8DG3s" Subject: Re: [Qemu-devel] [PATCH v2] virtio-pci: error out when both legacy and modern modes are disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz , "Michael S. Tsirkin" Cc: Cornelia Huck , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bl6CrgwVbGU3f29BKF3iAaxBtknT8DG3s From: Eric Blake To: Greg Kurz , "Michael S. Tsirkin" Cc: Cornelia Huck , qemu-devel@nongnu.org Message-ID: <579129F3.3050406@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] virtio-pci: error out when both legacy and modern modes are disabled References: <146911619705.23920.6002060635853247073.stgit@bahia.lan> In-Reply-To: <146911619705.23920.6002060635853247073.stgit@bahia.lan> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/21/2016 09:52 AM, Greg Kurz wrote: > From: Greg Kurz >=20 > Without presuming if we got there because of a user mistake or some > more subtle bug in the tooling, it really does not make sense to > implement a non-functional device. >=20 > Signed-off-by: Greg Kurz > Signed-off-by: Greg Kurz > --- > v2: - error out at realize time as suggested by Connie > - updated title and changelog > --- > hw/virtio/virtio-pci.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > index f0677b73d860..8d707aac0c21 100644 > --- a/hw/virtio/virtio-pci.c > +++ b/hw/virtio/virtio-pci.c > @@ -1838,6 +1838,12 @@ static void virtio_pci_dc_realize(DeviceState *q= dev, Error **errp) > VirtIOPCIProxy *proxy =3D VIRTIO_PCI(qdev); > PCIDevice *pci_dev =3D &proxy->pci_dev; > =20 > + if (proxy->flags & VIRTIO_PCI_FLAG_DISABLE_LEGACY && > + proxy->flags & VIRTIO_PCI_FLAG_DISABLE_MODERN) { > + error_setg(errp, "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."); Too long. error_setg() should be a single phrase, with no trailing '.'. If you need to add additional information, error_append_hint() is how you add the second sentence. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --bl6CrgwVbGU3f29BKF3iAaxBtknT8DG3s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXkSn0AAoJEKeha0olJ0NqTKgH/3ZVaupR9M0F7bPBRTD3UVMa 0lDbawEEFDIr/xqaAxtiAeMlfu5vSpBlVaG+eTIeDVT5shtoGHG+IvaFeq9GlK7K 5GFI2biiKzbSFnPj5GLq8ncHaFiSf473LixpgpCoXWZCZVaIsuGE7Ppgq7r4uwPY N0xx5P7pHjMoXydwrujJcJl2xdrdfSqYcHIq27ZxwD1E9tGy/jmr2TmNcRgbgYzq LnPwLceuS06/jzeFG8tcuqE2wKq45GmnUQEXNmRGpz64KSbvvUZnvm2EuQ+0shAl zbQTQvTfb8xOSvAblAKmNOuDtQE46aE0MiB07G9YacRvufBIL+xkqkSN0QAzOzc= =X1GD -----END PGP SIGNATURE----- --bl6CrgwVbGU3f29BKF3iAaxBtknT8DG3s--