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. >
> Signed-off-by: Daniel P. Berrange <berra...@redhat.com> > --- > > Changed in v3: > > - Add type checks to avoid assertion failures if user > supplied path is not of type device or user-creatable > Reviewed-by: Eric Blake <ebl...@redhat.com> Pre-existing, but may want to fix: > +++ b/qmp.c > @@ -678,16 +678,25 @@ void qmp_object_add(QDict *qdict, QObject **ret, Error > **errp) > > 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/ -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature