From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z877r-00006F-5h for qemu-devel@nongnu.org; Thu, 25 Jun 2015 09:23:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z877m-0006MI-66 for qemu-devel@nongnu.org; Thu, 25 Jun 2015 09:23:31 -0400 Date: Thu, 25 Jun 2015 14:23:21 +0100 From: Stefan Hajnoczi Message-ID: <20150625132321.GI4419@stefanha-thinkpad.redhat.com> References: <1435068107-12594-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CD/aTaZybdUisKIc" Content-Disposition: inline In-Reply-To: <1435068107-12594-1-git-send-email-peter.maydell@linaro.org> Subject: Re: [Qemu-devel] [PATCH v2 for-2.4 0/3] block: Improve warnings for doubly-connected drives List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin Wolf , patches@linaro.org, qemu-devel@nongnu.org, qemu-block@nongnu.org, Markus Armbruster --CD/aTaZybdUisKIc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 23, 2015 at 03:01:44PM +0100, Peter Maydell wrote: > This patchset attempts to improve the warning and error messages for > bad user command lines that attempt to connect a drive up to two > devices. The motivation here is patch #4, which changes the default > interface for the virt board to virtio. That will break some existing > command lines which forgot to specify if=3Dnone, and so I would like > us to at least diagnose that user error in a helpful way that points > the user towards adding the missing if=3Dnone. >=20 > Version 2 reduces scope, because it turns out that it is harder than > we thought to identify whether a use of an if=3Dsomething drive is the > auto-plugging or a manual wiring up to a device. So all we do here > is improve the error messages for two situations which were already > errors but with rather cryptic messages: >=20 > (1) Drive specified as to be auto-connected and also manually connect= ed > (and the board does handle this if=3D type): > =20 > qemu-system-x86_64 -nodefaults -display none \ > -drive if=3Dscsi,file=3Dtmp.qcow2,id=3Dfoo -device ide-hd,drive= =3Dfoo > =20 > Previously: > qemu-system-x86_64: -device ide-hd,drive=3Dfoo: Property 'ide-hd.dr= ive' > can't take value 'foo', it's in use > =20 > Now: > qemu-system-x86_64: -device ide-hd,drive=3Dfoo: Drive 'foo' is alre= ady in > use because it has been automatically connected to another device (= did > you need 'if=3Dnone' in the drive options?) > =20 > (2) Drive specified to be manually connected in two different ways: > =20 > qemu-system-x86_64 -nodefaults -display none \ > -drive if=3Dnone,file=3Dtmp.qcow2,id=3Dfoo -device ide-hd,drive=3D= foo \ > -device ide-hd,drive=3Dfoo > =20 > Previously: > qemu-system-x86_64: -device ide-hd,drive=3Dfoo: Property 'ide-hd.dr= ive' > can't take value 'foo', it's in use > =20 > Now: > qemu-system-x86_64: -device ide-hd,drive=3Dfoo: Drive 'foo' is alre= ady in > use by another device >=20 > (We'll also produce message 1 in the oddball case where the user creates > a drive if=3Dsomething-not-handled-by-machine and then wires it up manual= ly > to two different devices; in this case their command line is doubly broken > and if they use if=3Dnone as suggested by message 1 they'll then get mess= age 2 > and can fix their own double-usage...) >=20 > Changes v1->v2: > * drop "warn if an if=3D drive was also connected manually" p= atch > * change implementation of "improve error message" patch >=20 >=20 > Peter Maydell (3): > qdev-properties-system: Change set_pointer's parse callback to use > Error > qdev-properties-system: Improve error message for drive assignment > conflict > hw/arm/virt: Make block devices default to virtio >=20 > hw/arm/virt.c | 2 ++ > hw/core/qdev-properties-system.c | 42 +++++++++++++++++++++++++++-------= ------ > 2 files changed, 31 insertions(+), 13 deletions(-) >=20 > --=20 > 1.9.1 >=20 >=20 Reviewed-by: Stefan Hajnoczi --CD/aTaZybdUisKIc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVjADJAAoJEJykq7OBq3PICCMH+gKhXvFjJUy9BrJ9q7pGC5Fn FU68+s8+zEWtsAnFRSdCex5GvNN7tS4I+kFnSZYLHLzHYO18dWpMCkZGNfSpD0BG eWU0/2Yt7+XnuUqo9/3a4cDyaegDC369tspAu4GZzX8oEzrHtQvi0EplnU5psALW uuFJk9Zcaj643YOFaIDB1nhGw6x+moHButQxLR5eba0cs91QdDuNKYaTgzcaxVSo N0+kIQJ0CHyLEMc7EM4z/NYKHtue4PUY/SEGzBvjpNeYaQWtci2Ag9UfCEbcABEe BaEdDI39n86c/kIU8pLCi4zBTjnSjnzXhf5EDKOsu2tZ7WhAIkGomCiV7qAGF2U= =2mWZ -----END PGP SIGNATURE----- --CD/aTaZybdUisKIc--