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

[Xen-devel] Reading GIC version from domU cfg file



Hi,

I made below changes to xl tools to read gic_version from domU cfg file.
But I I always get read 0 when I print d_config->num_gic_version.

I have set gic version as below in cfg file

gic_version= [ "2" ]

Can you please let me know If I got this correct or not?

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 81b472c..029cb42 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -898,6 +898,26 @@ static void initiate_domain_create(libxl__egc *egc,
         }
     }

+    LOG(DEBUG, "DOM CONFIG num_gic %d \n", d_config->num_gic_version);
+    state->gic_info = libxl__calloc(gc, sizeof(*state->gic_info),
d_config->num_gic_version);
+    if (d_config->num_gic_version)
+    {
+        LOG(DEBUG, "DOM CONFIG GIC %d\n", d_config->gic_version->version);
+        state->gic_info->version = d_config->gic_version->version;
+    }
+    else
+    {
+        //ret = libxl__device_dt_get_gic_info(gc,
&d_config->gic_info, &state->gic_info);
+        state->gic_info->version = 3;
+        LOG(DEBUG, "DOM CONFIG GIC NOT SET Read %d\n",
state->gic_info->version);
+    }
+
     if (restore_fd >= 0) {
         LOG(DEBUG, "restoring, not running bootloader");
         domcreate_bootloader_done(egc, &dcs->bl, 0);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 7da2280..7e4fc0c 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -965,6 +965,11 @@ typedef struct {
     const libxl_device_dtdev *conf;
 } libxl__dtdev_info;

+/* GIC information */
+typedef struct {
+    uint8_t version;
+} libxl__gic_info;
+
/* from xl_dom */
 _hidden libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__domain_shutdown_reason(libxl__gc *gc, uint32_t domid);
@@ -993,6 +998,8 @@ typedef struct {

     int num_dtdevs;
     libxl__dtdev_info *dtdevs_info;
+    int num_gic_version;
+    libxl__gic_info *gic_info;
 } libxl__domain_build_state;

 _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index e93dbfa..8df06f5 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -487,6 +487,9 @@ libxl_device_pci = Struct("device_pci", [
 libxl_device_dtdev = Struct("device_dtdev", [
     ("path", string),
     ])
+libxl_device_gic_version = Struct("device_gic_version", [
+    ("version", uint8),
+    ])

 libxl_device_vtpm = Struct("device_vtpm", [
     ("backend_domid",    libxl_domid),
@@ -503,6 +506,7 @@ libxl_domain_config = Struct("domain_config", [
     ("nics", Array(libxl_device_nic, "num_nics")),
     ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
     ("dtdevs", Array(libxl_device_dtdev, "num_dtdevs")),
+    ("gic_version", Array(libxl_device_gic_version, "num_gic_version")),
     ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
     ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
     ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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