From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnwU-0008EL-TM for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:57:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWnwR-0002xe-Bu for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:57:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnwR-0002xa-7N for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:57:47 -0400 References: <1441101059-14269-1-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <55E5CAF9.9040603@redhat.com> Date: Tue, 1 Sep 2015 09:57:45 -0600 MIME-Version: 1.0 In-Reply-To: <1441101059-14269-1-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2fT6QgJu4qtPIEOvOTug5DVGRWqU5Iffq" Subject: Re: [Qemu-devel] [PATCH v3] monitor: allow object_del & device_del to accept QOM paths List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Programmingkid , Gonglei , Markus Armbruster , Paolo Bonzini , =?UTF-8?Q?Andreas_F=c3=a4rber?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2fT6QgJu4qtPIEOvOTug5DVGRWqU5Iffq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/01/2015 03:50 AM, Daniel P. Berrange wrote: > 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. >=20 > Signed-off-by: Daniel P. Berrange > --- >=20 > Changed in v3: >=20 > - Add type checks to avoid assertion failures if user > supplied path is not of type device or user-creatable >=20 Reviewed-by: Eric Blake Pre-existing, but may want to fix: > +++ b/qmp.c > @@ -678,16 +678,25 @@ void qmp_object_add(QDict *qdict, QObject **ret, = Error **errp) > =20 > void qmp_object_del(const char *id, Error **errp) > + if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) { > + error_setg(errp, "%s is not a user-creatable object", id); > + return; > + } > + > if (!user_creatable_can_be_deleted(USER_CREATABLE(obj), errp)) { > error_setg(errp, "%s is in use, can not be deleted", id); s/can not/cannot/ --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2fT6QgJu4qtPIEOvOTug5DVGRWqU5Iffq 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/ iQEcBAEBCAAGBQJV5cr5AAoJEKeha0olJ0NqbVUH/jRnUssjzL7PhKP7VxkK7GcN yLyKSp0i1kHUyD6gb6Z7N/1FEhAazGXUSJfxfD/7LHQgqy+5fhMVREPXwnaCnked 5WqIK0GKuGl3tWhQT0loFVwKM2JtHJCU8+B5ecvb8YbPnpjzbYwjlU9sz6Nhafk/ 5vUJqQqwg5Jm2NkJhgBDkgMRjElSHjsO9fZ8fuJlhMEez/Y9q3rqbK8g7vRgWyIB GXNrwvdmxgfxxPV15zrbzyxUfAz4yJdENDh/HFLSWr5GuZUUtLARswn74IUZ/NQb pJZ2aPI7NYIdq05UxQgsUgJpaBVh/E9vBsEmV5xd64GtRCOcHAKmueztgzc1LlM= =xcYF -----END PGP SIGNATURE----- --2fT6QgJu4qtPIEOvOTug5DVGRWqU5Iffq--