This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] Re: [PATCH] libxl: initialize domid to 0 in libxl__creat

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] libxl: initialize domid to 0 in libxl__create_stubdom
From: ZhouPeng <zpengxen@xxxxxxxxx>
Date: Tue, 21 Jun 2011 21:31:43 +0800
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, Wei Liu <liuw@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Tue, 21 Jun 2011 06:32:37 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Y7UR5s+9NjwsoGu5jkVxG1KZzXBMKIIJ4qsfQAoRxXQ=; b=YJfwbAG0UfycN3zcOpiSmO2BMomrIop65iFyvD0jXcV4n6AsCY3f1WARDPZXKyzvGu QeneooElZKJCpCH5oXoToXyDdlyJ2D2rFug90jnlMqwhf9mV+MGN47RysGl8fheP8fWR NUj0fdjRnV+89c3BieG3qBylgGAaIwpq+58yU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=j3pm8q9rK+BLkxAO23eRrAXh/pliR4tg+xiu813N0074NuAI1D1mZGj8luVaG6qdMD UrnpcbP96rcj7LSQs6E+/+BrFrACczpv0pfTVIlUQeMBG1XZp7dJuswyNNYFYrjYgyCA ci6L7n4txwwd1ZYWEAkyWdbcg5s7S503eenfc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19968.36444.26850.724089@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1307595829.8990.9.camel@limbo> <1307606121.775.761.camel@xxxxxxxxxxxxxxxxxxxxxx> <1307608287.31235.17.camel@limbo> <1307615031.775.810.camel@xxxxxxxxxxxxxxxxxxxxxx> <19963.37638.19033.472036@xxxxxxxxxxxxxxxxxxxxxxxx> <alpine.DEB.2.00.1106202003430.12963@kaball-desktop> <BANLkTim+5avEnTc_uy2cQY5i63g=JAvNJQ@xxxxxxxxxxxxxx> <19968.36444.26850.724089@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 = 0;
        unsigned int domcr_flags;

        ret = -EINVAL;
        dom = op->domain;
        /*** here below, it seem to allow specify domid by caller ***/
        if ( (dom > 0) && (dom < DOMID_FIRST_RESERVED) )
            ret = -EINVAL;
            if ( !is_free_domid(dom) )
            for ( dom = rover + 1; dom != rover; dom++ )
                if ( dom == DOMID_FIRST_RESERVED )
                    dom = 0;
                if ( is_free_domid(dom) )

            ret = -ENOMEM;
            if ( dom == rover )

            rover = 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 <Ian.Jackson@xxxxxxxxxxxxx> wrote:
> 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 <= 0, it meas to request the hypervisor
>> to assign the next free id.
> This is not correct.  The hypervisor will always assign the domid and
> there is no facility to specify one.
> Ian.

Zhou Peng
Operating System Technology Group
Institute of Software, the Chinese Academy of Sciences (ISCAS)

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>