WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Convert balloon driver to xenstore

To: Dan Smith <danms@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Convert balloon driver to xenstore
From: aq <aquynh@xxxxxxxxx>
Date: Wed, 3 Aug 2005 17:02:09 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 03 Aug 2005 08:00:38 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=beCvFx57rWShKaRf1VY1V4fNI/NCmAKKFD6s995VZ/xW69IWavEvBrvWuyetKQINpDI/SXZaKfILfBzzI5kVCEilsFKrkE6eUwrxnd2gUm6ltdG1zj1nRR66IT/hi+w4q8Cy7i9Qma7PQ2yNlB9XxqXMq/muLFjGf3TenOf9bAM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <m38xzllglg.fsf@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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <m38xzllglg.fsf@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 8/2/05, Dan Smith <danms@xxxxxxxxxx> wrote:
> The attached patch converts the balloon driver and xend to use
> xenstore instead of control messages.
> 
<snip>
> +static void watch_target(struct xenbus_watch *watch, const char *node)
> +{
> +    unsigned long new_target;
> +    int err;
> +
> +    if(watch == &root_watch)
> +    {
> +        /* FIXME: This is part of a dom0 sequencing workaround */
> +        if(register_xenbus_watch(&xb_watch) == 0)
> +        {
> +            /*
> +               We successfully set a watch on memory/target:
> +               now we can stop watching root
> +            */
> +            unregister_xenbus_watch(&root_watch);
> +            balloon_xenbus_init=1;
> +        }
> +        else
> +        {
> +            return;
> +        }
> +    }
> +
> +    err = xenbus_scanf("memory", "target", "%lu", &new_target);
> +
> +    if(err != 1)
> +    {
> +        IPRINTK("Unable to read memory/target\n");
> +        return;
> +    }
> +
> +    set_new_target(new_target >> PAGE_SHIFT);

as under "memory"node, there probably are several nodes besides
"target" (that means what triggered this watch may be not balloon
request), i guess it is better to do some checking before calling
set_new_target, like this:


if (new_target != target_pages)
    set_new_target(new_target >> PAGE_SHIFT);


regards,
aq

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel