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

Re: [Xen-devel] [PATCH v3 04/17] libxl: Allow running qemu-xen in stubdomain



On Mon, Jan 28, 2019 at 10:30:21PM +0100, Marek Marczykowski-Górecki wrote:
> Do not prohibit anymore using stubdomain with qemu-xen.
> To help distingushing MiniOS and Linux stubdomain, add helper inline
> functions libxl__stubdomain_is_linux() and
> libxl__stubdomain_is_linux_running(). Those should be used where really
> the difference is about MiniOS/Linux, not qemu-xen/qemu-xen-traditional.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
> 
> ---
> Changes in v3:
>  - new patch, instead of "libxl: Add "stubdomain_version" to
>  domain_build_info"
>  - helper functions as suggested by Ian Jackson
> ---
>  tools/libxl/libxl_create.c   |  9 ---------
>  tools/libxl/libxl_internal.h | 17 +++++++++++++++++
>  2 files changed, 17 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index a4e74a5..bb62542 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -160,15 +160,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>          }
>      }
>  
> -    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
> -        b_info->device_model_version !=
> -            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
> -        libxl_defbool_val(b_info->device_model_stubdomain)) {
> -        LOG(ERROR,
> -            "device model stubdomains require \"qemu-xen-traditional\"");
> -        return ERROR_INVAL;
> -    }
> -
>      if (!b_info->max_vcpus)
>          b_info->max_vcpus = 1;
>      if (!b_info->avail_vcpus.size) {
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 459f9bf..b8c698a 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -2195,6 +2195,23 @@ _hidden int 
> libxl__device_model_version_running(libxl__gc *gc, uint32_t domid);
>    /* Return the system-wide default device model */
>  _hidden libxl_device_model_version libxl__default_device_model(libxl__gc 
> *gc);
>  
> +static inline
> +bool libxl__stubdomain_is_linux_running(libxl__gc *gc, uint32_t domid)
> +{
> +    /* same logic as in libxl__stubdomain_is_linux */
> +    return libxl__device_model_version_running(gc, domid)
> +        == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;

I don't think the logic is accurate. You're precluding running
qemu-xen in a unikernel as stubdom.

I think putting an extra key in xenstore with the underlying platform is
more desirable.

> +}
> +
> +static inline
> +bool libxl__stubdomain_is_linux(libxl_domain_build_info *b_info)
> +{
> +    /* right now qemu-tranditional implies MiniOS stubdomain and qemu-xen
> +     * implies Linux stubdomain */
> +    return libxl_defbool_val(b_info->device_model_stubdomain) &&
> +        b_info->device_model_version == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;

Subsequently you will need a new field in b_info.

What do you think?

Wei.

> +}
> +
>  #define DEVICE_MODEL_XS_PATH(gc, dm_domid, domid, fmt, _a...)              \
>      libxl__sprintf(gc, "/local/domain/%u/device-model/%u" fmt, dm_domid,   \
>                     domid, ##_a)
> -- 
> git-series 0.9.1

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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