]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen-traditional.git/commitdiff
Switch from xc_{set,get}_hvm_param to xc_hvm_param_{set,get}
authorIan Campbell <ian.campbell@citrix.com>
Thu, 28 Jan 2016 15:02:01 +0000 (15:02 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 28 Jan 2016 15:30:38 +0000 (15:30 +0000)
The former have been deprecated for some time (they take unsigned
longs, not uint64_t's, and therefore risk truncation for some params)
and I'm about to remove them.

Since _get takes a uint64_t * for the output instead of an unsigned
long * it is necessary to change the types of a few variables. I
checked each case would be OK with it and either the variable is
already downcast (to something like a uint32_t) when it is
subsequently used or it was used as a wider type already (so this
change might resolve a latent bug under some circumstances?).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
hw/pc.c
hw/piix4acpi.c
hw/xen_machine_fv.c
i386-dm/helper2.c

diff --git a/hw/pc.c b/hw/pc.c
index 09b4af472ab126e67329174d10c25b30623d9c1e..572c72b567e10df2c36681c954a38a04082a1055 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -573,7 +573,7 @@ static void load_linux(uint8_t *option_rom,
     uint16_t seg[6];
     uint16_t real_seg;
     int setup_size, kernel_size, initrd_size, cmdline_size;
-    unsigned long end_low_ram;
+    uint64_t end_low_ram;
     uint32_t initrd_max;
     uint8_t header[1024];
     target_phys_addr_t real_addr, prot_addr, cmdline_addr, initrd_addr;
@@ -629,7 +629,7 @@ static void load_linux(uint8_t *option_rom,
 
     /* Special pages are placed at end of low RAM: pick an arbitrary one and
      * subtract a suitably large amount of padding (64kB) to skip BIOS data. */
-    xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFIOREQ_PFN, &end_low_ram);
+    xc_hvm_param_get(xc_handle, domid, HVM_PARAM_BUFIOREQ_PFN, &end_low_ram);
     end_low_ram = (end_low_ram << 12) - (64*1024);
 
     /* highest address for loading the initrd */
index ddbe8e064d24dfeb251aede41b9b92a339475711..1471c56895c97c488daf226a8581fca67e8e195d 100644 (file)
@@ -206,7 +206,7 @@ static void acpi_shutdown(uint32_t val)
         qemu_system_reset();
         s3_shutdown_flag = 0;
         cmos_set_s3_resume();
-        xc_set_hvm_param(xc_handle, domid, HVM_PARAM_ACPI_S_STATE, 3);
+        xc_hvm_param_set(xc_handle, domid, HVM_PARAM_ACPI_S_STATE, 3);
         break;
     case SLP_TYP_S4_V0:
     case SLP_TYP_S5_V0:
index b385d6a55d27a007b13c5a5c54583eedb837716c..8dbae782e7880b60f3c52cbf13131e8838cf524c 100644 (file)
@@ -277,7 +277,7 @@ static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
                         const char *initrd_filename, const char *cpu_model,
                         const char *direct_pci)
 {
-    unsigned long ioreq_pfn;
+    uint64_t ioreq_pfn;
     extern void *shared_page;
     extern void *buffered_io_page;
 #ifdef __ia64__
@@ -296,10 +296,10 @@ static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
 #endif
 
 #ifdef CONFIG_STUBDOM /* the hvmop is not supported on older hypervisors */
-    xc_set_hvm_param(xc_handle, domid, HVM_PARAM_DM_DOMAIN, DOMID_SELF);
+    xc_hvm_param_set(xc_handle, domid, HVM_PARAM_DM_DOMAIN, DOMID_SELF);
 #endif
-    xc_get_hvm_param(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
-    fprintf(logfile, "shared page at pfn %lx\n", ioreq_pfn);
+    xc_hvm_param_get(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
+    fprintf(logfile, "shared page at pfn %"PRIx64"\n", ioreq_pfn);
     shared_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE,
                                        PROT_READ|PROT_WRITE, ioreq_pfn);
     if (shared_page == NULL) {
@@ -307,8 +307,8 @@ static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
         exit(-1);
     }
 
-    xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFIOREQ_PFN, &ioreq_pfn);
-    fprintf(logfile, "buffered io page at pfn %lx\n", ioreq_pfn);
+    xc_hvm_param_get(xc_handle, domid, HVM_PARAM_BUFIOREQ_PFN, &ioreq_pfn);
+    fprintf(logfile, "buffered io page at pfn %"PRIx64"\n", ioreq_pfn);
     buffered_io_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE,
                                             PROT_READ|PROT_WRITE, ioreq_pfn);
     if (buffered_io_page == NULL) {
@@ -317,8 +317,8 @@ static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
     }
 
 #if defined(__ia64__)
-    xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFPIOREQ_PFN, &ioreq_pfn);
-    fprintf(logfile, "buffered pio page at pfn %lx\n", ioreq_pfn);
+    xc_hvm_param_get(xc_handle, domid, HVM_PARAM_BUFPIOREQ_PFN, &ioreq_pfn);
+    fprintf(logfile, "buffered pio page at pfn %"PRIx64"\n", ioreq_pfn);
     buffered_pio_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE,
                                             PROT_READ|PROT_WRITE, ioreq_pfn);
     if (buffered_pio_page == NULL) {
index 2706f2eb070bdd84afdab3ee45313dabeeb778db..8c61a243f5fd2cb348c65da935cd9cbfcbb15989 100644 (file)
@@ -120,7 +120,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
     CPUX86State *env;
     static int inited;
     int i, rc;
-    unsigned long bufioreq_evtchn;
+    uint64_t bufioreq_evtchn;
 
     env = qemu_mallocz(sizeof(CPUX86State));
     if (!env)
@@ -158,7 +158,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
             }
             ioreq_local_port[i] = rc;
         }
-        rc = xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFIOREQ_EVTCHN,
+        rc = xc_hvm_param_get(xc_handle, domid, HVM_PARAM_BUFIOREQ_EVTCHN,
                 &bufioreq_evtchn);
         if (rc < 0) {
             fprintf(logfile, "failed to get HVM_PARAM_BUFIOREQ_EVTCHN error=%d\n",