From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4N5-0008PN-Qh for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn4N0-0001HF-VC for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:49:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4N0-0001Gv-P3 for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:48:58 -0400 Date: Thu, 22 Sep 2016 14:48:54 +0100 From: "Daniel P. Berrange" Message-ID: <20160922134854.GQ352@redhat.com> Reply-To: "Daniel P. Berrange" References: <57DDA45C02000062000996DE@prv-mh.provo.novell.com> <87fuowje3u.fsf@dusky.pond.sub.org> <9ae54df6-e098-8ca9-53c8-1a65eba32dae@suse.de> <87r38f7qzm.fsf@dusky.pond.sub.org> <57E31E25020000620009B116@prv-mh.provo.novell.com> <87shssnxeq.fsf@dusky.pond.sub.org> <20160922085435.GH352@redhat.com> <87lgykkx2h.fsf@dusky.pond.sub.org> <20160922112830.GJ352@redhat.com> <87a8f0i1k4.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87a8f0i1k4.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] =?utf-8?b?562U5aSN77yaIFJlOiBbUEFUQ0ggdjJdIG9iamVj?= =?utf-8?q?t=3A_Add_=27help=27_option_for_all_available_backends_and_prope?= =?utf-8?q?rties?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: pbonzini@redhat.com, Lin Ma , qemu-devel@nongnu.org, afaerber@suse.de, Stefan Hajnoczi On Thu, Sep 22, 2016 at 02:03:39PM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" 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 :|