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

Re: [XEN][RFC PATCH v3 14/14] tools/xl: Add new xl command overlay for device tree overlay support


  • To: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 15 Mar 2022 12:11:35 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TVAmjpd1CCzL+Vp50+ccT1pWv7M3Arh/X4BNW9B9INQ=; b=ckpGAo2phJBxAXlAoNppq58KWhalCTDoIS6GeVJIR2jR+IMOvZgbl64z5xdj5qe2NwpuUYzN0pKBCbAYLSnZk2+ycv9dX3XWVVsJx/E45etljzMLbQGd7HZrn2Tn1IJRT4pP0H7NARFTBzKf8CnBJ6K0v3HqqWj5D3sCnwpZX4gDlZqrynSEatNdh8InBpbv/xLTTcvbood/TdtIAeq/z+40eSplZATPysu5dgpSntTD89k6eQdazl/N8vbz1kL9hpFYyrBxLnWeTteb5lFAonYKS9DaUso1ayr2Rj7v6f4VUgZcSd2tC8h08UNS2ovbLJ8qoi396OoQuyMFmA7xOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jtUonbrhGejQco+4M1MWMGeg6RiecHgeuP0SpJeciYifmRQ7CrExzBjsLABzVaO3BvGhRsqGPLoH7VUh2678fGLCQPbZLe1WVFQ0vG8nPya7Sv+9If53/DXDd4tWgFqkAfGMndQfE8pFNp5hsZfOwl78W3cCz0Vj1JPB/SO0k0Ycc/j4ySlkQc0j7FRUICcHcw/baKKfHejBjHHGG7T1j3071gEtF+EY+bDDN/619Mx6n0aFBtlTvUhJbUG1ySrk+mu6qnm6TA3B3ys/LIWDb5zP2XFvS1xCTUUMZD2rDxmlE8LG8EYzfr59AlfrDigQ9Fp4uyOvU5CpCP30PwIZFQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "volodymyr_babchuk@xxxxxxxx" <volodymyr_babchuk@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Tue, 15 Mar 2022 12:12:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYMyV7Tz8Y/V6GBEKWpNuLuSXXYKzAZVaA
  • Thread-topic: [XEN][RFC PATCH v3 14/14] tools/xl: Add new xl command overlay for device tree overlay support


> On 8 Mar 2022, at 19:47, Vikram Garhwal <fnu.vikram@xxxxxxxxxx> wrote:
> 
> Signed-off-by: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
> ---
> tools/xl/xl.h           |  4 ++++
> tools/xl/xl_cmdtable.c  |  6 ++++++
> tools/xl/xl_vmcontrol.c | 45 +++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 55 insertions(+)
> 
> diff --git a/tools/xl/xl.h b/tools/xl/xl.h
> index c5c4bedbdd..604fd5bb94 100644
> --- a/tools/xl/xl.h
> +++ b/tools/xl/xl.h
> @@ -97,6 +97,9 @@ struct save_file_header {
> 
> #define SAVEFILE_BYTEORDER_VALUE ((uint32_t)0x01020304UL)
> 
> +#define XL_DT_OVERLAY_ADD                   1
> +#define XL_DT_OVERLAY_REMOVE                2

Maybe you can get rid of them and ...

> +
> void save_domain_core_begin(uint32_t domid,
>                             int preserve_domid,
>                             const char *override_config_file,
> @@ -139,6 +142,7 @@ int main_shutdown(int argc, char **argv);
> int main_reboot(int argc, char **argv);
> int main_list(int argc, char **argv);
> int main_vm_list(int argc, char **argv);
> +int main_dt_overlay(int argc, char **argv);
> int main_create(int argc, char **argv);
> int main_config_update(int argc, char **argv);
> int main_button_press(int argc, char **argv);
> diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
> index 661323d488..5812d19db8 100644
> --- a/tools/xl/xl_cmdtable.c
> +++ b/tools/xl/xl_cmdtable.c
> @@ -20,6 +20,12 @@
> #include "xl.h"
> 
> const struct cmd_spec cmd_table[] = {
> +    { "overlay",
> +      &main_dt_overlay, 1, 1,
> +      "Add/Remove a device tree overlay",
> +      "add/remove <.dtbo>"
> +      "-h print this help\n"
> +    },
>     { "create",
>       &main_create, 1, 1,
>       "Create a domain from config file <filename>",
> diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
> index 435155a033..76b969dc33 100644
> --- a/tools/xl/xl_vmcontrol.c
> +++ b/tools/xl/xl_vmcontrol.c
> @@ -1262,6 +1262,51 @@ int main_create(int argc, char **argv)
>     return 0;
> }
> 
> +int main_dt_overlay(int argc, char **argv)
> +{
> +    const char *overlay_ops = argv[1];
> +    const char *overlay_config_file = argv[2];
> +    void *overlay_dtb = NULL;
> +    int rc;
> +    uint8_t op;
> +    int overlay_dtb_size = 0;
> +
> +    if (overlay_ops == NULL) {
> +        fprintf(stderr, "No overlay operation mode provided\n");
> +        return ERROR_FAIL;
> +    }
> +
> +    if (strcmp(overlay_ops, "add") == 0)
> +        op = XL_DT_OVERLAY_ADD;
> +    else if (strcmp(overlay_ops, "remove") == 0)
> +        op = XL_DT_OVERLAY_REMOVE;

Use them there, maybe defining const int <name> = <value>

Since these values are only used there





 


Rackspace

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