All of lore.kernel.org
 help / color / mirror / Atom feed
From: aq <aquynh@gmail.com>
To: Dan Smith <danms@us.ibm.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Convert balloon driver to xenstore
Date: Wed, 3 Aug 2005 17:02:09 +0900	[thread overview]
Message-ID: <9cde8bff05080301022cf0d33@mail.gmail.com> (raw)
In-Reply-To: <m38xzllglg.fsf@theine.beaverton.ibm.com>

On 8/2/05, Dan Smith <danms@us.ibm.com> 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

  parent reply	other threads:[~2005-08-03  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-01 17:19 [PATCH] Convert balloon driver to xenstore Dan Smith
2005-08-02 10:11 ` aq
2005-08-02 13:51   ` Dan Smith
2005-08-03  1:11     ` Rusty Russell
2005-08-03  2:13       ` Anthony Liguori
2005-08-03  3:45         ` aq
2005-08-03  5:18           ` Anthony Liguori
2005-08-03  8:02 ` aq [this message]
2005-08-03 13:47   ` Dan Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9cde8bff05080301022cf0d33@mail.gmail.com \
    --to=aquynh@gmail.com \
    --cc=danms@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.