qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] 答复: Re: [PATCH v2] object: Add 'help' option for all a


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] 答复: Re: [PATCH v2] object: Add 'help' option for all available backends and properties
Date: Thu, 22 Sep 2016 14:48:54 +0100
User-agent: Mutt/1.7.0 (2016-08-17)

On Thu, Sep 22, 2016 at 02:03:39PM +0200, Markus Armbruster wrote:
> "Daniel P. Berrange" <address@hidden> writes:
> >
> > IMHO we should go further and leverage QAPI schema to auto-generate all
> > the tedious boilerplate code for QOM objects
> >
> > eg, consider the crypto/secret.c object file.
> >
> > We could declare it as
> >
> > { 'object': 'QCryptoSecret',
> >   'parent': 'Object',
> >   'properties': {
> >      'format': 'QCryptoSecretFormat',
> >      'data': 'str',
> >      'file': 'str',
> >      'keyid': 'str',
> >      'iv': 'str'
> >      } }
> >
> > Based on that it would have enough knowledge to generate
> >
> >  - struct QCryptoSecret  definition + typedef
> >  - struct QCryptoSecretClass definition + typedef
> >  - TYPE_CRYPTO_SECRET macro
> >  - QCRYPT_SECRET() cast macro
> >  - Setters & getters aka
> >      qcrypto_secret_prop_set_format
> >      qcrypto_secret_prop_get_format
> >      qcrypto_secret_prop_set_data
> >      qcrypto_secret_prop_get_data
> >      qcrypto_secret_prop_set_file
> >      qcrypto_secret_prop_get_file
> >      qcrypto_secret_prop_set_keyid
> >      qcrypto_secret_prop_get_keyid
> >      qcrypto_secret_prop_set_iv
> >      qcrypto_secret_prop_get_iv
> >  - qcrypto_secret_finalize
> >  - qcrypto_secret_class_init
> >  - TypeInfo qcrypto_secret_info variable
> >  - qcrypto_secret_register_types() method
> >  - type_init(qcrypto_secret_register_types);
> >
> > That'd massively reduce the work to create new objects, to just
> > filling in the semantically useful logic
> 
> Promising idea.  Sadly, the existing QAPI queue is eating all my QAPI
> cycles.

Indeed, I've no time either. Perhaps this is something nice for a "lucky"
GSoC / OutReachy student :-) Copying Stefan....

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]