[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: Dan Smith <danms@xxxxxxxxxx>
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.