diff options
author | Ewan Mellor <ewan@xensource.com> | 2006-12-14 18:24:14 +0000 |
---|---|---|
committer | Ewan Mellor <ewan@xensource.com> | 2006-12-14 18:24:14 +0000 |
commit | 184500f7fc7fd3cd61365d9d6770b74ff971c2e9 (patch) | |
tree | 459a21c1ef802136f80eaa47653c6bda60bf2fba /tools/libxen | |
parent | a7416ebe65679cab912c2d0f6f1f70f11669e0a2 (diff) | |
download | xen-184500f7fc7fd3cd61365d9d6770b74ff971c2e9.tar.gz xen-184500f7fc7fd3cd61365d9d6770b74ff971c2e9.tar.bz2 xen-184500f7fc7fd3cd61365d9d6770b74ff971c2e9.zip |
Implement new booting parameters for Xen-API, and backwards compatibility for
the old bootloader settings.
We now have two mutually exclusive config groups HVM and PV, with HVM/boot
and PV/{bootloader,kernel,ramdisk,args,bootloader_args}.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen')
-rw-r--r-- | tools/libxen/include/xen_vm.h | 155 | ||||
-rw-r--r-- | tools/libxen/src/xen_vm.c | 227 |
2 files changed, 178 insertions, 204 deletions
diff --git a/tools/libxen/include/xen_vm.h b/tools/libxen/include/xen_vm.h index 02ae5220cd..5287be5873 100644 --- a/tools/libxen/include/xen_vm.h +++ b/tools/libxen/include/xen_vm.h @@ -19,7 +19,6 @@ #ifndef XEN_VM_H #define XEN_VM_H -#include "xen_boot_type.h" #include "xen_common.h" #include "xen_console_decl.h" #include "xen_cpu_feature.h" @@ -36,9 +35,36 @@ /* - * The VM class. - * + * The VM class. + * * A virtual machine (or 'guest'). + * + * VM booting is controlled by setting one of the two mutually exclusive + * groups: "PV", and "HVM". If HVM.boot is the empty string, then paravirtual + * domain building and booting will be used; otherwise the VM will be loaded + * as an HVM domain, and booted using an emulated BIOS. + * + * When paravirtual booting is in use, the PV/bootloader field indicates the + * bootloader to use. It may be "pygrub", in which case the platform's + * default installation of pygrub will be used, or a full path within the + * control domain to some other bootloader. The other fields, PV/kernel, + * PV/ramdisk, PV/args and PV/bootloader_args will be passed to the bootloader + * unmodified, and interpretation of those fields is then specific to the + * bootloader itself, including the possibility that the bootloader will + * ignore some or all of those given values. + * + * If the bootloader is pygrub, then the menu.lst is parsed if present in the + * guest's filesystem, otherwise the specified kernel and ramdisk are used, or + * an autodetected kernel is used if nothing is specified and autodetection is + * possible. PV/args is appended to the kernel command line, no matter which + * mechanism is used for finding the kernel. + * + * If PV/bootloader is empty but PV/kernel is specified, then the kernel and + * ramdisk values will be treated as paths within the control domain. If both + * PV/bootloader and PV/kernel are empty, then the behaviour is as if + * PV/bootloader was specified as "pygrub". + * + * When using HVM booting, HVM/boot specifies the order of the boot devices. */ @@ -102,18 +128,17 @@ typedef struct xen_vm_record struct xen_vif_record_opt_set *vifs; struct xen_vbd_record_opt_set *vbds; struct xen_vtpm_record_opt_set *vtpms; - char *bios_boot; + char *pv_bootloader; + char *pv_kernel; + char *pv_ramdisk; + char *pv_args; + char *pv_bootloader_args; + char *hvm_boot; bool platform_std_vga; char *platform_serial; bool platform_localtime; bool platform_clock_offset; bool platform_enable_audio; - char *builder; - enum xen_boot_type boot_method; - char *kernel_kernel; - char *kernel_initrd; - char *kernel_args; - char *grub_cmdline; char *pci_bus; xen_string_string_map *tools_version; xen_string_string_map *otherconfig; @@ -439,87 +464,80 @@ xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm); /** - * Get the bios/boot field of the given VM. + * Get the PV/bootloader field of the given VM. */ extern bool -xen_vm_get_bios_boot(xen_session *session, char **result, xen_vm vm); +xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm); /** - * Get the platform/std_VGA field of the given VM. + * Get the PV/kernel field of the given VM. */ extern bool -xen_vm_get_platform_std_vga(xen_session *session, bool *result, xen_vm vm); +xen_vm_get_pv_kernel(xen_session *session, char **result, xen_vm vm); /** - * Get the platform/serial field of the given VM. + * Get the PV/ramdisk field of the given VM. */ extern bool -xen_vm_get_platform_serial(xen_session *session, char **result, xen_vm vm); +xen_vm_get_pv_ramdisk(xen_session *session, char **result, xen_vm vm); /** - * Get the platform/localtime field of the given VM. + * Get the PV/args field of the given VM. */ extern bool -xen_vm_get_platform_localtime(xen_session *session, bool *result, xen_vm vm); +xen_vm_get_pv_args(xen_session *session, char **result, xen_vm vm); /** - * Get the platform/clock_offset field of the given VM. + * Get the PV/bootloader_args field of the given VM. */ extern bool -xen_vm_get_platform_clock_offset(xen_session *session, bool *result, xen_vm vm); +xen_vm_get_pv_bootloader_args(xen_session *session, char **result, xen_vm vm); /** - * Get the platform/enable_audio field of the given VM. + * Get the HVM/boot field of the given VM. */ extern bool -xen_vm_get_platform_enable_audio(xen_session *session, bool *result, xen_vm vm); +xen_vm_get_hvm_boot(xen_session *session, char **result, xen_vm vm); /** - * Get the builder field of the given VM. - */ -extern bool -xen_vm_get_builder(xen_session *session, char **result, xen_vm vm); - - -/** - * Get the boot_method field of the given VM. + * Get the platform/std_VGA field of the given VM. */ extern bool -xen_vm_get_boot_method(xen_session *session, enum xen_boot_type *result, xen_vm vm); +xen_vm_get_platform_std_vga(xen_session *session, bool *result, xen_vm vm); /** - * Get the kernel/kernel field of the given VM. + * Get the platform/serial field of the given VM. */ extern bool -xen_vm_get_kernel_kernel(xen_session *session, char **result, xen_vm vm); +xen_vm_get_platform_serial(xen_session *session, char **result, xen_vm vm); /** - * Get the kernel/initrd field of the given VM. + * Get the platform/localtime field of the given VM. */ extern bool -xen_vm_get_kernel_initrd(xen_session *session, char **result, xen_vm vm); +xen_vm_get_platform_localtime(xen_session *session, bool *result, xen_vm vm); /** - * Get the kernel/args field of the given VM. + * Get the platform/clock_offset field of the given VM. */ extern bool -xen_vm_get_kernel_args(xen_session *session, char **result, xen_vm vm); +xen_vm_get_platform_clock_offset(xen_session *session, bool *result, xen_vm vm); /** - * Get the grub/cmdline field of the given VM. + * Get the platform/enable_audio field of the given VM. */ extern bool -xen_vm_get_grub_cmdline(xen_session *session, char **result, xen_vm vm); +xen_vm_get_platform_enable_audio(xen_session *session, bool *result, xen_vm vm); /** @@ -688,87 +706,80 @@ xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_cras /** - * Set the bios/boot field of the given VM. + * Set the PV/bootloader field of the given VM. */ extern bool -xen_vm_set_bios_boot(xen_session *session, xen_vm vm, char *boot); +xen_vm_set_pv_bootloader(xen_session *session, xen_vm vm, char *bootloader); /** - * Set the platform/std_VGA field of the given VM. + * Set the PV/kernel field of the given VM. */ extern bool -xen_vm_set_platform_std_vga(xen_session *session, xen_vm vm, bool std_vga); +xen_vm_set_pv_kernel(xen_session *session, xen_vm vm, char *kernel); /** - * Set the platform/serial field of the given VM. + * Set the PV/ramdisk field of the given VM. */ extern bool -xen_vm_set_platform_serial(xen_session *session, xen_vm vm, char *serial); +xen_vm_set_pv_ramdisk(xen_session *session, xen_vm vm, char *ramdisk); /** - * Set the platform/localtime field of the given VM. + * Set the PV/args field of the given VM. */ extern bool -xen_vm_set_platform_localtime(xen_session *session, xen_vm vm, bool localtime); +xen_vm_set_pv_args(xen_session *session, xen_vm vm, char *args); /** - * Set the platform/clock_offset field of the given VM. + * Set the PV/bootloader_args field of the given VM. */ extern bool -xen_vm_set_platform_clock_offset(xen_session *session, xen_vm vm, bool clock_offset); +xen_vm_set_pv_bootloader_args(xen_session *session, xen_vm vm, char *bootloader_args); /** - * Set the platform/enable_audio field of the given VM. + * Set the HVM/boot field of the given VM. */ extern bool -xen_vm_set_platform_enable_audio(xen_session *session, xen_vm vm, bool enable_audio); +xen_vm_set_hvm_boot(xen_session *session, xen_vm vm, char *boot); /** - * Set the builder field of the given VM. - */ -extern bool -xen_vm_set_builder(xen_session *session, xen_vm vm, char *builder); - - -/** - * Set the boot_method field of the given VM. + * Set the platform/std_VGA field of the given VM. */ extern bool -xen_vm_set_boot_method(xen_session *session, xen_vm vm, enum xen_boot_type boot_method); +xen_vm_set_platform_std_vga(xen_session *session, xen_vm vm, bool std_vga); /** - * Set the kernel/kernel field of the given VM. + * Set the platform/serial field of the given VM. */ extern bool -xen_vm_set_kernel_kernel(xen_session *session, xen_vm vm, char *kernel); +xen_vm_set_platform_serial(xen_session *session, xen_vm vm, char *serial); /** - * Set the kernel/initrd field of the given VM. + * Set the platform/localtime field of the given VM. */ extern bool -xen_vm_set_kernel_initrd(xen_session *session, xen_vm vm, char *initrd); +xen_vm_set_platform_localtime(xen_session *session, xen_vm vm, bool localtime); /** - * Set the kernel/args field of the given VM. + * Set the platform/clock_offset field of the given VM. */ extern bool -xen_vm_set_kernel_args(xen_session *session, xen_vm vm, char *args); +xen_vm_set_platform_clock_offset(xen_session *session, xen_vm vm, bool clock_offset); /** - * Set the grub/cmdline field of the given VM. + * Set the platform/enable_audio field of the given VM. */ extern bool -xen_vm_set_grub_cmdline(xen_session *session, xen_vm vm, char *cmdline); +xen_vm_set_platform_enable_audio(xen_session *session, xen_vm vm, bool enable_audio); /** @@ -814,8 +825,8 @@ xen_vm_unpause(xen_session *session, xen_vm vm); /** * Attempt to cleanly shutdown the specified VM. (Note: this may not be - * supported---e.g. if a guest agent is not installed). - * + * supported---e.g. if a guest agent is not installed). + * * Once shutdown has been completed perform poweroff action specified in guest * configuration. */ @@ -825,8 +836,8 @@ xen_vm_clean_shutdown(xen_session *session, xen_vm vm); /** * Attempt to cleanly shutdown the specified VM (Note: this may not be - * supported---e.g. if a guest agent is not installed). - * + * supported---e.g. if a guest agent is not installed). + * * Once shutdown has been completed perform reboot action specified in guest * configuration. */ diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c index bffab2bab9..1914b86959 100644 --- a/tools/libxen/src/xen_vm.c +++ b/tools/libxen/src/xen_vm.c @@ -20,7 +20,6 @@ #include <stddef.h> #include <stdlib.h> -#include "xen_boot_type_internal.h" #include "xen_common.h" #include "xen_console.h" #include "xen_cpu_feature.h" @@ -136,9 +135,24 @@ static const struct_member xen_vm_record_struct_members[] = { .key = "VTPMs", .type = &abstract_type_ref_set, .offset = offsetof(xen_vm_record, vtpms) }, - { .key = "bios_boot", + { .key = "PV_bootloader", .type = &abstract_type_string, - .offset = offsetof(xen_vm_record, bios_boot) }, + .offset = offsetof(xen_vm_record, pv_bootloader) }, + { .key = "PV_kernel", + .type = &abstract_type_string, + .offset = offsetof(xen_vm_record, pv_kernel) }, + { .key = "PV_ramdisk", + .type = &abstract_type_string, + .offset = offsetof(xen_vm_record, pv_ramdisk) }, + { .key = "PV_args", + .type = &abstract_type_string, + .offset = offsetof(xen_vm_record, pv_args) }, + { .key = "PV_bootloader_args", + .type = &abstract_type_string, + .offset = offsetof(xen_vm_record, pv_bootloader_args) }, + { .key = "HVM_boot", + .type = &abstract_type_string, + .offset = offsetof(xen_vm_record, hvm_boot) }, { .key = "platform_std_VGA", .type = &abstract_type_bool, .offset = offsetof(xen_vm_record, platform_std_vga) }, @@ -154,24 +168,6 @@ static const struct_member xen_vm_record_struct_members[] = { .key = "platform_enable_audio", .type = &abstract_type_bool, .offset = offsetof(xen_vm_record, platform_enable_audio) }, - { .key = "builder", - .type = &abstract_type_string, - .offset = offsetof(xen_vm_record, builder) }, - { .key = "boot_method", - .type = &xen_boot_type_abstract_type_, - .offset = offsetof(xen_vm_record, boot_method) }, - { .key = "kernel_kernel", - .type = &abstract_type_string, - .offset = offsetof(xen_vm_record, kernel_kernel) }, - { .key = "kernel_initrd", - .type = &abstract_type_string, - .offset = offsetof(xen_vm_record, kernel_initrd) }, - { .key = "kernel_args", - .type = &abstract_type_string, - .offset = offsetof(xen_vm_record, kernel_args) }, - { .key = "grub_cmdline", - .type = &abstract_type_string, - .offset = offsetof(xen_vm_record, grub_cmdline) }, { .key = "PCI_bus", .type = &abstract_type_string, .offset = offsetof(xen_vm_record, pci_bus) }, @@ -216,13 +212,13 @@ xen_vm_record_free(xen_vm_record *record) xen_vif_record_opt_set_free(record->vifs); xen_vbd_record_opt_set_free(record->vbds); xen_vtpm_record_opt_set_free(record->vtpms); - free(record->bios_boot); + free(record->pv_bootloader); + free(record->pv_kernel); + free(record->pv_ramdisk); + free(record->pv_args); + free(record->pv_bootloader_args); + free(record->hvm_boot); free(record->platform_serial); - free(record->builder); - free(record->kernel_kernel); - free(record->kernel_initrd); - free(record->kernel_args); - free(record->grub_cmdline); free(record->pci_bus); xen_string_string_map_free(record->tools_version); xen_string_string_map_free(record->otherconfig); @@ -786,7 +782,7 @@ xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm) bool -xen_vm_get_bios_boot(xen_session *session, char **result, xen_vm vm) +xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm) { abstract_value param_values[] = { @@ -797,29 +793,13 @@ xen_vm_get_bios_boot(xen_session *session, char **result, xen_vm vm) abstract_type result_type = abstract_type_string; *result = NULL; - XEN_CALL_("VM.get_bios_boot"); - return session->ok; -} - - -bool -xen_vm_get_platform_std_vga(xen_session *session, bool *result, xen_vm vm) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm } - }; - - abstract_type result_type = abstract_type_bool; - - XEN_CALL_("VM.get_platform_std_VGA"); + XEN_CALL_("VM.get_PV_bootloader"); return session->ok; } bool -xen_vm_get_platform_serial(xen_session *session, char **result, xen_vm vm) +xen_vm_get_pv_kernel(xen_session *session, char **result, xen_vm vm) { abstract_value param_values[] = { @@ -830,13 +810,13 @@ xen_vm_get_platform_serial(xen_session *session, char **result, xen_vm vm) abstract_type result_type = abstract_type_string; *result = NULL; - XEN_CALL_("VM.get_platform_serial"); + XEN_CALL_("VM.get_PV_kernel"); return session->ok; } bool -xen_vm_get_platform_localtime(xen_session *session, bool *result, xen_vm vm) +xen_vm_get_pv_ramdisk(xen_session *session, char **result, xen_vm vm) { abstract_value param_values[] = { @@ -844,15 +824,16 @@ xen_vm_get_platform_localtime(xen_session *session, bool *result, xen_vm vm) .u.string_val = vm } }; - abstract_type result_type = abstract_type_bool; + abstract_type result_type = abstract_type_string; - XEN_CALL_("VM.get_platform_localtime"); + *result = NULL; + XEN_CALL_("VM.get_PV_ramdisk"); return session->ok; } bool -xen_vm_get_platform_clock_offset(xen_session *session, bool *result, xen_vm vm) +xen_vm_get_pv_args(xen_session *session, char **result, xen_vm vm) { abstract_value param_values[] = { @@ -860,15 +841,16 @@ xen_vm_get_platform_clock_offset(xen_session *session, bool *result, xen_vm vm) .u.string_val = vm } }; - abstract_type result_type = abstract_type_bool; + abstract_type result_type = abstract_type_string; - XEN_CALL_("VM.get_platform_clock_offset"); + *result = NULL; + XEN_CALL_("VM.get_PV_args"); return session->ok; } bool -xen_vm_get_platform_enable_audio(xen_session *session, bool *result, xen_vm vm) +xen_vm_get_pv_bootloader_args(xen_session *session, char **result, xen_vm vm) { abstract_value param_values[] = { @@ -876,15 +858,16 @@ xen_vm_get_platform_enable_audio(xen_session *session, bool *result, xen_vm vm) .u.string_val = vm } }; - abstract_type result_type = abstract_type_bool; + abstract_type result_type = abstract_type_string; - XEN_CALL_("VM.get_platform_enable_audio"); + *result = NULL; + XEN_CALL_("VM.get_PV_bootloader_args"); return session->ok; } bool -xen_vm_get_builder(xen_session *session, char **result, xen_vm vm) +xen_vm_get_hvm_boot(xen_session *session, char **result, xen_vm vm) { abstract_value param_values[] = { @@ -895,13 +878,13 @@ xen_vm_get_builder(xen_session *session, char **result, xen_vm vm) abstract_type result_type = abstract_type_string; *result = NULL; - XEN_CALL_("VM.get_builder"); + XEN_CALL_("VM.get_HVM_boot"); return session->ok; } bool -xen_vm_get_boot_method(xen_session *session, enum xen_boot_type *result, xen_vm vm) +xen_vm_get_platform_std_vga(xen_session *session, bool *result, xen_vm vm) { abstract_value param_values[] = { @@ -909,16 +892,15 @@ xen_vm_get_boot_method(xen_session *session, enum xen_boot_type *result, xen_vm .u.string_val = vm } }; - abstract_type result_type = xen_boot_type_abstract_type_; - char *result_str = NULL; - XEN_CALL_("VM.get_boot_method"); - *result = xen_boot_type_from_string(session, result_str); + abstract_type result_type = abstract_type_bool; + + XEN_CALL_("VM.get_platform_std_VGA"); return session->ok; } bool -xen_vm_get_kernel_kernel(xen_session *session, char **result, xen_vm vm) +xen_vm_get_platform_serial(xen_session *session, char **result, xen_vm vm) { abstract_value param_values[] = { @@ -929,13 +911,13 @@ xen_vm_get_kernel_kernel(xen_session *session, char **result, xen_vm vm) abstract_type result_type = abstract_type_string; *result = NULL; - XEN_CALL_("VM.get_kernel_kernel"); + XEN_CALL_("VM.get_platform_serial"); return session->ok; } bool -xen_vm_get_kernel_initrd(xen_session *session, char **result, xen_vm vm) +xen_vm_get_platform_localtime(xen_session *session, bool *result, xen_vm vm) { abstract_value param_values[] = { @@ -943,16 +925,15 @@ xen_vm_get_kernel_initrd(xen_session *session, char **result, xen_vm vm) .u.string_val = vm } }; - abstract_type result_type = abstract_type_string; + abstract_type result_type = abstract_type_bool; - *result = NULL; - XEN_CALL_("VM.get_kernel_initrd"); + XEN_CALL_("VM.get_platform_localtime"); return session->ok; } bool -xen_vm_get_kernel_args(xen_session *session, char **result, xen_vm vm) +xen_vm_get_platform_clock_offset(xen_session *session, bool *result, xen_vm vm) { abstract_value param_values[] = { @@ -960,16 +941,15 @@ xen_vm_get_kernel_args(xen_session *session, char **result, xen_vm vm) .u.string_val = vm } }; - abstract_type result_type = abstract_type_string; + abstract_type result_type = abstract_type_bool; - *result = NULL; - XEN_CALL_("VM.get_kernel_args"); + XEN_CALL_("VM.get_platform_clock_offset"); return session->ok; } bool -xen_vm_get_grub_cmdline(xen_session *session, char **result, xen_vm vm) +xen_vm_get_platform_enable_audio(xen_session *session, bool *result, xen_vm vm) { abstract_value param_values[] = { @@ -977,10 +957,9 @@ xen_vm_get_grub_cmdline(xen_session *session, char **result, xen_vm vm) .u.string_val = vm } }; - abstract_type result_type = abstract_type_string; + abstract_type result_type = abstract_type_bool; - *result = NULL; - XEN_CALL_("VM.get_grub_cmdline"); + XEN_CALL_("VM.get_platform_enable_audio"); return session->ok; } @@ -1357,193 +1336,177 @@ xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_cras bool -xen_vm_set_bios_boot(xen_session *session, xen_vm vm, char *boot) +xen_vm_set_pv_bootloader(xen_session *session, xen_vm vm, char *bootloader) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, { .type = &abstract_type_string, - .u.string_val = boot } + .u.string_val = bootloader } }; - xen_call_(session, "VM.set_bios_boot", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_PV_bootloader", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_platform_std_vga(xen_session *session, xen_vm vm, bool std_vga) +xen_vm_set_pv_kernel(xen_session *session, xen_vm vm, char *kernel) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, - { .type = &abstract_type_bool, - .u.bool_val = std_vga } + { .type = &abstract_type_string, + .u.string_val = kernel } }; - xen_call_(session, "VM.set_platform_std_VGA", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_PV_kernel", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_platform_serial(xen_session *session, xen_vm vm, char *serial) +xen_vm_set_pv_ramdisk(xen_session *session, xen_vm vm, char *ramdisk) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, { .type = &abstract_type_string, - .u.string_val = serial } + .u.string_val = ramdisk } }; - xen_call_(session, "VM.set_platform_serial", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_PV_ramdisk", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_platform_localtime(xen_session *session, xen_vm vm, bool localtime) +xen_vm_set_pv_args(xen_session *session, xen_vm vm, char *args) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, - { .type = &abstract_type_bool, - .u.bool_val = localtime } - }; - - xen_call_(session, "VM.set_platform_localtime", param_values, 2, NULL, NULL); - return session->ok; -} - - -bool -xen_vm_set_platform_clock_offset(xen_session *session, xen_vm vm, bool clock_offset) -{ - abstract_value param_values[] = - { { .type = &abstract_type_string, - .u.string_val = vm }, - { .type = &abstract_type_bool, - .u.bool_val = clock_offset } + .u.string_val = args } }; - xen_call_(session, "VM.set_platform_clock_offset", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_PV_args", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_platform_enable_audio(xen_session *session, xen_vm vm, bool enable_audio) +xen_vm_set_pv_bootloader_args(xen_session *session, xen_vm vm, char *bootloader_args) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, - { .type = &abstract_type_bool, - .u.bool_val = enable_audio } + { .type = &abstract_type_string, + .u.string_val = bootloader_args } }; - xen_call_(session, "VM.set_platform_enable_audio", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_PV_bootloader_args", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_builder(xen_session *session, xen_vm vm, char *builder) +xen_vm_set_hvm_boot(xen_session *session, xen_vm vm, char *boot) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, { .type = &abstract_type_string, - .u.string_val = builder } + .u.string_val = boot } }; - xen_call_(session, "VM.set_builder", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_HVM_boot", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_boot_method(xen_session *session, xen_vm vm, enum xen_boot_type boot_method) +xen_vm_set_platform_std_vga(xen_session *session, xen_vm vm, bool std_vga) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, - { .type = &xen_boot_type_abstract_type_, - .u.string_val = xen_boot_type_to_string(boot_method) } + { .type = &abstract_type_bool, + .u.bool_val = std_vga } }; - xen_call_(session, "VM.set_boot_method", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_platform_std_VGA", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_kernel_kernel(xen_session *session, xen_vm vm, char *kernel) +xen_vm_set_platform_serial(xen_session *session, xen_vm vm, char *serial) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, { .type = &abstract_type_string, - .u.string_val = kernel } + .u.string_val = serial } }; - xen_call_(session, "VM.set_kernel_kernel", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_platform_serial", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_kernel_initrd(xen_session *session, xen_vm vm, char *initrd) +xen_vm_set_platform_localtime(xen_session *session, xen_vm vm, bool localtime) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, - { .type = &abstract_type_string, - .u.string_val = initrd } + { .type = &abstract_type_bool, + .u.bool_val = localtime } }; - xen_call_(session, "VM.set_kernel_initrd", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_platform_localtime", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_kernel_args(xen_session *session, xen_vm vm, char *args) +xen_vm_set_platform_clock_offset(xen_session *session, xen_vm vm, bool clock_offset) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, - { .type = &abstract_type_string, - .u.string_val = args } + { .type = &abstract_type_bool, + .u.bool_val = clock_offset } }; - xen_call_(session, "VM.set_kernel_args", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_platform_clock_offset", param_values, 2, NULL, NULL); return session->ok; } bool -xen_vm_set_grub_cmdline(xen_session *session, xen_vm vm, char *cmdline) +xen_vm_set_platform_enable_audio(xen_session *session, xen_vm vm, bool enable_audio) { abstract_value param_values[] = { { .type = &abstract_type_string, .u.string_val = vm }, - { .type = &abstract_type_string, - .u.string_val = cmdline } + { .type = &abstract_type_bool, + .u.bool_val = enable_audio } }; - xen_call_(session, "VM.set_grub_cmdline", param_values, 2, NULL, NULL); + xen_call_(session, "VM.set_platform_enable_audio", param_values, 2, NULL, NULL); return session->ok; } |