All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Patch] support cpupool for xl create
Date: Tue, 11 May 2010 07:47:59 +0200	[thread overview]
Message-ID: <4BE8EF8F.2080802@ts.fujitsu.com> (raw)
In-Reply-To: <4BE8678C.2060801@goop.org>

[-- Attachment #1: Type: text/plain, Size: 2268 bytes --]

On 05/10/2010 10:07 PM, Jeremy Fitzhardinge wrote:
> On 05/09/2010 11:58 PM, Juergen Gross wrote:
>> On 05/10/2010 08:42 AM, Jeremy Fitzhardinge wrote:
>>> On 05/09/2010 11:05 PM, Juergen Gross wrote:
>>>>> diff -r bbf009817ffb tools/libxl/libxl.c
>>>>> --- a/tools/libxl/libxl.c    Fri May 07 19:22:28 2010 +0100
>>>>> +++ b/tools/libxl/libxl.c    Fri May 07 14:57:00 2010 -0700
>>>>> @@ -169,7 +169,8 @@
>>>>>
>>>>>         xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/uuid", vm_path),
>>>>> uuid_string, strlen(uuid_string));
>>>>>         xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/name", vm_path),
>>>>> info->name, strlen(info->name));
>>>>> -    xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name",
>>>>> vm_path), info->poolname, strlen(info->poolname));
>>>>> +    if (info->poolname)
>>>>> +        xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name",
>>>>> vm_path), info->poolname, strlen(info->poolname));
>>>>>
>>>>>         libxl_xs_writev(ctx, t, dom_path, info->xsdata);
>>>>>         libxl_xs_writev(ctx, t, libxl_sprintf(ctx, "%s/platform",
>>>>> dom_path), info->platformdata);
>>>>>
>>>>> fixes it for me.
>>>>
>>>>
>>>> You seem to have specified a not existing cpupool.
>>>> The solution should not be to ignore this, but to do a proper test
>>>> on the
>>>> pool parameter.
>>>> Attached patch does this.
>>>
>>> I'm not using cpupools.  My config makes no mention of "pool" at all.
>>
>> Strange.
>> I tested this case and it worked for me.
>
> Perhaps one thing that you're not testing: I'm using oxenstored, and I'm
> xl without ever having started xend, so xenstore starts out completely
> empty.  I don't know if that makes a difference.

It does :-)
Without proper xenstore entries it is impossible to get a cpupool name from
it's id. Id 0 is hard wired to "Pool-0", so this case can be handled even
without xenstore.
I modified the patch accordingly.


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

[-- Attachment #2: libxl-poolerr.patch --]
[-- Type: text/x-patch, Size: 2022 bytes --]

diff -r bbf009817ffb tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri May 07 19:22:28 2010 +0100
+++ b/tools/libxl/libxl.c	Tue May 11 07:45:01 2010 +0200
@@ -169,7 +169,8 @@ retry_transaction:
 
     xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
     xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/name", vm_path), info->name, strlen(info->name));
-    xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name", vm_path), info->poolname, strlen(info->poolname));
+    if (info->poolname)
+        xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name", vm_path), info->poolname, strlen(info->poolname));
 
     libxl_xs_writev(ctx, t, dom_path, info->xsdata);
     libxl_xs_writev(ctx, t, libxl_sprintf(ctx, "%s/platform", dom_path), info->platformdata);
diff -r bbf009817ffb tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Fri May 07 19:22:28 2010 +0100
+++ b/tools/libxl/libxl_utils.c	Tue May 11 07:45:01 2010 +0200
@@ -84,6 +84,8 @@ char *libxl_poolid_to_name(struct libxl_
     char path[strlen("/local/pool") + 12];
     char *s;
 
+    if (poolid == 0)
+        return "Pool-0";
     snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
     s = xs_read(ctx->xsh, XBT_NULL, path, &len);
     libxl_ptr_add(ctx, s);
diff -r bbf009817ffb tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri May 07 19:22:28 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Tue May 11 07:45:01 2010 +0200
@@ -453,9 +453,15 @@ static void parse_config_data(const char
     if (!xlu_cfg_get_long(config, "oos", &l))
         c_info->oos = l;
 
-    if (!xlu_cfg_get_string (config, "pool", &buf))
+    if (!xlu_cfg_get_string (config, "pool", &buf)) {
+        c_info->poolid = -1;
         pool_qualifier_to_poolid(buf, &c_info->poolid, NULL);
+    }
     c_info->poolname = libxl_poolid_to_name(&ctx, c_info->poolid);
+    if (!c_info->poolname) {
+        fprintf(stderr, "Illegal pool specified\n");
+        exit(1);
+    }
 
     init_build_info(b_info, c_info);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

      reply	other threads:[~2010-05-11  5:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07  8:14 [Patch] support cpupool for xl create Juergen Gross
2010-05-07 21:57 ` Jeremy Fitzhardinge
2010-05-10  6:05   ` Juergen Gross
2010-05-10  6:42     ` Jeremy Fitzhardinge
2010-05-10  6:58       ` Juergen Gross
2010-05-10 20:07         ` Jeremy Fitzhardinge
2010-05-11  5:47           ` Juergen Gross [this message]

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=4BE8EF8F.2080802@ts.fujitsu.com \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=jeremy@goop.org \
    --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.