All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xl: obey uuid config option
@ 2010-08-25 18:41 Gianni Tedesco
  2010-08-26  8:44 ` Owen Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Gianni Tedesco @ 2010-08-25 18:41 UTC (permalink / raw)
  To: Xen Devel; +Cc: Ian Jackson, Stefano Stabellini

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>

diff -r fd38d1c9f5ac tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Aug 25 19:39:05 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Wed Aug 25 19:44:33 2010 +0100
@@ -607,7 +607,11 @@ static void parse_config_data(const char
         c_info->name = strdup(buf);
     else
         c_info->name = "test";
-    libxl_uuid_generate(&c_info->uuid);
+
+    if (!xlu_cfg_get_string (config, "uuid", &buf))
+        libxl_uuid_from_string(&c_info->uuid, buf);
+    else
+        libxl_uuid_generate(&c_info->uuid);
 
     if (!xlu_cfg_get_long(config, "oos", &l))
         c_info->oos = l;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] xl: obey uuid config option
  2010-08-25 18:41 [PATCH] xl: obey uuid config option Gianni Tedesco
@ 2010-08-26  8:44 ` Owen Smith
  2010-08-27 11:40   ` Stefano Stabellini
  2010-08-27 13:50   ` Gianni Tedesco
  0 siblings, 2 replies; 4+ messages in thread
From: Owen Smith @ 2010-08-26  8:44 UTC (permalink / raw)
  To: Gianni Tedesco (3P), Xen Devel; +Cc: Ian Jackson, Stefano Stabellini

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

What should the behaviour be if the uuid config option is a valid string but an invalid format?

-----Original Message-----
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Gianni Tedesco
Sent: 25 August 2010 19:42
To: Xen Devel
Cc: Ian Jackson; Stefano Stabellini
Subject: [Xen-devel] [PATCH] xl: obey uuid config option

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>

diff -r fd38d1c9f5ac tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Aug 25 19:39:05 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Wed Aug 25 19:44:33 2010 +0100
@@ -607,7 +607,11 @@ static void parse_config_data(const char
         c_info->name = strdup(buf);
     else
         c_info->name = "test";
-    libxl_uuid_generate(&c_info->uuid);
+
+    if (!xlu_cfg_get_string (config, "uuid", &buf))
+        libxl_uuid_from_string(&c_info->uuid, buf);
+    else
+        libxl_uuid_generate(&c_info->uuid);
 
     if (!xlu_cfg_get_long(config, "oos", &l))
         c_info->oos = l;



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

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] xl: obey uuid config option
  2010-08-26  8:44 ` Owen Smith
@ 2010-08-27 11:40   ` Stefano Stabellini
  2010-08-27 13:50   ` Gianni Tedesco
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2010-08-27 11:40 UTC (permalink / raw)
  To: Owen Smith
  Cc: Xen Devel, Ian Jackson, Gianni Tedesco (3P), Stefano Stabellini

On Thu, 26 Aug 2010, Owen Smith wrote:
> What should the behaviour be if the uuid config option is a valid string but an invalid format?
> 

good point.
We need to check the return value of libxl_uuid_from_string and act
accordingly.

> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Gianni Tedesco
> Sent: 25 August 2010 19:42
> To: Xen Devel
> Cc: Ian Jackson; Stefano Stabellini
> Subject: [Xen-devel] [PATCH] xl: obey uuid config option
> 
> Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
> 
> diff -r fd38d1c9f5ac tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c	Wed Aug 25 19:39:05 2010 +0100
> +++ b/tools/libxl/xl_cmdimpl.c	Wed Aug 25 19:44:33 2010 +0100
> @@ -607,7 +607,11 @@ static void parse_config_data(const char
>          c_info->name = strdup(buf);
>      else
>          c_info->name = "test";
> -    libxl_uuid_generate(&c_info->uuid);
> +
> +    if (!xlu_cfg_get_string (config, "uuid", &buf))
> +        libxl_uuid_from_string(&c_info->uuid, buf);
> +    else
> +        libxl_uuid_generate(&c_info->uuid);
>  
>      if (!xlu_cfg_get_long(config, "oos", &l))
>          c_info->oos = l;
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] xl: obey uuid config option
  2010-08-26  8:44 ` Owen Smith
  2010-08-27 11:40   ` Stefano Stabellini
@ 2010-08-27 13:50   ` Gianni Tedesco
  1 sibling, 0 replies; 4+ messages in thread
From: Gianni Tedesco @ 2010-08-27 13:50 UTC (permalink / raw)
  To: Owen Smith; +Cc: Xen Devel, Ian Jackson, Stefano Stabellini

On Thu, 2010-08-26 at 09:44 +0100, Owen Smith wrote:
> What should the behaviour be if the uuid config option is a valid
> string but an invalid format?

Yes, this is indeed an error. Interestingly our uuid parsing API
provides no return value whatsoever. This is interesting because it was
lifted wholesale from blktap2 so this error may exist elsewhere.

I will need to re-do the random UUID's patch before re-basing this one
and fixing it.

It's always the simplest seeming patches which take the longest eh :)

Gianni

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-27 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-25 18:41 [PATCH] xl: obey uuid config option Gianni Tedesco
2010-08-26  8:44 ` Owen Smith
2010-08-27 11:40   ` Stefano Stabellini
2010-08-27 13:50   ` Gianni Tedesco

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.