From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqkOP-0007a4-6u for qemu-devel@nongnu.org; Tue, 18 Nov 2014 10:08:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqkOG-0006U3-Up for qemu-devel@nongnu.org; Tue, 18 Nov 2014 10:08:33 -0500 Received: from mail4.gandi.net ([217.70.183.210]:41657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqkOG-0006Tn-LR for qemu-devel@nongnu.org; Tue, 18 Nov 2014 10:08:24 -0500 Date: Tue, 18 Nov 2014 16:08:21 +0100 From: William Dauchy Message-ID: <20141118150821.GN17306@gandi.net> References: <20141118100217.GK17306@gandi.net> <87wq6smvut.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GeDkoc8jIzHasOdk" Content-Disposition: inline In-Reply-To: <87wq6smvut.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] hotremoving a disk qmp/hmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Paolo Bonzini , Ian Main , Fam Zheng , QEMU Developers --GeDkoc8jIzHasOdk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Nov18 15:22, Markus Armbruster wrote: > This is block backend "disk1". yes indeed. > I presume you're deleting the device using backend "disk1". yes > What kind of device is this? PCI, perhaps? > Please show us a complete QMP conversation. Here it is: live vm with one disk: (QEMU) query-block { u'return': [ { u'device': u'disk0', u'inserted': { u'backing_file_depth': 0, u'bps': 0, u'bps_rd': 0, u'bps_wr': 0, u'detect_zeroes': u'off', u'drv': u'raw', u'encrypted': False, u'encryption_key_missing': False, u'file': u'/dev/sda', u'image': { u'actual-size': 0, u'dirty-flag': False, u'filename': u'/dev/s= da', u'format': u'raw', u'virtual-size': 3221= 225472}, u'iops': 0, u'iops_rd': 0, u'iops_wr': 0, u'ro': False}, u'io-status': u'ok', u'locked': True, u'removable': True, u'tray_open': False, u'type': u'unknown'}]} hotplugging one disk: (QEMU) blockdev-add with {'options' : { 'driver': 'raw', 'id': 'disk1', 'file': { 'driver': 'file', 'filename': /dev/sdb, } }} (QEMU) device_add with: { 'driver': 'scsi-hd', 'id': 'disk1', 'drive': 'disk1', 'scsi-id': 1, 'removable': 'on', 'dpofua': 'off' } (QEMU) query-block { u'return': [ { u'device': u'disk0', u'inserted': { u'backing_file_depth': 0, u'bps': 0, u'bps_rd': 0, u'bps_wr': 0, u'detect_zeroes': u'off', u'drv': u'raw', u'encrypted': False, u'encryption_key_missing': False, u'file': u'/dev/sda', u'image': { u'actual-size': 0, u'dirty-flag': False, u'filename': u'/dev/s= da', u'format': u'raw', u'virtual-size': 3221= 225472}, u'iops': 0, u'iops_rd': 0, u'iops_wr': 0, u'ro': False}, u'io-status': u'ok', u'locked': True, u'removable': True, u'tray_open': False, u'type': u'unknown'},, { u'device': u'disk1', u'inserted': { u'backing_file_depth': 0, u'bps': 0, u'bps_rd': 0, u'bps_wr': 0, u'detect_zeroes': u'off', u'drv': u'raw', u'encrypted': False, u'encryption_key_missing': False, u'file': u'/dev/sdb', u'image': { u'actual-size': 0, u'dirty-flag': False, u'filename': u'/dev/s= db', u'format': u'raw', u'virtual-size': 3221= 225472}, u'iops': 0, u'iops_rd': 0, u'iops_wr': 0, u'ro': False}, u'io-status': u'ok', u'locked': True, u'removable': True, u'tray_open': False, u'type': u'unknown'}]} hotremoving disk1: (QEMU) device_del with: {'id': 'disk1'} (QEMU) query-block { u'return': [ { u'device': u'disk0', u'inserted': { u'backing_file_depth': 0, u'bps': 0, u'bps_rd': 0, u'bps_wr': 0, u'detect_zeroes': u'off', u'drv': u'raw', u'encrypted': False, u'encryption_key_missing': False, u'file': u'/dev/sda', u'image': { u'actual-size': 0, u'dirty-flag': False, u'filename': u'/dev/s= da', u'format': u'raw', u'virtual-size': 3221= 225472}, u'iops': 0, u'iops_rd': 0, u'iops_wr': 0, u'ro': False}, u'io-status': u'ok', u'locked': True, u'removable': True, u'tray_open': False, u'type': u'unknown'},, { u'device': u'disk1', u'inserted': { u'backing_file_depth': 0, u'bps': 0, u'bps_rd': 0, u'bps_wr': 0, u'detect_zeroes': u'off', u'drv': u'raw', u'encrypted': False, u'encryption_key_missing': False, u'file': u'/dev/sdb, u'image': { u'actual-size': 0, u'dirty-flag': False, u'filename': u'/dev/s= db', u'format': u'raw', u'virtual-size': 3221= 225472}, u'iops': 0, u'iops_rd': 0, u'iops_wr': 0, u'ro': False}, u'io-status': u'ok', u'locked': False, u'removable': True, u'tray_open': False, u'type': u'unknown'}]} So now I have locked =3D=3D False but I don't know how to clean the object with QMP API. so... switching to HMP API: (QEMU) info block disk0: /dev/sda (raw) Removable device: locked, tray closed disk1: /dev/sdb (raw) Removable device: not locked, tray closed (QEMU) drive_del disk1 (QEMU) info block disk0: /dev/sda (raw) Removable device: locked, tray closed Is there a way to do the same with QMP commands? Thanks, --=20 William --GeDkoc8jIzHasOdk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRrYOUACgkQ1I6eqOUidQFJzQCdFoPronnj47WUAgdCy/TqTmAn Vy0AniYr/7W+NX8hsIt5gvCZs2crNx/X =Du9t -----END PGP SIGNATURE----- --GeDkoc8jIzHasOdk--