From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 1/5] libxl: remove DM path in libxl__device_model_destroy Date: Wed, 18 Mar 2015 13:23:03 +0000 Message-ID: <1426684983.14291.26.camel@citrix.com> References: <1426242875-24446-1-git-send-email-wei.liu2@citrix.com> <1426242875-24446-2-git-send-email-wei.liu2@citrix.com> <1426684863.14291.24.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426684863.14291.24.camel@citrix.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: Wei Liu Cc: anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-03-18 at 13:21 +0000, Ian Campbell wrote: > On Fri, 2015-03-13 at 10:34 +0000, Wei Liu wrote: > > ... because it is the right place to clean up device model stuffs. > > ... and not devices_destroy_cb because it is the right ... > > (also "stuff"). > > > And the path should use LIBXL_TOOLSTACK_DOMID instead of hardcoded 0. > > Between this and what is in the next patch I think you probably should > refactor into a helper function to get the correct path for a given > domid. > > FWIW I think you might also be able to do: > GCSPRINTF("/local/domain/" #LIBXL_TOOLSTACK_DOMID "/device-model/%d", > domid); > > If you want, although perhaps the intention is for it to eventually not > be a hard-define of 0 and become e.g. a function call or a global > variable reference, in which case best not? Having reread patch #0 more carefully I suppose the helper would need to take the dm_domid too, which would then rule out that cpp trick. Ian.