From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGYlG-0003Ss-Dk for qemu-devel@nongnu.org; Wed, 28 Jan 2015 14:58:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGYlF-0008JX-89 for qemu-devel@nongnu.org; Wed, 28 Jan 2015 14:58:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGYlE-0008JR-Uz for qemu-devel@nongnu.org; Wed, 28 Jan 2015 14:58:49 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SJwl5D028072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 28 Jan 2015 14:58:48 -0500 Message-ID: <54C93F76.8090905@redhat.com> Date: Wed, 28 Jan 2015 12:58:46 -0700 From: Eric Blake MIME-Version: 1.0 References: <1422387983-32153-1-git-send-email-mreitz@redhat.com> <1422387983-32153-40-git-send-email-mreitz@redhat.com> In-Reply-To: <1422387983-32153-40-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FGJHe3F0uaa7I4lEUBnM4Eir1CUHnqF4H" Subject: Re: [Qemu-devel] [PATCH RESEND 39/50] blockdev: Add blockdev-close-tray List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Jeff Cody , Markus Armbruster , Stefan Hajnoczi , John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FGJHe3F0uaa7I4lEUBnM4Eir1CUHnqF4H Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/27/2015 12:46 PM, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > blockdev.c | 22 ++++++++++++++++++++++ > qapi/block-core.json | 14 ++++++++++++++ > qmp-commands.hx | 33 +++++++++++++++++++++++++++++++++ > 3 files changed, 69 insertions(+) >=20 > +void qmp_blockdev_close_tray(const char *device, Error **errp) > +{ > + BlockBackend *blk; > + > + blk =3D blk_by_name(device); > + if (!blk) { > + error_set(errp, QERR_DEVICE_NOT_FOUND, device); > + return; > + } > + > + if (!blk_dev_has_removable_media(blk)) { > + error_setg(errp, "Device '%s' is not removable", device); > + return; > + } > + > + if (!blk_dev_is_tray_open(blk)) { > + return; > + } Is it worth documenting that this (and the one in 38/50) are intentional no-ops if the tray is already in the desired state? Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --FGJHe3F0uaa7I4lEUBnM4Eir1CUHnqF4H 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJUyT92AAoJEKeha0olJ0Nq25MH/21pLbKsK+BL4VLHXsfPVe1f 3ZVSVNUAkx4IClSf6EUbE3swQrCnehxyFGu3u/0C8++zp6wLZF9EacJVp1fd2Lpl Hmi534F5zgW/ADgTlVUh+SB2IiBFD/JVGf+Muo3HrNUe+NC49ucxTD31DkOVLAZ/ JfmBqSCRaZYwZ0g5iKAcxvu2edWk0w2RyVud0IBsNDL+lF6CSew81dFBzKX+EnDn /znf/wZ0d+UyVrOvigDGjjYcnJYubT3t1MyIATuEprqppfl7rATsnz0e9l1rJHBq FwtwuCtub7v7CCYexn4o5LzcPRhjLR4cxiAmSdpG4KePbg03ozmlHIAFpSFL3A4= =Sxno -----END PGP SIGNATURE----- --FGJHe3F0uaa7I4lEUBnM4Eir1CUHnqF4H--