From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV2aP-0000uD-5C for qemu-devel@nongnu.org; Thu, 27 Aug 2015 15:11:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZV2aK-00068y-6A for qemu-devel@nongnu.org; Thu, 27 Aug 2015 15:11:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV2aJ-00068r-V7 for qemu-devel@nongnu.org; Thu, 27 Aug 2015 15:11:40 -0400 References: <1440691994-4547-1-git-send-email-berrange@redhat.com> <4E89D25A-1DA7-4D4E-B1AF-453CA3227BFD@gmail.com> From: Eric Blake Message-ID: <55DF60E6.70408@redhat.com> Date: Thu, 27 Aug 2015 13:11:34 -0600 MIME-Version: 1.0 In-Reply-To: <4E89D25A-1DA7-4D4E-B1AF-453CA3227BFD@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6nrMJmMPwRbQX4vHqnNMUPd7mhEp7b1rw" Subject: Re: [Qemu-devel] [PATCH v2] monitor: allow object_del & device_del to accept QOM paths List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid , "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6nrMJmMPwRbQX4vHqnNMUPd7mhEp7b1rw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/27/2015 11:26 AM, Programmingkid wrote: >=20 > On Aug 27, 2015, at 12:13 PM, Daniel P. Berrange wrote: >=20 >> Currently both object_del and device_del require that the >> client provide the object/device short ID. While user >> creatable objects require an ID to be provided at time of >> creation, qdev devices may be created without giving an >> ID. The only unique identifier they would then have is the >> QOM object path. >> >> Allowing device_del to accept an object path ensures all >> devices are deletable regardless of whether they have an >> ID. >> >> (qemu) device_add usb-mouse >> (qemu) qom-list /machine/peripheral-anon >> device[0] (child) >> type (string) >> (qemu) device_del /machine/peripheral-anon/device[0] > Your patch do the job, but could be tweaked. Could we make an alias for= > "qom-list /machine/peripheral-anon" that is actually easy to remember. = Perhaps "info devices".=20 >=20 > Also typing "device_del /machine/peripheral-anon/device[0]" seems unnec= essary. It probably=20 > could be shortened to just "device_del device[0]".=20 You're welcome to submit follow up patches to make HMP more useful to you ('info' is already an HMP command, so adding an 'info devices' submode is a reasonable addition). However, the important change here is the QMP change that management apps, like libvirt, will use; and that interface does not need further syntactic sugar. The patch specifically distinguishes between full QOM paths (leading '/') and short names (no leading '/'); and your proposal to try the QOM path under /machine/peripheral-anon/ when given just the string 'device[0]' that did not resolve to a short name is counter to that distinguishing factor. Besides, management apps don't care how long a string is. The QMP interface should not be changed, and any such simplifications you write a patch for should be limited to the HMP side. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6nrMJmMPwRbQX4vHqnNMUPd7mhEp7b1rw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV32DmAAoJEKeha0olJ0NqgIwH/3Hs5ItCOcB9Z8fAxGjKP+IG q9mWDNgQ/oEBTFodTh306b5pdrLEVjkH4YNFO9MjQ1BWjvvwWKWb+7vTkmNJF5wW Xq3TnLir31Ng0oHA7qEUI9HCDBvoz7w8i2+ZwBKoy3a/gZiuO/AgPq74JczXLRJw 0WppuRdzcWPT2PQz/jjoGytLG+A4p9hmrYnf4Xdj76cjPlHeMQcdg7wgFxxIZHSr cpMQs2Rxotqro3VlukAO93jd2+WNfp/3hZSYq02C/QROhxOWJnTzMGLlIn6VRz0W GWEYOh8dxsqph2GbT8UeWf0X/k4M56o2zFG6/YXGo0qgrOg9HzvL/Z6CH4ZkZn4= =hxX0 -----END PGP SIGNATURE----- --6nrMJmMPwRbQX4vHqnNMUPd7mhEp7b1rw--