From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:58352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqbDr-0001Mo-Us for qemu-devel@nongnu.org; Mon, 04 Feb 2019 05:11:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqbDr-00030K-2v for qemu-devel@nongnu.org; Mon, 04 Feb 2019 05:11:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53174) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gqbDn-0002az-NU for qemu-devel@nongnu.org; Mon, 04 Feb 2019 05:11:24 -0500 Date: Mon, 4 Feb 2019 10:05:28 +0000 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Message-ID: <20190204100528.GA1905@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20190118133826.22447-1-berrange@redhat.com> <20190128174857.GT4136@habkost.net> <20190201171915-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190201171915-mutt-send-email-mst@kernel.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] hw: report invalid disable-legacy|modern usage for virtio-1-only devs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Eduardo Habkost , qemu-devel@nongnu.org, Gonglei , Gerd Hoffmann On Fri, Feb 01, 2019 at 05:19:32PM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 28, 2019 at 03:48:57PM -0200, Eduardo Habkost wrote: > > On Fri, Jan 18, 2019 at 01:38:26PM +0000, Daniel P. Berrang=C3=A9 wro= te: > > > A number of virtio devices (gpu, crypto, mouse, keyboard, tablet) o= nly > > > support the virtio-1 (aka modern) mode. Currently if the user launc= hes > > > QEMU, setting those devices to enable legacy mode, QEMU will silent= ly > > > create them in modern mode, ignoring the user's (mistaken) request. > > >=20 > > > This patch introduces proper data validation so that an attempt to > > > configure a virtio-1-only devices in legacy mode gets reported as a= n > > > error to the user. > > >=20 > > > Checking this required introduction of a new field to explicitly tr= ack > > > what operating model is to be used for a device, separately from th= e > > > disable_modern and disable_legacy fields that record the user's > > > requested configuration. > > >=20 > > > Signed-off-by: Daniel P. Berrang=C3=A9 > >=20 > > This breaks the virtio-1-only devices on pc-*-2.6: > >=20 > > $ ./x86_64-softmmu/qemu-system-x86_64 -device virtio-vga -machine p= c-i440fx-2.6 > > qemu-system-x86_64: -device virtio-vga: Unable to set disable-legac= y=3Doff on a virtio-1.0 only device > >=20 > > Probably the simplest way to fix that is to append the following to > > hw_compat_2_6: > >=20 > > { virtio-vga, disable-modern, off }, > > { virtio-gpu-pci, disable-modern, off }, > > { virtio-input-pci, disable-modern, off }, > > { virtio-crypto-pci, disable-modern, off } >=20 > Daniel do you plan to take a stub at this approach? Yes, its on my todo list, just haven't got to it yet >=20 > > We could also remove the property completely from those devices > > (e.g. by moving virtio-vga to virtio_vga_info.non_transitional_name), > > but it would break compatibility in case people are explicitly > > setting "disable-modern=3Doff" on those devices. > >=20 > > --=20 > > Eduardo Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|