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

Re: [Xen-devel] [PATCH 1/3] RFC: libxl: API changes re domain type (and keyed union semantics)



On Tue, 2011-07-12 at 19:37 +0100, Ian Jackson wrote:
> Give the HVM domain type the name "HVM" as is generally used in the
> Xen universe, rather than "FV" which is not used elsewhere.
> 
> Keyed unions should be keyed off the individual union value, not off
> an arbitrary expression.
> 
> Change the "hvm" field in domain_build_info to be called "type" and
> have an appropriate enum type.

I think this is a good idea.

There is a similar "bool hvm" in libxl_domain_create_info, which I think
should also be changed (it's copied from create_info to build_info in
libxl_init_build_info).

The one in libxl_device_model_info is already correctly typed.

Not directly related to this patch but I've been wondering if the split
between create_info, build_info etc makes sense now that the builder
stuff has been pushed down into libxl itself.

> 
> These are are incompatible changes to the API/ABI.
> 
> THIS PATCH IS AN RFC AND SHOULD NOT BE APPLIED

In case you suffer from a split brain and apply it ;-)

Ian.

> ---
>  tools/libxl/libxl.idl |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl
> index 6e39734..8fb883f 100644
> --- a/tools/libxl/libxl.idl
> +++ b/tools/libxl/libxl.idl
> @@ -21,7 +21,7 @@ libxl_hwcap = Builtin("hwcap")
>  #
>  
>  libxl_domain_type = Enumeration("domain_type", [
> -    (1, "FV"),
> +    (1, "HVM"),
>      (2, "PV"),
>      ])
>  
> @@ -158,9 +158,9 @@ libxl_domain_build_info = Struct("domain_build_info",[
>      ("shadow_memkb",    uint32),
>      ("disable_migrate", bool),
>      ("cpuid",           libxl_cpuid_policy_list),
> -    ("hvm",             bool),
> -    ("u", KeyedUnion(None, "hvm",
> -                [("hvm", "%s", Struct(None,
> +    ("type",            libxl_domain_type),
> +    ("u", KeyedUnion(None, "type",
> +                [("hvm", Struct(None,
>                                         [("firmware", string),
>                                          ("pae", bool),
>                                          ("apic", bool),
> @@ -173,7 +173,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>                                          ("timer_mode", integer),
>                                          ("nested_hvm", bool),
>                                          ])),
> -                 ("pv", "!%s", Struct(None,
> +                 ("pv", Struct(None,
>                                         [("kernel", libxl_file_reference),
>                                          ("slack_memkb", uint32),
>                                          ("bootloader", string),



_______________________________________________
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®.