From mboxrd@z Thu Jan 1 00:00:00 1970 From: ZhouPeng Subject: Re: Re: [PATCH] libxl: initialize domid to 0 in libxl__create_stubdom Date: Tue, 21 Jun 2011 21:31:43 +0800 Message-ID: References: <1307595829.8990.9.camel@limbo> <1307606121.775.761.camel@zakaz.uk.xensource.com> <1307608287.31235.17.camel@limbo> <1307615031.775.810.camel@zakaz.uk.xensource.com> <19963.37638.19033.472036@mariner.uk.xensource.com> <19968.36444.26850.724089@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <19968.36444.26850.724089@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: Ian Campbell , Wei Liu , "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Thanks for your reply. If do_domctl is the necessary path for every dom creation, it seems allow to specify a domid for the hypercall do_domctl: XEN_DOMCTL_createdomain The refered code: do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl) case XEN_DOMCTL_createdomain: { struct domain *d; domid_t dom; static domid_t rover =3D 0; unsigned int domcr_flags; ret =3D -EINVAL; ... dom =3D op->domain; /*** here below, it seem to allow specify domid by caller ***/ if ( (dom > 0) && (dom < DOMID_FIRST_RESERVED) ) { ret =3D -EINVAL; if ( !is_free_domid(dom) ) break; } else { for ( dom =3D rover + 1; dom !=3D rover; dom++ ) { if ( dom =3D=3D DOMID_FIRST_RESERVED ) dom =3D 0; if ( is_free_domid(dom) ) break; } ret =3D -ENOMEM; if ( dom =3D=3D rover ) break; rover =3D dom; } If it's true for this hypercall, it's that the current tool's implementation hide it. On Tue, Jun 21, 2011 at 8:28 PM, Ian Jackson wr= ote: > ZhouPeng writes ("Re: [Xen-devel] Re: [PATCH] libxl: initialize domid to = 0 in libxl__create_stubdom"): >> I think it should be both an input and output parameter, >> which allows caller/user to provide a given domid, >> if the given domid <=3D 0, it meas to request the hypervisor >> to assign the next free id. > > This is not correct. =A0The hypervisor will always assign the domid and > there is no facility to specify one. > > Ian. > --=20 Zhou Peng Operating System Technology Group Institute of Software, the Chinese Academy of Sciences (ISCAS)