From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 6/8] libxl: allow a generation ID to be specified at domain creation Date: Wed, 18 Jun 2014 14:22:22 +0100 Message-ID: <53A1928E.3040300@citrix.com> References: <1402585478-3389-1-git-send-email-david.vrabel@citrix.com> <1402585478-3389-7-git-send-email-david.vrabel@citrix.com> <1403091233.25575.13.camel@kazak.uk.xensource.com> <53A1817A.5090102@citrix.com> <1403094349.25575.22.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WxFop-0000xO-Fr for xen-devel@lists.xenproject.org; Wed, 18 Jun 2014 13:22:27 +0000 In-Reply-To: <1403094349.25575.22.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , David Vrabel Cc: xen-devel@lists.xenproject.org, Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 18/06/14 13:25, Ian Campbell wrote: > On Wed, 2014-06-18 at 13:09 +0100, David Vrabel wrote: >> On 18/06/14 12:33, Ian Campbell wrote: >>> On Thu, 2014-06-12 at 16:04 +0100, David Vrabel wrote: >>>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl >>>> index f0f6e34..1c5e687 100644 >>>> --- a/tools/libxl/libxl_types.idl >>>> +++ b/tools/libxl/libxl_types.idl >>>> @@ -371,6 +371,8 @@ libxl_domain_build_info = Struct("domain_build_info",[ >>>> ("xen_platform_pci", libxl_defbool), >>>> ("usbdevice_list", libxl_string_list), >>>> ("vendor_device", libxl_vendor_device), >>>> + # See libxl_ms_vm_genid_generate() >>>> + ("ms_vm_genid", libxl_uuid), >>> >>> When we discussed this IRL I thought we had decided that this should be >>> a new libxl_ms_vm_genid type, effectively a typedef of uint8_t[16], >>> similar to libxl_mac and libxl_hwcap[[0]]. This would avoid any >>> suggestion that one of the more structured forms of UUID would be >>> appropriate here. >> >> I kept the libxl_uuid type in the end because it allowed me to use >> libxl_uuid_is_nil() without having to re-implement an equivalent. > > Doesn't sound too tricky though. > >>> I appreciate that you tried to address that with the comment, but I fear >>> it might not be terribly effective in practice... >> >> A toolstack author cannot use the ms_vm_genid field correctly without >> reading the Microsoft document and that's clear on the requirements. > > What's not clear is that libxl_uuid_generate() doesn't (necessarily) > meet the spec. Using a different type would stop people from using that. > >> Do you still want a new typedef? > > I think it would be best. I started doing this and I now disagree (even more). Using a new types requires duplicating the uuid json pack/unpack code and prevents toolstacks from using standard uuid library functions for dealing with the generation ID (e.g., if they need to (un)serailize the ID or store it in a database etc.). The benefits of using libxl_uuid out weight your concern that some one might not use the documented function for generating a valid ID, IMO. David