From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwswI-0003Cw-FF for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:28:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwswD-0007OQ-FP for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:28:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwswD-0007OF-2q for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:28:49 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB5DSmM7012143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 5 Dec 2014 08:28:48 -0500 Message-ID: <5481B30E.1090706@redhat.com> Date: Fri, 05 Dec 2014 06:28:46 -0700 From: Eric Blake MIME-Version: 1.0 References: <1417774136-30001-1-git-send-email-mreitz@redhat.com> <1417774136-30001-4-git-send-email-mreitz@redhat.com> In-Reply-To: <1417774136-30001-4-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KIJxu1bwimv9wq96NxdJLpstGkEtAAicK" Subject: Re: [Qemu-devel] [PATCH v2 3/4] blockdev: Add read-only option to blockdev-change-medium List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , Stefan Hajnoczi , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KIJxu1bwimv9wq96NxdJLpstGkEtAAicK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/05/2014 03:08 AM, Max Reitz wrote: > Add an option to qmp_blockdev_change_medium() which allows changing the= > read-only status of the block device whose medium is changed. >=20 > Some drives do not have a inherently fixed read-only status; for > instance, floppy disks can be set read-only or writable independently o= f > the drive. Some users may find it useful to be able to therefore change= > the read-only status of a block device when changing the medium. >=20 > Signed-off-by: Max Reitz > --- > blockdev.c | 24 +++++++++++++++++++++++- > hmp.c | 2 +- > qapi/block-core.json | 24 +++++++++++++++++++++++- > qmp-commands.hx | 24 +++++++++++++++++++++++- > qmp.c | 3 ++- > 5 files changed, 72 insertions(+), 5 deletions(-) Feels much nicer than v1 :) > +2. Load a read-only medium into a writable drive > + > +-> { "execute": "blockdev-change-medium", > + "arguments": { "device": "isa-fd0", > + "filename": "/srv/images/ro.img", > + "format": "raw", > + "read-only": "retain" } } > + > +<- { "error": > + { "class": "GenericError", > + "desc": "Could not open '/srv/images/ro.img': Permission denied= " } } > + > +-> { "execute": "blockdev-change-medium", > + "arguments": { "device": "isa-fd0", > + "filename": "/srv/images/ro.img", > + "format": "raw", > + "read-only": "ro" } } > + > +<- { "return": {} } Nice example. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KIJxu1bwimv9wq96NxdJLpstGkEtAAicK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUgbMPAAoJEKeha0olJ0NqovwIAIPvEGT3T8iQ4vpsBf8KijPM jttZmvJPo3qiqTB11BYGbXLyvf0CqokJptSTMZsA63bzmc9ePk+DodNeSR9bk20S i4frGAy3E7/acrA+GDSkA25qcv6P1Sws7V6N3jDC49R9XnNc/qGY2VrROPmKUP9O lPoboWCrrtsHN6vPE00PfUu1mYTnwGGsmkR8PZw0pVYJcGdTvaMzwSQD2H9uaP64 tDNJGYg2n9ewU8SiJwk/JqRAjqw2ij4wFp8Ah2PqTP9QhpWe62E42Sa/ZdtxNKHF xQVa0VW+GDmA1oVi1E1Bt5G+Nu9MO5SxuXoQLomWWlNMMU+97F2EdhhuDGidS1k= =hMsC -----END PGP SIGNATURE----- --KIJxu1bwimv9wq96NxdJLpstGkEtAAicK--