From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 1/6] libxl: add "merge" function to generic device type support Date: Thu, 19 Jan 2017 17:14:35 +0100 Message-ID: <20170119161435.GL31625@aepfle.de> References: <1468337444-24108-1-git-send-email-jgross@suse.com> <1468337444-24108-2-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7295136294233920775==" Return-path: In-Reply-To: <1468337444-24108-2-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Juergen Gross Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============7295136294233920775== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S6vg04ofUPzW4qJg" Content-Disposition: inline --S6vg04ofUPzW4qJg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Tue, Jul 12, Juergen Gross wrote: > Instead of using a macro generating the code to merge xenstore and > json configuration data, use the generic device type support for > this purpose. > This requires to add some accessor functions to the framework and > a structure for disks (as disks are added separately they didn't need > such a structure up to now). > +++ b/tools/libxl/libxl.c > @@ -7371,93 +7371,68 @@ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid, > + if (!dt->list || !dt->compare) > + continue; This makes libxl_device__compare optional ... > +#define DEFINE_DEVICE_TYPE_STRUCT_X(name, sname, ...) \ > + const struct libxl_device_type libxl__ ## name ## _devtype = { \ > + .type = #sname, \ > + .ptr_offset = offsetof(libxl_domain_config, name ## s), \ > + .num_offset = offsetof(libxl_domain_config, num_ ## name ## s), \ > + .dev_elem_size = sizeof(libxl_device_ ## sname), \ > + .add = libxl__add_ ## name ## s, \ > + .list = (void *(*)(libxl_ctx *, uint32_t, int *)) \ > + libxl_device_ ## sname ## _list, \ > + .dispose = (void (*)(void *))libxl_device_ ## sname ## _dispose, \ > + .compare = (int (*)(void *, void *)) \ > + libxl_device_ ## sname ## _compare, \ ... and this makes libxl_device__compare mandatory. Which one is correct? Olaf --S6vg04ofUPzW4qJg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSkRyP6Rn//f03pRUBdQqD6ppg2fgUCWIDl5gAKCRBdQqD6ppg2 fuyVAKDYDIaiOHJxVASL77d/eCGengVZOgCeOTUnRiwZa/2O8YzDuP+jGh+Z5k4= =hZXh -----END PGP SIGNATURE----- --S6vg04ofUPzW4qJg-- --===============7295136294233920775== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============7295136294233920775==--