From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH for-4.6 5/8] tools/libxl: Save and restore EMULATOR_XENSTORE_DATA content Date: Fri, 31 Jul 2015 17:38:23 +0100 Message-ID: <55BBA47F.5060003@citrix.com> References: <1438119883-8083-1-git-send-email-andrew.cooper3@citrix.com> <1438119883-8083-6-git-send-email-andrew.cooper3@citrix.com> <21944.48593.122598.951173@mariner.uk.xensource.com> <55BA6037.4050906@citrix.com> <21947.41894.424801.254883@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21947.41894.424801.254883@mariner.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 Jackson Cc: Wei Liu , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org On 31/07/15 17:34, Ian Jackson wrote: > Andrew Cooper writes ("Re: [PATCH for-4.6 5/8] tools/libxl: Save and restore EMULATOR_XENSTORE_DATA content"): >> On 29/07/15 12:49, Ian Jackson wrote: >>>> + rel_start = strlen(xs_path) - 7; >>> This is horrible. >> What do you recommend instead? > I don't see why it is necessary to do something like rel_start at all. > > This whole patch could probably be made much simpler with something > like > > static const char *const physmap_entries[] = { > "start_addr", "size", "name", NULL > }; > > and then loop over it a few times. But the rel_path has nothing to do with which subkeys get chosen. It is to strip out the current domains information from /local/domain/$dm_domid/device-model/$domid/. This is because both of the domid in the path will be different on the other side of migration. This is why EMULATOR_XENSTORE_DATA is purposefully specified relative to the above path, rather than as absolute paths. ~Andrew