diff mbox series

[Xen-devel,v3,2/3] tools/libxl: Deprecate PV fields kernel, ramdisk, cmdline

Message ID 20181001185721.15467-4-julien.grall@arm.com
State New
Headers show
Series None | expand

Commit Message

Julien Grall Oct. 1, 2018, 6:57 p.m. UTC
The PV fields kernel, ramdisk, cmdline are only there for compatibility
with old toolstack. Instead of manually copying them over to there new
field, use the deprecated_by attribute in the IDL.

Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    Changes in v3:
        - Patch added
---
 tools/libxl/libxl_create.c  | 19 -------------------
 tools/libxl/libxl_types.idl |  6 +++---
 2 files changed, 3 insertions(+), 22 deletions(-)

Comments

Roger Pau Monné Oct. 2, 2018, 8:22 a.m. UTC | #1
On Mon, Oct 01, 2018 at 07:57:19PM +0100, Julien Grall wrote:
> The PV fields kernel, ramdisk, cmdline are only there for compatibility
> with old toolstack. Instead of manually copying them over to there new
> field, use the deprecated_by attribute in the IDL.
> 
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.
Wei Liu Oct. 3, 2018, 10:35 a.m. UTC | #2
On Mon, Oct 01, 2018 at 07:57:19PM +0100, Julien Grall wrote:
> The PV fields kernel, ramdisk, cmdline are only there for compatibility
> with old toolstack. Instead of manually copying them over to there new
> field, use the deprecated_by attribute in the IDL.
> 
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>
diff mbox series

Patch

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 580320d272..fe97eebdea 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -368,25 +368,6 @@  int libxl__domain_build_info_setdefault(libxl__gc *gc,
             b_info->shadow_memkb = 0;
         if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->u.pv.slack_memkb = 0;
-
-        /* For compatibility, fill in b_info->kernel|ramdisk|cmdline
-         * with the value in u.pv, later processing will use
-         * b_info->kernel|ramdisk|cmdline only.
-         * User with old APIs that passes u.pv.kernel|ramdisk|cmdline
-         * is not affected.
-         */
-        if (!b_info->kernel && b_info->u.pv.kernel) {
-            b_info->kernel = b_info->u.pv.kernel;
-            b_info->u.pv.kernel = NULL;
-        }
-        if (!b_info->ramdisk && b_info->u.pv.ramdisk) {
-            b_info->ramdisk = b_info->u.pv.ramdisk;
-            b_info->u.pv.ramdisk = NULL;
-        }
-        if (!b_info->cmdline && b_info->u.pv.cmdline) {
-            b_info->cmdline = b_info->u.pv.cmdline;
-            b_info->u.pv.cmdline = NULL;
-        }
         break;
     case LIBXL_DOMAIN_TYPE_PVH:
         libxl_defbool_setdefault(&b_info->u.pvh.pvshim, false);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 2cceb8c057..3b8f967651 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -588,12 +588,12 @@  libxl_domain_build_info = Struct("domain_build_info",[
                                        ("rdm_mem_boundary_memkb", MemKB),
                                        ("mca_caps",         uint64),
                                        ])),
-                 ("pv", Struct(None, [("kernel", string),
+                 ("pv", Struct(None, [("kernel", string, {'deprecated_by': 'kernel'}),
                                       ("slack_memkb", MemKB),
                                       ("bootloader", string, {'deprecated_by': 'bootloader'}),
                                       ("bootloader_args", libxl_string_list, {'deprecated_by': 'bootloader_args'}),
-                                      ("cmdline", string),
-                                      ("ramdisk", string),
+                                      ("cmdline", string, {'deprecated_by': 'cmdline'}),
+                                      ("ramdisk", string, {'deprecated_by': 'ramdisk'}),
                                       ("features", string, {'const': True}),
                                       # Use host's E820 for PCI passthrough.
                                       ("e820_host", libxl_defbool),