tools/libxc: Fix domid parameter types
PATCH 1/1 tools/libxc: Fix domid parameter types
Mixed throughout libxc are uint32_t, int, and domid_t for domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct an INVALID_DOMID constant which works with all of them. (The main problem being that domid_t gets unconditionally zero extended when promoted to int for arithmatic.)
Libxl uses uint32_t consistently everywhere, so alter libxc to match.
---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
--- tools/libxc/include/xc_dom.h | 20 ++--- tools/libxc/include/xenctrl.h | 156 +++++++++++++++++------------------ tools/libxc/include/xenctrl_compat.h | 36 ++++---- tools/libxc/include/xenguest.h | 16 ++-- tools/libxc/xc_altp2m.c | 16 ++-- tools/libxc/xc_core.h | 2 +- tools/libxc/xc_core_arm.c | 2 +- tools/libxc/xc_core_x86.c | 2 +- tools/libxc/xc_cpuid_x86.c | 8 +- tools/libxc/xc_csched.c | 4 +- tools/libxc/xc_csched2.c | 4 +- tools/libxc/xc_devicemodel_compat.c | 32 +++---- tools/libxc/xc_dom_arm.c | 2 +- tools/libxc/xc_dom_boot.c | 16 ++-- tools/libxc/xc_dom_x86.c | 2 +- tools/libxc/xc_domain.c | 104 +++++++++++------------ tools/libxc/xc_evtchn.c | 6 +- tools/libxc/xc_evtchn_compat.c | 4 +- tools/libxc/xc_flask.c | 2 +- tools/libxc/xc_gnttab.c | 8 +- tools/libxc/xc_mem_access.c | 6 +- tools/libxc/xc_mem_paging.c | 16 ++-- tools/libxc/xc_memshr.c | 34 ++++---- tools/libxc/xc_monitor.c | 30 +++---- tools/libxc/xc_nomigrate.c | 4 +- tools/libxc/xc_offline_page.c | 10 +-- tools/libxc/xc_physdev.c | 6 +- tools/libxc/xc_private.c | 10 +-- tools/libxc/xc_private.h | 6 +- tools/libxc/xc_psr.c | 10 +-- tools/libxc/xc_rt.c | 8 +- tools/libxc/xc_sr_common.h | 2 +- tools/libxc/xc_sr_restore.c | 4 +- tools/libxc/xc_suspend.c | 12 +-- tools/libxc/xc_tmem.c | 47 +++++------ tools/libxc/xc_vm_event.c | 4 +- tools/libxc/xg_private.c | 2 +- tools/libxc/xg_private.h | 2 +- 38 files changed, 328 insertions(+), 327 deletions(-)
tools/libxc/include/xc_dom.h +10 -10
@@ -161,12 +161,12 @@ struct xc_dom_image {unsigned long flags;unsigned int console_evtchn;unsigned int xenstore_evtchn; -domid_t console_domid; -domid_t xenstore_domid; +uint32_t console_domid; +uint32_t xenstore_domid;xen_pfn_t shared_info_mfn;xc_interface *xch; -domid_t guest_domid; +uint32_t guest_domid;int claim_enabled;/* 0 by default, 1 enables it */ int xen_version;
@@ -318,23 +318,23 @@ int xc_dom_build_image(struct xc_dom_image *dom);int xc_dom_update_guest_p2m (struct xc_dom_image *dom);int xc_dom_boot_xen_init (struct xc_dom_image *dom,xc_interface *xch, -domid_t domid); +uint32_t domid);int xc_dom_boot_mem_init (struct xc_dom_image *dom);void *xc_dom_boot_domU_map (struct xc_dom_image *dom,xen_pfn_t pfn,xen_pfn_t count);int xc_dom_boot_image (struct xc_dom_image *dom);int xc_dom_compat_check (struct xc_dom_image *dom);int xc_dom_gnttab_init (struct xc_dom_image *dom); -int xc_dom_gnttab_hvm_seed (xc_interface *xch,domid_t domid, +int xc_dom_gnttab_hvm_seed (xc_interface *xch,uint32_t domid,xen_pfn_t console_gmfn,xen_pfn_t xenstore_gmfn, -domid_t console_domid, -domid_t xenstore_domid); -int xc_dom_gnttab_seed (xc_interface *xch,domid_t domid, +uint32_t console_domid, +uint32_t xenstore_domid); +int xc_dom_gnttab_seed (xc_interface *xch,uint32_t domid,xen_pfn_t console_gmfn,xen_pfn_t xenstore_gmfn, -domid_t console_domid, -domid_t xenstore_domid); +uint32_t console_domid, +uint32_t xenstore_domid);bool xc_dom_translated (const struct xc_dom_image *dom);/* --- debugging bits ---------------------------------------------- */
tools/libxc/include/xenctrl.h +78 -78
394 lines not on this page · raw message
tools/libxc/include/xenctrl_compat.h +18 -18
@@ -59,9 +59,9 @@ int xc_evtchn_close(xc_evtchn *xce);int xc_evtchn_fd (xc_evtchn *xce);int xc_evtchn_notify (xc_evtchn *xce,evtchn_port_t port);xc_evtchn_port_or_error_t -xc_evtchn_bind_unbound_port (xc_evtchn *xce,int domid); +xc_evtchn_bind_unbound_port (xc_evtchn *xce,uint32_t domid);xc_evtchn_port_or_error_t -xc_evtchn_bind_interdomain (xc_evtchn *xce,int domid, +xc_evtchn_bind_interdomain (xc_evtchn *xce,uint32_t domid,evtchn_port_t remote_port);xc_evtchn_port_or_error_t xc_evtchn_bind_virq (xc_evtchn *xce,unsigned int virq);
@@ -123,46 +123,46 @@ int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count);#ifdef XC_WANT_COMPAT_DEVICEMODEL_API int xc_hvm_create_ioreq_server ( -xc_interface *xch,domid_t domid,int handle_bufioreq, +xc_interface *xch,uint32_t domid,int handle_bufioreq,ioservid_t *id);int xc_hvm_get_ioreq_server_info ( -xc_interface *xch,domid_t domid,ioservid_t id,xen_pfn_t *ioreq_pfn, +xc_interface *xch,uint32_t domid,ioservid_t id,xen_pfn_t *ioreq_pfn,xen_pfn_t *bufioreq_pfn,evtchn_port_t *bufioreq_port);int xc_hvm_map_io_range_to_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,int is_mmio, +xc_interface *xch,uint32_t domid,ioservid_t id,int is_mmio,uint64_t start,uint64_t end);int xc_hvm_unmap_io_range_from_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,int is_mmio, +xc_interface *xch,uint32_t domid,ioservid_t id,int is_mmio,uint64_t start,uint64_t end);int xc_hvm_map_pcidev_to_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,uint16_t segment, +xc_interface *xch,uint32_t domid,ioservid_t id,uint16_t segment,uint8_t bus,uint8_t device,uint8_t function);int xc_hvm_unmap_pcidev_from_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,uint16_t segment, +xc_interface *xch,uint32_t domid,ioservid_t id,uint16_t segment,uint8_t bus,uint8_t device,uint8_t function);int xc_hvm_destroy_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id); +xc_interface *xch,uint32_t domid,ioservid_t id);int xc_hvm_set_ioreq_server_state ( -xc_interface *xch,domid_t domid,ioservid_t id,int enabled); +xc_interface *xch,uint32_t domid,ioservid_t id,int enabled);int xc_hvm_set_pci_intx_level ( -xc_interface *xch,domid_t domid,uint16_t segment,uint8_t bus, +xc_interface *xch,uint32_t domid,uint16_t segment,uint8_t bus,uint8_t device,uint8_t intx,unsigned int level);int xc_hvm_set_isa_irq_level ( -xc_interface *xch,domid_t domid,uint8_t irq,unsigned int level); +xc_interface *xch,uint32_t domid,uint8_t irq,unsigned int level);int xc_hvm_set_pci_link_route ( -xc_interface *xch,domid_t domid,uint8_t link,uint8_t irq); +xc_interface *xch,uint32_t domid,uint8_t link,uint8_t irq);int xc_hvm_inject_msi ( -xc_interface *xch,domid_t domid,uint64_t msi_addr,uint32_t msi_data); +xc_interface *xch,uint32_t domid,uint64_t msi_addr,uint32_t msi_data);int xc_hvm_track_dirty_vram ( -xc_interface *xch,domid_t domid,uint64_t first_pfn,uint32_t nr, +xc_interface *xch,uint32_t domid,uint64_t first_pfn,uint32_t nr,unsigned long *dirty_bitmap);int xc_hvm_modified_memory ( -xc_interface *xch,domid_t domid,uint64_t first_pfn,uint32_t nr); +xc_interface *xch,uint32_t domid,uint64_t first_pfn,uint32_t nr);int xc_hvm_set_mem_type ( -xc_interface *xch,domid_t domid,hvmmem_type_t type, +xc_interface *xch,uint32_t domid,hvmmem_type_t type,uint64_t first_pfn,uint32_t nr);int xc_hvm_inject_trap ( -xc_interface *xch,domid_t domid,int vcpu,uint8_t vector, +xc_interface *xch,uint32_t domid,int vcpu,uint8_t vector,uint8_t type,uint32_t error_code,uint8_t insn_len,uint64_t cr2);#endif /* XC_WANT_COMPAT_DEVICEMODEL_API */
tools/libxc/include/xenguest.h +8 -8
@@ -109,7 +109,7 @@ struct save_callbacks {int (*wait_checkpoint)(void * data);/* Enable qemu-dm logging dirty pages to xen */ -int (*switch_qemu_logdirty)(int domid,unsigned enable,void *data);/* HVM only */ +int (*switch_qemu_logdirty)(uint32_t domid,unsigned enable,void *data);/* HVM only */ /* to be provided as the last argument to each callback function */ void * data;
@@ -195,8 +195,8 @@ struct restore_callbacks {*/ int xc_domain_restore (xc_interface *xch,int io_fd,uint32_t dom,unsigned int store_evtchn,unsigned long *store_mfn, -domid_t store_domid,unsigned int console_evtchn, -unsigned long *console_mfn,domid_t console_domid, +uint32_t store_domid,unsigned int console_evtchn, +unsigned long *console_mfn,uint32_t console_domid,unsigned int hvm,unsigned int pae,xc_migration_stream_t stream_type,struct restore_callbacks *callbacks,int send_back_fd);
@@ -243,7 +243,7 @@ struct xc_hvm_firmware_module {*/ int xc_suspend_evtchn_release (xc_interface *xch,struct xenevtchn_handle *xce, -int domid,int suspend_evtchn,int *lockfd); +uint32_t domid,int suspend_evtchn,int *lockfd);/** * This function eats the initial notification.
@@ -252,7 +252,7 @@ int xc_suspend_evtchn_release(xc_interface *xch,*/ int xc_suspend_evtchn_init_exclusive (xc_interface *xch,struct xenevtchn_handle *xce, -int domid,int port,int *lockfd); +uint32_t domid,int port,int *lockfd);/* xce must not be used for anything else */ int xc_await_suspend(xc_interface *xch, struct xenevtchn_handle *xce,
@@ -267,7 +267,7 @@ int xc_await_suspend(xc_interface *xch, struct xenevtchn_handle *xce,*/ int xc_suspend_evtchn_init_sane (xc_interface *xch,struct xenevtchn_handle *xce, -int domid,int port,int *lockfd); +uint32_t domid,int port,int *lockfd);int xc_mark_page_online (xc_interface *xch,unsigned long start,unsigned long end,uint32_t *status);
@@ -278,7 +278,7 @@ int xc_mark_page_offline(xc_interface *xch, unsigned long start,int xc_query_page_offline_status (xc_interface *xch,unsigned long start,unsigned long end,uint32_t *status); -int xc_exchange_page (xc_interface *xch,int domid,xen_pfn_t mfn); +int xc_exchange_page (xc_interface *xch,uint32_t domid,xen_pfn_t mfn);/**
@@ -293,7 +293,7 @@ struct xc_domain_meminfo {unsigned long p2m_size; }; -int xc_map_domain_meminfo (xc_interface *xch,int domid, +int xc_map_domain_meminfo (xc_interface *xch,uint32_t domid,struct xc_domain_meminfo *minfo);int xc_unmap_domain_meminfo (xc_interface *xch,struct xc_domain_meminfo *mem);
tools/libxc/xc_altp2m.c +8 -8
@@ -24,7 +24,7 @@#include <stdbool.h> #include <xen/hvm/hvm_op.h> -int xc_altp2m_get_domain_state (xc_interface *handle,domid_t dom,bool *state) +int xc_altp2m_get_domain_state (xc_interface *handle,uint32_t dom,bool *state) {int rc;DECLARE_HYPERCALL_BUFFER (xen_hvm_altp2m_op_t, arg);
@@ -47,7 +47,7 @@ int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state)return rc; } -int xc_altp2m_set_domain_state (xc_interface *handle,domid_t dom,bool state) +int xc_altp2m_set_domain_state (xc_interface *handle,uint32_t dom,bool state) {int rc;DECLARE_HYPERCALL_BUFFER (xen_hvm_altp2m_op_t, arg);
@@ -69,7 +69,7 @@ int xc_altp2m_set_domain_state(xc_interface *handle, domid_t dom, bool state) }/* This is a bit odd to me that it acts on current.. */ -int xc_altp2m_set_vcpu_enable_notify (xc_interface *handle,domid_t domid, +int xc_altp2m_set_vcpu_enable_notify (xc_interface *handle,uint32_t domid,uint32_t vcpuid,xen_pfn_t gfn) {int rc;
@@ -92,7 +92,7 @@ int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, domid_t domid,return rc; } -int xc_altp2m_create_view (xc_interface *handle,domid_t domid, +int xc_altp2m_create_view (xc_interface *handle,uint32_t domid,xenmem_access_t default_access,uint16_t *view_id) {int rc;
@@ -118,7 +118,7 @@ int xc_altp2m_create_view(xc_interface *handle, domid_t domid,return rc; } -int xc_altp2m_destroy_view (xc_interface *handle,domid_t domid, +int xc_altp2m_destroy_view (xc_interface *handle,uint32_t domid,uint16_t view_id) {int rc;
@@ -141,7 +141,7 @@ int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid, }/* Switch all vCPUs of the domain to the specified altp2m view */ -int xc_altp2m_switch_to_view (xc_interface *handle,domid_t domid, +int xc_altp2m_switch_to_view (xc_interface *handle,uint32_t domid,uint16_t view_id) {int rc;
@@ -163,7 +163,7 @@ int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid,return rc; } -int xc_altp2m_set_mem_access (xc_interface *handle,domid_t domid, +int xc_altp2m_set_mem_access (xc_interface *handle,uint32_t domid,uint16_t view_id,xen_pfn_t gfn,xenmem_access_t access) {
@@ -188,7 +188,7 @@ int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,return rc; } -int xc_altp2m_change_gfn (xc_interface *handle,domid_t domid, +int xc_altp2m_change_gfn (xc_interface *handle,uint32_t domid,uint16_t view_id,xen_pfn_t old_gfn,xen_pfn_t new_gfn) {
tools/libxc/xc_core.h +1 -1
@@ -147,7 +147,7 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m, unsigned long *pfnp); -int xc_core_arch_get_scratch_gpfn (xc_interface *xch,domid_t domid, +int xc_core_arch_get_scratch_gpfn (xc_interface *xch,uint32_t domid,xen_pfn_t *gpfn);
tools/libxc/xc_core_arm.c +1 -1
@@ -96,7 +96,7 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do }int -xc_core_arch_get_scratch_gpfn (xc_interface *xch,domid_t domid, +xc_core_arch_get_scratch_gpfn (xc_interface *xch,uint32_t domid,xen_pfn_t *gpfn) {/*
tools/libxc/xc_core_x86.c +1 -1
@@ -208,7 +208,7 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do }int -xc_core_arch_get_scratch_gpfn (xc_interface *xch,domid_t domid, +xc_core_arch_get_scratch_gpfn (xc_interface *xch,uint32_t domid,xen_pfn_t *gpfn) {return xc_domain_nr_gpfns (xch, domid, gpfn);
tools/libxc/xc_cpuid_x86.c +4 -4
@@ -202,7 +202,7 @@ static void cpuid(const unsigned int *input, unsigned int *regs)#endif } -static int get_cpuid_domain_info (xc_interface *xch,domid_t domid, +static int get_cpuid_domain_info (xc_interface *xch,uint32_t domid,struct cpuid_domain_info *info,uint32_t *featureset,unsigned int nr_features)
@@ -608,7 +608,7 @@ static int xc_cpuid_policy(xc_interface *xch, }static int xc_cpuid_do_domctl ( -xc_interface *xch,domid_t domid, +xc_interface *xch,uint32_t domid,const unsigned int *input,const unsigned int *regs) {DECLARE_DOMCTL ;
@@ -709,7 +709,7 @@ static void sanitise_featureset(struct cpuid_domain_info *info) } } -int xc_cpuid_apply_policy (xc_interface *xch,domid_t domid, +int xc_cpuid_apply_policy (xc_interface *xch,uint32_t domid,uint32_t *featureset,unsigned int nr_features) {
@@ -796,7 +796,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, domid_t domid,* For 's' and 'x' the configuration is overwritten with the value applied. */ int xc_cpuid_set ( -xc_interface *xch,domid_t domid,const unsigned int *input, +xc_interface *xch,uint32_t domid,const unsigned int *input,const char **config,char **config_transformed) {int rc;
tools/libxc/xc_csched.c +2 -2
@@ -32,7 +32,7 @@ xc_sched_credit_domain_set(DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_CREDIT ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo; domctl.u.scheduler_op.u.credit = *sdom;
@@ -52,7 +52,7 @@ xc_sched_credit_domain_get(DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_CREDIT ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
tools/libxc/xc_csched2.c +2 -2
@@ -32,7 +32,7 @@ xc_sched_credit2_domain_set(DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_CREDIT2 ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo; domctl.u.scheduler_op.u.credit2 = *sdom;
@@ -52,7 +52,7 @@ xc_sched_credit2_domain_get(DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_CREDIT2 ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
tools/libxc/xc_devicemodel_compat.c +16 -16
@@ -7,7 +7,7 @@#include "xc_private.h" int xc_hvm_create_ioreq_server ( -xc_interface *xch,domid_t domid,int handle_bufioreq, +xc_interface *xch,uint32_t domid,int handle_bufioreq,ioservid_t *id) { return xendevicemodel_create_ioreq_server(xch->dmod, domid,
@@ -15,7 +15,7 @@ int xc_hvm_create_ioreq_server( }int xc_hvm_get_ioreq_server_info ( -xc_interface *xch,domid_t domid,ioservid_t id,xen_pfn_t *ioreq_pfn, +xc_interface *xch,uint32_t domid,ioservid_t id,xen_pfn_t *ioreq_pfn,xen_pfn_t *bufioreq_pfn,evtchn_port_t *bufioreq_port) { return xendevicemodel_get_ioreq_server_info(xch->dmod, domid, id,
@@ -24,7 +24,7 @@ int xc_hvm_get_ioreq_server_info( }int xc_hvm_map_io_range_to_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,int is_mmio, +xc_interface *xch,uint32_t domid,ioservid_t id,int is_mmio,uint64_t start,uint64_t end) { return xendevicemodel_map_io_range_to_ioreq_server(xch->dmod, domid,
@@ -33,7 +33,7 @@ int xc_hvm_map_io_range_to_ioreq_server( }int xc_hvm_unmap_io_range_from_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,int is_mmio, +xc_interface *xch,uint32_t domid,ioservid_t id,int is_mmio,uint64_t start,uint64_t end) { return xendevicemodel_unmap_io_range_from_ioreq_server(xch->dmod, domid,
@@ -42,7 +42,7 @@ int xc_hvm_unmap_io_range_from_ioreq_server( }int xc_hvm_map_pcidev_to_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,uint16_t segment, +xc_interface *xch,uint32_t domid,ioservid_t id,uint16_t segment,uint8_t bus,uint8_t device,uint8_t function) { return xendevicemodel_map_pcidev_to_ioreq_server(xch->dmod, domid, id,
@@ -51,7 +51,7 @@ int xc_hvm_map_pcidev_to_ioreq_server( }int xc_hvm_unmap_pcidev_from_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id,uint16_t segment, +xc_interface *xch,uint32_t domid,ioservid_t id,uint16_t segment,uint8_t bus,uint8_t device,uint8_t function) { return xendevicemodel_unmap_pcidev_from_ioreq_server(xch->dmod, domid,
@@ -60,20 +60,20 @@ int xc_hvm_unmap_pcidev_from_ioreq_server( }int xc_hvm_destroy_ioreq_server ( -xc_interface *xch,domid_t domid,ioservid_t id) +xc_interface *xch,uint32_t domid,ioservid_t id) {return xendevicemodel_destroy_ioreq_server (xch->dmod, domid, id); }int xc_hvm_set_ioreq_server_state ( -xc_interface *xch,domid_t domid,ioservid_t id,int enabled) +xc_interface *xch,uint32_t domid,ioservid_t id,int enabled) {return xendevicemodel_set_ioreq_server_state (xch->dmod, domid, id, enabled); }int xc_hvm_set_pci_intx_level ( -xc_interface *xch,domid_t domid,uint16_t segment,uint8_t bus, +xc_interface *xch,uint32_t domid,uint16_t segment,uint8_t bus,uint8_t device,uint8_t intx,unsigned int level) { return xendevicemodel_set_pci_intx_level(xch->dmod, domid, segment,
@@ -81,25 +81,25 @@ int xc_hvm_set_pci_intx_level( }int xc_hvm_set_isa_irq_level ( -xc_interface *xch,domid_t domid,uint8_t irq,unsigned int level) +xc_interface *xch,uint32_t domid,uint8_t irq,unsigned int level) {return xendevicemodel_set_isa_irq_level (xch->dmod, domid, irq, level); }int xc_hvm_set_pci_link_route ( -xc_interface *xch,domid_t domid,uint8_t link,uint8_t irq) +xc_interface *xch,uint32_t domid,uint8_t link,uint8_t irq) {return xendevicemodel_set_pci_link_route (xch->dmod, domid, link, irq); }int xc_hvm_inject_msi ( -xc_interface *xch,domid_t domid,uint64_t msi_addr,uint32_t msi_data) +xc_interface *xch,uint32_t domid,uint64_t msi_addr,uint32_t msi_data) {return xendevicemodel_inject_msi (xch->dmod, domid, msi_addr, msi_data); }int xc_hvm_track_dirty_vram ( -xc_interface *xch,domid_t domid,uint64_t first_pfn,uint32_t nr, +xc_interface *xch,uint32_t domid,uint64_t first_pfn,uint32_t nr,unsigned long *dirty_bitmap) { return xendevicemodel_track_dirty_vram(xch->dmod, domid, first_pfn,
@@ -107,13 +107,13 @@ int xc_hvm_track_dirty_vram( }int xc_hvm_modified_memory ( -xc_interface *xch,domid_t domid,uint64_t first_pfn,uint32_t nr) +xc_interface *xch,uint32_t domid,uint64_t first_pfn,uint32_t nr) {return xendevicemodel_modified_memory (xch->dmod, domid, first_pfn, nr); }int xc_hvm_set_mem_type ( -xc_interface *xch,domid_t domid,hvmmem_type_t type, +xc_interface *xch,uint32_t domid,hvmmem_type_t type,uint64_t first_pfn,uint32_t nr) { return xendevicemodel_set_mem_type(xch->dmod, domid, type, first_pfn,
@@ -121,7 +121,7 @@ int xc_hvm_set_mem_type( }int xc_hvm_inject_trap ( -xc_interface *xch,domid_t domid,int vcpu,uint8_t vector, +xc_interface *xch,uint32_t domid,int vcpu,uint8_t vector,uint8_t type,uint32_t error_code,uint8_t insn_len,uint64_t cr2) { return xendevicemodel_inject_event(xch->dmod, domid, vcpu, vector,
tools/libxc/xc_dom_arm.c +1 -1
@@ -212,7 +212,7 @@ static int vcpu_arm64(struct xc_dom_image *dom)/* ------------------------------------------------------------------------ */ -static int set_mode (xc_interface *xch,domid_t domid,char *guest_type) +static int set_mode (xc_interface *xch,uint32_t domid,char *guest_type) { static const struct { char *guest;
tools/libxc/xc_dom_boot.c +8 -8
@@ -110,7 +110,7 @@ int xc_dom_compat_check(struct xc_dom_image *dom)return found; } -int xc_dom_boot_xen_init (struct xc_dom_image *dom,xc_interface *xch,domid_t domid) +int xc_dom_boot_xen_init (struct xc_dom_image *dom,xc_interface *xch,uint32_t domid) { dom->xch = xch; dom->guest_domid = domid;
@@ -250,7 +250,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)return rc; } -static xen_pfn_t xc_dom_gnttab_setup (xc_interface *xch,domid_t domid) +static xen_pfn_t xc_dom_gnttab_setup (xc_interface *xch,uint32_t domid) {gnttab_setup_table_t setup;DECLARE_HYPERCALL_BUFFER (xen_pfn_t, gmfnp);
@@ -282,11 +282,11 @@ static xen_pfn_t xc_dom_gnttab_setup(xc_interface *xch, domid_t domid)return gmfn; } -int xc_dom_gnttab_seed (xc_interface *xch,domid_t domid, +int xc_dom_gnttab_seed (xc_interface *xch,uint32_t domid,xen_pfn_t console_gmfn,xen_pfn_t xenstore_gmfn, -domid_t console_domid, -domid_t xenstore_domid) +uint32_t console_domid, +uint32_t xenstore_domid) {xen_pfn_t gnttab_gmfn;
@@ -339,11 +339,11 @@ int xc_dom_gnttab_seed(xc_interface *xch, domid_t domid,return 0 ; } -int xc_dom_gnttab_hvm_seed (xc_interface *xch,domid_t domid, +int xc_dom_gnttab_hvm_seed (xc_interface *xch,uint32_t domid,xen_pfn_t console_gpfn,xen_pfn_t xenstore_gpfn, -domid_t console_domid, -domid_t xenstore_domid) +uint32_t console_domid, +uint32_t xenstore_domid) {int rc;xen_pfn_t scratch_gpfn;
tools/libxc/xc_dom_x86.c +1 -1
@@ -1030,7 +1030,7 @@ static int vcpu_hvm(struct xc_dom_image *dom)/* ------------------------------------------------------------------------ */ -static int x86_compat (xc_interface *xch,domid_t domid,char *guest_type) +static int x86_compat (xc_interface *xch,uint32_t domid,char *guest_type) { static const struct { char *guest;
tools/libxc/xc_domain.c +52 -52
398 lines not on this page · raw message
tools/libxc/xc_evtchn.c +3 -3
@@ -50,8 +50,8 @@ xc_evtchn_alloc_unbound(xc_interface *xch, {int rc;struct evtchn_alloc_unbound arg = { - .dom = (domid_t )dom, - .remote_dom = (domid_t )remote_dom + .dom = dom, + .remote_dom = remote_dom, }; rc =do_evtchn_op (xch, EVTCHNOP_alloc_unbound, &arg,sizeof (arg),0 );
@@ -64,7 +64,7 @@ xc_evtchn_alloc_unbound(xc_interface *xch,int xc_evtchn_reset (xc_interface *xch,uint32_t dom) { -struct evtchn_reset arg = { .dom = (domid_t )dom }; +struct evtchn_reset arg = { .dom = dom };return do_evtchn_op (xch, EVTCHNOP_reset, &arg,sizeof (arg),0 ); }
tools/libxc/xc_evtchn_compat.c +2 -2
@@ -30,13 +30,13 @@ int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port) }evtchn_port_or_error_t -xc_evtchn_bind_unbound_port (xc_evtchn *xce,int domid) +xc_evtchn_bind_unbound_port (xc_evtchn *xce,uint32_t domid) {return xenevtchn_bind_unbound_port (xce, domid); }evtchn_port_or_error_t -xc_evtchn_bind_interdomain (xc_evtchn *xce,int domid, +xc_evtchn_bind_interdomain (xc_evtchn *xce,uint32_t domid,evtchn_port_t remote_port) {return xenevtchn_bind_interdomain (xce, domid, remote_port);
tools/libxc/xc_flask.c +1 -1
@@ -429,7 +429,7 @@ int xc_flask_setavc_threshold(xc_interface *xch, int threshold)return xc_flask_op (xch, &op); } -int xc_flask_relabel_domain (xc_interface *xch,int domid,uint32_t sid) +int xc_flask_relabel_domain (xc_interface *xch,uint32_t domid,uint32_t sid) {DECLARE_FLASK_OP ; op.cmd =FLASK_RELABEL_DOMAIN ;
tools/libxc/xc_gnttab.c +4 -4
@@ -50,7 +50,7 @@ int xc_gnttab_query_size(xc_interface *xch, struct gnttab_query_size *query)return rc; } -int xc_gnttab_get_version (xc_interface *xch,int domid) +int xc_gnttab_get_version (xc_interface *xch,uint32_t domid) {struct gnttab_get_version query;int rc;
@@ -64,7 +64,7 @@ int xc_gnttab_get_version(xc_interface *xch, int domid)return query.version; } -static void *_gnttab_map_table (xc_interface *xch,int domid,int *gnt_num) +static void *_gnttab_map_table (xc_interface *xch,uint32_t domid,int *gnt_num) {int rc, i;struct gnttab_query_size query;
@@ -134,7 +134,7 @@ static void *_gnttab_map_table(xc_interface *xch, int domid, int *gnt_num)return gnt; } -grant_entry_v1_t *xc_gnttab_map_table_v1 (xc_interface *xch,int domid, +grant_entry_v1_t *xc_gnttab_map_table_v1 (xc_interface *xch,uint32_t domid,int *gnt_num) {if (xc_gnttab_get_version (xch, domid) ==2 )
@@ -142,7 +142,7 @@ grant_entry_v1_t *xc_gnttab_map_table_v1(xc_interface *xch, int domid,return _gnttab_map_table (xch, domid, gnt_num); } -grant_entry_v2_t *xc_gnttab_map_table_v2 (xc_interface *xch,int domid, +grant_entry_v2_t *xc_gnttab_map_table_v2 (xc_interface *xch,uint32_t domid,int *gnt_num) {if (xc_gnttab_get_version (xch, domid) !=2 )
tools/libxc/xc_mem_access.c +3 -3
@@ -24,7 +24,7 @@#include <xen/memory.h> int xc_set_mem_access (xc_interface *xch, -domid_t domain_id, +uint32_t domain_id,xenmem_access_t access,uint64_t first_pfn,uint32_t nr)
@@ -42,7 +42,7 @@ int xc_set_mem_access(xc_interface *xch, }int xc_set_mem_access_multi (xc_interface *xch, -domid_t domain_id, +uint32_t domain_id,uint8_t *access,uint64_t *pages,uint32_t nr)
@@ -80,7 +80,7 @@ int xc_set_mem_access_multi(xc_interface *xch, }int xc_get_mem_access (xc_interface *xch, -domid_t domain_id, +uint32_t domain_id,uint64_t pfn,xenmem_access_t *access) {
tools/libxc/xc_mem_paging.c +8 -8
@@ -22,7 +22,7 @@#include "xc_private.h" -static int xc_mem_paging_memop (xc_interface *xch,domid_t domain_id, +static int xc_mem_paging_memop (xc_interface *xch,uint32_t domain_id,unsigned int op,uint64_t gfn,void *buffer) {xen_mem_paging_op_t mpo;
@@ -37,7 +37,7 @@ static int xc_mem_paging_memop(xc_interface *xch, domid_t domain_id,return do_memory_op (xch, XENMEM_paging_op, &mpo,sizeof (mpo)); } -int xc_mem_paging_enable (xc_interface *xch,domid_t domain_id, +int xc_mem_paging_enable (xc_interface *xch,uint32_t domain_id,uint32_t *port) {if ( !port )
@@ -52,7 +52,7 @@ int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id, port); } -int xc_mem_paging_disable (xc_interface *xch,domid_t domain_id) +int xc_mem_paging_disable (xc_interface *xch,uint32_t domain_id) { return xc_vm_event_control(xch, domain_id, XEN_VM_EVENT_DISABLE,
@@ -60,7 +60,7 @@ int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id) NULL); } -int xc_mem_paging_resume (xc_interface *xch,domid_t domain_id) +int xc_mem_paging_resume (xc_interface *xch,uint32_t domain_id) { return xc_vm_event_control(xch, domain_id, XEN_VM_EVENT_RESUME,
@@ -68,28 +68,28 @@ int xc_mem_paging_resume(xc_interface *xch, domid_t domain_id) NULL); } -int xc_mem_paging_nominate (xc_interface *xch,domid_t domain_id,uint64_t gfn) +int xc_mem_paging_nominate (xc_interface *xch,uint32_t domain_id,uint64_t gfn) {return xc_mem_paging_memop (xch, domain_id, XENMEM_paging_op_nominate, gfn,NULL ); } -int xc_mem_paging_evict (xc_interface *xch,domid_t domain_id,uint64_t gfn) +int xc_mem_paging_evict (xc_interface *xch,uint32_t domain_id,uint64_t gfn) {return xc_mem_paging_memop (xch, domain_id, XENMEM_paging_op_evict, gfn,NULL ); } -int xc_mem_paging_prep (xc_interface *xch,domid_t domain_id,uint64_t gfn) +int xc_mem_paging_prep (xc_interface *xch,uint32_t domain_id,uint64_t gfn) {return xc_mem_paging_memop (xch, domain_id, XENMEM_paging_op_prep, gfn,NULL ); } -int xc_mem_paging_load (xc_interface *xch,domid_t domain_id, +int xc_mem_paging_load (xc_interface *xch,uint32_t domain_id,uint64_t gfn,void *buffer) {int rc, old_errno;
tools/libxc/xc_memshr.c +17 -17
@@ -25,7 +25,7 @@#include <xen/grant_table.h> int xc_memshr_control (xc_interface *xch, -domid_t domid, +uint32_t domid,int enable) {DECLARE_DOMCTL ;
@@ -42,7 +42,7 @@ int xc_memshr_control(xc_interface *xch, }int xc_memshr_ring_enable (xc_interface *xch, -domid_t domid, +uint32_t domid,uint32_t *port) {if ( !port )
@@ -58,7 +58,7 @@ int xc_memshr_ring_enable(xc_interface *xch, }int xc_memshr_ring_disable (xc_interface *xch, -domid_t domid) +uint32_t domid) { return xc_vm_event_control(xch, domid, XEN_VM_EVENT_DISABLE,
@@ -66,7 +66,7 @@ int xc_memshr_ring_disable(xc_interface *xch, NULL); } -static int xc_memshr_memop (xc_interface *xch,domid_t domid, +static int xc_memshr_memop (xc_interface *xch,uint32_t domid,xen_mem_sharing_op_t *mso) { mso->domain = domid;
@@ -75,7 +75,7 @@ static int xc_memshr_memop(xc_interface *xch, domid_t domid, }int xc_memshr_nominate_gfn (xc_interface *xch, -domid_t domid, +uint32_t domid,unsigned long gfn,uint64_t *handle) {
@@ -95,7 +95,7 @@ int xc_memshr_nominate_gfn(xc_interface *xch, }int xc_memshr_nominate_gref (xc_interface *xch, -domid_t domid, +uint32_t domid,grant_ref_t gref,uint64_t *handle) {
@@ -115,10 +115,10 @@ int xc_memshr_nominate_gref(xc_interface *xch, }int xc_memshr_share_gfns (xc_interface *xch, -domid_t source_domain, +uint32_t source_domain,unsigned long source_gfn,uint64_t source_handle, -domid_t client_domain, +uint32_t client_domain,unsigned long client_gfn,uint64_t client_handle) {
@@ -138,10 +138,10 @@ int xc_memshr_share_gfns(xc_interface *xch, }int xc_memshr_share_grefs (xc_interface *xch, -domid_t source_domain, +uint32_t source_domain,grant_ref_t source_gref,uint64_t source_handle, -domid_t client_domain, +uint32_t client_domain,grant_ref_t client_gref,uint64_t client_handle) {
@@ -161,10 +161,10 @@ int xc_memshr_share_grefs(xc_interface *xch, }int xc_memshr_add_to_physmap (xc_interface *xch, -domid_t source_domain, +uint32_t source_domain,unsigned long source_gfn,uint64_t source_handle, -domid_t client_domain, +uint32_t client_domain,unsigned long client_gfn) {xen_mem_sharing_op_t mso;
@@ -182,8 +182,8 @@ int xc_memshr_add_to_physmap(xc_interface *xch, }int xc_memshr_range_share (xc_interface *xch, -domid_t source_domain, -domid_t client_domain, +uint32_t source_domain, +uint32_t client_domain,uint64_t first_gfn,uint64_t last_gfn) {
@@ -201,7 +201,7 @@ int xc_memshr_range_share(xc_interface *xch, }int xc_memshr_domain_resume (xc_interface *xch, -domid_t domid) +uint32_t domid) { return xc_vm_event_control(xch, domid, XEN_VM_EVENT_RESUME,
@@ -210,7 +210,7 @@ int xc_memshr_domain_resume(xc_interface *xch, }int xc_memshr_debug_gfn (xc_interface *xch, -domid_t domid, +uint32_t domid,unsigned long gfn) {xen_mem_sharing_op_t mso;
@@ -224,7 +224,7 @@ int xc_memshr_debug_gfn(xc_interface *xch, }int xc_memshr_debug_gref (xc_interface *xch, -domid_t domid, +uint32_t domid,grant_ref_t gref) {xen_mem_sharing_op_t mso;
tools/libxc/xc_monitor.c +15 -15
@@ -22,13 +22,13 @@#include "xc_private.h" -void *xc_monitor_enable (xc_interface *xch,domid_t domain_id,uint32_t *port) +void *xc_monitor_enable (xc_interface *xch,uint32_t domain_id,uint32_t *port) {return xc_vm_event_enable (xch, domain_id,HVM_PARAM_MONITOR_RING_PFN , port); } -int xc_monitor_disable (xc_interface *xch,domid_t domain_id) +int xc_monitor_disable (xc_interface *xch,uint32_t domain_id) { return xc_vm_event_control(xch, domain_id, XEN_VM_EVENT_DISABLE,
@@ -36,7 +36,7 @@ int xc_monitor_disable(xc_interface *xch, domid_t domain_id) NULL); } -int xc_monitor_resume (xc_interface *xch,domid_t domain_id) +int xc_monitor_resume (xc_interface *xch,uint32_t domain_id) { return xc_vm_event_control(xch, domain_id, XEN_VM_EVENT_RESUME,
@@ -44,7 +44,7 @@ int xc_monitor_resume(xc_interface *xch, domid_t domain_id) NULL); } -int xc_monitor_get_capabilities (xc_interface *xch,domid_t domain_id, +int xc_monitor_get_capabilities (xc_interface *xch,uint32_t domain_id,uint32_t *capabilities) {int rc;
@@ -68,7 +68,7 @@ int xc_monitor_get_capabilities(xc_interface *xch, domid_t domain_id,return 0 ; } -int xc_monitor_write_ctrlreg (xc_interface *xch,domid_t domain_id, +int xc_monitor_write_ctrlreg (xc_interface *xch,uint32_t domain_id,uint16_t index,bool enable,bool sync,uint64_t bitmask,bool onchangeonly) {
@@ -89,7 +89,7 @@ int xc_monitor_write_ctrlreg(xc_interface *xch, domid_t domain_id,return do_domctl (xch, &domctl); } -int xc_monitor_mov_to_msr (xc_interface *xch,domid_t domain_id,uint32_t msr, +int xc_monitor_mov_to_msr (xc_interface *xch,uint32_t domain_id,uint32_t msr,bool enable) {DECLARE_DOMCTL ;
@@ -104,7 +104,7 @@ int xc_monitor_mov_to_msr(xc_interface *xch, domid_t domain_id, uint32_t msr,return do_domctl (xch, &domctl); } -int xc_monitor_software_breakpoint (xc_interface *xch,domid_t domain_id, +int xc_monitor_software_breakpoint (xc_interface *xch,uint32_t domain_id,bool enable) {DECLARE_DOMCTL ;
@@ -118,7 +118,7 @@ int xc_monitor_software_breakpoint(xc_interface *xch, domid_t domain_id,return do_domctl (xch, &domctl); } -int xc_monitor_singlestep (xc_interface *xch,domid_t domain_id, +int xc_monitor_singlestep (xc_interface *xch,uint32_t domain_id,bool enable) {DECLARE_DOMCTL ;
@@ -132,7 +132,7 @@ int xc_monitor_singlestep(xc_interface *xch, domid_t domain_id,return do_domctl (xch, &domctl); } -int xc_monitor_descriptor_access (xc_interface *xch,domid_t domain_id, +int xc_monitor_descriptor_access (xc_interface *xch,uint32_t domain_id,bool enable) {DECLARE_DOMCTL ;
@@ -146,7 +146,7 @@ int xc_monitor_descriptor_access(xc_interface *xch, domid_t domain_id,return do_domctl (xch, &domctl); } -int xc_monitor_guest_request (xc_interface *xch,domid_t domain_id,bool enable, +int xc_monitor_guest_request (xc_interface *xch,uint32_t domain_id,bool enable,bool sync,bool allow_userspace) {DECLARE_DOMCTL ;
@@ -162,7 +162,7 @@ int xc_monitor_guest_request(xc_interface *xch, domid_t domain_id, bool enable,return do_domctl (xch, &domctl); } -int xc_monitor_emulate_each_rep (xc_interface *xch,domid_t domain_id, +int xc_monitor_emulate_each_rep (xc_interface *xch,uint32_t domain_id,bool enable) {DECLARE_DOMCTL ;
@@ -175,7 +175,7 @@ int xc_monitor_emulate_each_rep(xc_interface *xch, domid_t domain_id,return do_domctl (xch, &domctl); } -int xc_monitor_debug_exceptions (xc_interface *xch,domid_t domain_id, +int xc_monitor_debug_exceptions (xc_interface *xch,uint32_t domain_id,bool enable,bool sync) {DECLARE_DOMCTL ;
@@ -190,7 +190,7 @@ int xc_monitor_debug_exceptions(xc_interface *xch, domid_t domain_id,return do_domctl (xch, &domctl); } -int xc_monitor_cpuid (xc_interface *xch,domid_t domain_id,bool enable) +int xc_monitor_cpuid (xc_interface *xch,uint32_t domain_id,bool enable) {DECLARE_DOMCTL ;
@@ -203,7 +203,7 @@ int xc_monitor_cpuid(xc_interface *xch, domid_t domain_id, bool enable)return do_domctl (xch, &domctl); } -int xc_monitor_privileged_call (xc_interface *xch,domid_t domain_id, +int xc_monitor_privileged_call (xc_interface *xch,uint32_t domain_id,bool enable) {DECLARE_DOMCTL ;
@@ -217,7 +217,7 @@ int xc_monitor_privileged_call(xc_interface *xch, domid_t domain_id,return do_domctl (xch, &domctl); } -int xc_monitor_emul_unimplemented (xc_interface *xch,domid_t domain_id, +int xc_monitor_emul_unimplemented (xc_interface *xch,uint32_t domain_id,bool enable) {DECLARE_DOMCTL ;
tools/libxc/xc_nomigrate.c +2 -2
@@ -30,8 +30,8 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t flags,int xc_domain_restore (xc_interface *xch,int io_fd,uint32_t dom,unsigned int store_evtchn,unsigned long *store_mfn, -domid_t store_domid,unsigned int console_evtchn, -unsigned long *console_mfn,domid_t console_domid, +uint32_t store_domid,unsigned int console_evtchn, +unsigned long *console_mfn,uint32_t console_domid,unsigned int hvm,unsigned int pae,xc_migration_stream_t stream_type,struct restore_callbacks *callbacks,int send_back_fd)
tools/libxc/xc_offline_page.c +5 -5
@@ -262,7 +262,7 @@ static int __update_pte(xc_interface *xch,return 0 ; } -static int change_pte(xc_interface *xch, int domid, +static int change_pte(xc_interface *xch, uint32_t domid, struct xc_domain_meminfo *minfo, struct pte_backup *backup, struct xc_mmu *mmu,
@@ -340,7 +340,7 @@ static int change_pte(xc_interface *xch, int domid,return -1 ; } -static int update_pte(xc_interface *xch, int domid, +static int update_pte(xc_interface *xch, uint32_t domid, struct xc_domain_meminfo *minfo, struct pte_backup *backup, struct xc_mmu *mmu,
@@ -350,7 +350,7 @@ static int update_pte(xc_interface *xch, int domid, __update_pte, new_mfn); } -static int clear_pte(xc_interface *xch, int domid, +static int clear_pte(xc_interface *xch, uint32_t domid, struct xc_domain_meminfo *minfo, struct pte_backup *backup, struct xc_mmu *mmu,
@@ -364,7 +364,7 @@ static int clear_pte(xc_interface *xch, int domid,* Check if a page can be exchanged successfully */ -static int is_page_exchangable (xc_interface *xch,int domid,xen_pfn_t mfn, +static int is_page_exchangable (xc_interface *xch,uint32_t domid,xen_pfn_t mfn,xc_dominfo_t *info) {uint32_t status;
@@ -455,7 +455,7 @@ xen_pfn_t *xc_map_m2p(xc_interface *xch, }/* The domain should be suspended when called here */ -int xc_exchange_page (xc_interface *xch,int domid,xen_pfn_t mfn) +int xc_exchange_page (xc_interface *xch,uint32_t domid,xen_pfn_t mfn) {xc_dominfo_t info;struct xc_domain_meminfo minfo;
tools/libxc/xc_physdev.c +3 -3
@@ -34,7 +34,7 @@ int xc_physdev_pci_access_modify(xc_interface *xch, }int xc_physdev_map_pirq (xc_interface *xch, -int domid, +uint32_t domid,int index,int *pirq) {
@@ -61,7 +61,7 @@ int xc_physdev_map_pirq(xc_interface *xch, } int xc_physdev_map_pirq_msi(xc_interface *xch, - int domid, + uint32_t domid, int index, int *pirq, int devfn,
@@ -96,7 +96,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch, }int xc_physdev_unmap_pirq (xc_interface *xch, -int domid, +uint32_t domid,int pirq) {int rc;
tools/libxc/xc_private.c +5 -5
@@ -221,7 +221,7 @@ int xc_get_pfn_type_batch(xc_interface *xch, uint32_t dom,if (xc_hypercall_bounce_pre (xch, arr) )return -1 ; domctl.cmd = XEN_DOMCTL_getpageframeinfo3; - domctl.domain = (domid_t )dom; + domctl.domain = dom; domctl.u.getpageframeinfo3.num = num;set_xen_guest_handle (domctl.u.getpageframeinfo3.array, arr); rc =do_domctl (xch, &domctl);
@@ -233,7 +233,7 @@ int xc_mmuext_op(xc_interface *xch, struct mmuext_op *op, unsigned int nr_ops, - domid_t dom) + uint32_t dom) { DECLARE_HYPERCALL_BOUNCE(op, nr_ops*sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);long ret =-1 ;
@@ -344,12 +344,12 @@ int xc_maximum_ram_page(xc_interface *xch, unsigned long *max_mfn)return rc; } -long long xc_domain_get_cpu_usage (xc_interface *xch,domid_t domid,int vcpu ) +long long xc_domain_get_cpu_usage (xc_interface *xch,uint32_t domid,int vcpu) {DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_getvcpuinfo; - domctl.domain = (domid_t )domid; + domctl.domain = domid; domctl.u.getvcpuinfo.vcpu = (uint16_t )vcpu;if ( (do_domctl (xch, &domctl) <0 ) ) {
@@ -403,7 +403,7 @@ int xc_get_pfn_list(xc_interface *xch, } domctl.cmd = XEN_DOMCTL_getmemlist; - domctl.domain = (domid_t )domid; + domctl.domain = domid; domctl.u.getmemlist.max_pfns = max_pfns;set_xen_guest_handle (domctl.u.getmemlist.buffer, pfn_buf);
tools/libxc/xc_private.h +3 -3
@@ -414,16 +414,16 @@ int xc_ffs64(uint64_t x);/** * vm_event operations. Internal use only. */ -int xc_vm_event_control (xc_interface *xch,domid_t domain_id,unsigned int op, +int xc_vm_event_control (xc_interface *xch,uint32_t domain_id,unsigned int op,unsigned int mode,uint32_t *port);/* * Enables vm_event and returns the mapped ring page indicated by param. * param can be HVM_PARAM_PAGING/ACCESS/SHARING_RING_PFN */ -void *xc_vm_event_enable (xc_interface *xch,domid_t domain_id,int param, +void *xc_vm_event_enable (xc_interface *xch,uint32_t domain_id,int param,uint32_t *port); -int do_dm_op (xc_interface *xch,domid_t domid,unsigned int nr_bufs, ...); +int do_dm_op (xc_interface *xch,uint32_t domid,unsigned int nr_bufs, ...);#endif /* __XC_PRIVATE_H__ */
tools/libxc/xc_psr.c +5 -5
@@ -32,7 +32,7 @@ int xc_psr_cmt_attach(xc_interface *xch, uint32_t domid)DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_psr_cmt_op; - domctl.domain = (domid_t )domid; + domctl.domain = domid; domctl.u.psr_cmt_op.cmd =XEN_DOMCTL_PSR_CMT_OP_ATTACH ;return do_domctl (xch, &domctl);
@@ -43,7 +43,7 @@ int xc_psr_cmt_detach(xc_interface *xch, uint32_t domid)DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_psr_cmt_op; - domctl.domain = (domid_t )domid; + domctl.domain = domid; domctl.u.psr_cmt_op.cmd =XEN_DOMCTL_PSR_CMT_OP_DETACH ;return do_domctl (xch, &domctl);
@@ -56,7 +56,7 @@ int xc_psr_cmt_get_domain_rmid(xc_interface *xch, uint32_t domid,DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_psr_cmt_op; - domctl.domain = (domid_t )domid; + domctl.domain = domid; domctl.u.psr_cmt_op.cmd =XEN_DOMCTL_PSR_CMT_OP_QUERY_RMID ; rc =do_domctl (xch, &domctl);
@@ -275,7 +275,7 @@ int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid, } domctl.cmd = XEN_DOMCTL_psr_cat_op; - domctl.domain = (domid_t )domid; + domctl.domain = domid; domctl.u.psr_cat_op.cmd = cmd; domctl.u.psr_cat_op.target = target; domctl.u.psr_cat_op.data = data;
@@ -311,7 +311,7 @@ int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid, } domctl.cmd = XEN_DOMCTL_psr_cat_op; - domctl.domain = (domid_t )domid; + domctl.domain = domid; domctl.u.psr_cat_op.cmd = cmd; domctl.u.psr_cat_op.target = target;
tools/libxc/xc_rt.c +4 -4
@@ -32,7 +32,7 @@ int xc_sched_rtds_domain_set(xc_interface *xch,DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_RTDS ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo; domctl.u.scheduler_op.u.rtds.period = sdom->period;
@@ -51,7 +51,7 @@ int xc_sched_rtds_domain_get(xc_interface *xch,DECLARE_DOMCTL ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_RTDS ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
@@ -78,7 +78,7 @@ int xc_sched_rtds_vcpu_set(xc_interface *xch,return -1 ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_RTDS ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putvcpuinfo;
@@ -112,7 +112,7 @@ int xc_sched_rtds_vcpu_get(xc_interface *xch,return -1 ; domctl.cmd = XEN_DOMCTL_scheduler_op; - domctl.domain = (domid_t ) domid; + domctl.domain = domid; domctl.u.scheduler_op.sched_id =XEN_SCHEDULER_RTDS ; domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getvcpuinfo;
tools/libxc/xc_sr_common.h +1 -1
@@ -250,7 +250,7 @@ struct xc_sr_context*/ xen_pfn_t xenstore_gfn, console_gfn;unsigned int xenstore_evtchn, console_evtchn; -domid_t xenstore_domid, console_domid; +uint32_t xenstore_domid, console_domid;/* Bitmap of currently populated PFNs during restore. */ unsigned long *populated_pfns;
tools/libxc/xc_sr_restore.c +2 -2
@@ -825,8 +825,8 @@ static int restore(struct xc_sr_context *ctx)int xc_domain_restore (xc_interface *xch,int io_fd,uint32_t dom,unsigned int store_evtchn,unsigned long *store_mfn, -domid_t store_domid,unsigned int console_evtchn, -unsigned long *console_gfn,domid_t console_domid, +uint32_t store_domid,unsigned int console_evtchn, +unsigned long *console_gfn,uint32_t console_domid,unsigned int hvm,unsigned int pae,xc_migration_stream_t stream_type,struct restore_callbacks *callbacks,int send_back_fd)
tools/libxc/xc_suspend.c +6 -6
@@ -35,12 +35,12 @@#define SUSPEND_FILE_BUFLEN (sizeof(SUSPEND_LOCK_FILE) + 10) -static void get_suspend_file (char buf[],int domid) +static void get_suspend_file (char buf[],uint32_t domid) {snprintf (buf,SUSPEND_FILE_BUFLEN ,SUSPEND_LOCK_FILE , domid); } -static int lock_suspend_event (xc_interface *xch,int domid,int *lockfd) +static int lock_suspend_event (xc_interface *xch,uint32_t domid,int *lockfd) {int fd =-1 , r;char suspend_file[SUSPEND_FILE_BUFLEN ];
@@ -100,7 +100,7 @@ static int lock_suspend_event(xc_interface *xch, int domid, int *lockfd)return -1 ; } -static int unlock_suspend_event (xc_interface *xch,int domid,int *lockfd) +static int unlock_suspend_event (xc_interface *xch,uint32_t domid,int *lockfd) {int r;char suspend_file[SUSPEND_FILE_BUFLEN ];
@@ -148,7 +148,7 @@ int xc_await_suspend(xc_interface *xch, xenevtchn_handle *xce, int suspend_evtch/* Internal callers are allowed to call this with suspend_evtchn<0 * but *lockfd>0. */ int xc_suspend_evtchn_release (xc_interface *xch,xenevtchn_handle *xce, -int domid,int suspend_evtchn,int *lockfd) +uint32_t domid,int suspend_evtchn,int *lockfd) {if (suspend_evtchn >=0 )xenevtchn_unbind (xce, suspend_evtchn);
@@ -157,7 +157,7 @@ int xc_suspend_evtchn_release(xc_interface *xch, xenevtchn_handle *xce, }int xc_suspend_evtchn_init_sane (xc_interface *xch,xenevtchn_handle *xce, -int domid,int port,int *lockfd) +uint32_t domid,int port,int *lockfd) {int rc, suspend_evtchn =-1 ;
@@ -187,7 +187,7 @@ int xc_suspend_evtchn_init_sane(xc_interface *xch, xenevtchn_handle *xce, }int xc_suspend_evtchn_init_exclusive (xc_interface *xch,xenevtchn_handle *xce, -int domid,int port,int *lockfd) +uint32_t domid,int port,int *lockfd) {int suspend_evtchn;
tools/libxc/xc_tmem.c +24 -23
148 lines not on this page · raw message
tools/libxc/xc_vm_event.c +2 -2
@@ -22,7 +22,7 @@#include "xc_private.h" -int xc_vm_event_control (xc_interface *xch,domid_t domain_id,unsigned int op, +int xc_vm_event_control (xc_interface *xch,uint32_t domain_id,unsigned int op,unsigned int mode,uint32_t *port) {DECLARE_DOMCTL ;
@@ -39,7 +39,7 @@ int xc_vm_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,return rc; } -void *xc_vm_event_enable (xc_interface *xch,domid_t domain_id,int param, +void *xc_vm_event_enable (xc_interface *xch,uint32_t domain_id,int param,uint32_t *port) {void *ring_page =NULL ;
tools/libxc/xg_private.c +1 -1
@@ -161,7 +161,7 @@ char *xc_inflate_buffer(xc_interface *xch,/*******************/ int pin_table ( -xc_interface *xch,unsigned int type,unsigned long mfn,domid_t dom) +xc_interface *xch,unsigned int type,unsigned long mfn,uint32_t dom) {struct mmuext_op op;
tools/libxc/xg_private.h +1 -1
@@ -142,6 +142,6 @@ static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,#define MADDR_MASK_X86 (MFN_MASK_X86 << PAGE_SHIFT_X86)int pin_table (xc_interface *xch,unsigned int type,unsigned long mfn, -domid_t dom); +uint32_t dom);#endif /* XG_PRIVATE_H */
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 7 lines · Andrew Cooper
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.
I would rather using domid_t throughout in libxc. Is there any problem with that?
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines · Wei Liu
Quoted 7 lines · Andrew Cooper
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.I would rather using
domid_tthroughout in libxc. Is there any problem with that?
That would cause implicit truncation between libxl's idea of a domid, and libxc's idea of a domid. In practice, it means any libxl domid with the upper 16 bits set may start to work (on the wrong domain!) where they may have failed previously.
Finally, it won't fix the INVALID_DOMID constant problem, as xc_dom.h leaks fully into libxl.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · Andrew Cooper
Quoted 7 lines · Wei Liu
Quoted 6 lines · Andrew Cooper
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)
Quoted 9 lines
Quoted 3 lines
Quoted 1 line
Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.I would rather using
domid_tthroughout in libxc. Is there any problem with that?That would cause implicit truncation between libxl's idea of a domid, and libxc's idea of a domid. In practice, it means any libxl domid with the upper 16 bits set may start to work (on the wrong domain!) where they may have failed previously.
But that's already the case for a lot of hypercalls -- domid_t is widely used in public headers. The truncation happens regardless of what libxc uses.
Quoted 3 lines
Finally, it won't fix the
INVALID_DOMIDconstant problem, asxc_dom.hleaks fully into libxl.
Sorry, I don't follow. What do you want to do?
Surely INVALID_DOMID should be part of public ABI? How does something in xc_dom.h leaking (what is leaking?) change that?
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 12 lines · Wei Liu
Quoted 11 lines · Andrew Cooper
Quoted 10 lines · Wei Liu
Quoted 7 lines · Andrew Cooper
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.I would rather using
domid_tthroughout in libxc. Is there any problem with that?
Quoted 8 lines
Quoted 5 lines
That would cause implicit truncation between libxl's idea of a domid, and libxc's idea of a domid. In practice, it means any libxl domid with the upper 16 bits set may start to work (on the wrong domain!) where they may have failed previously.
But that's already the case for a lot of hypercalls --
domid_tis widely used in public headers. The truncation happens regardless of what libxc uses.
True.
Quoted 5 lines
Quoted 4 lines
Finally, it won't fix the
INVALID_DOMIDconstant problem, asxc_dom.hleaks fully into libxl.Sorry, I don't follow. What do you want to do?
What this patch does, and move everything to using uint32_t.
Quoted 2 lines
Surely
INVALID_DOMIDshould be part of public ABI?
There is no need for any users of the libxl, libxc or Xen public API to pass an invalid domid.
However, there is a need for those libraries internally to have the notion of an invalid domid for initialisation/checking purposes.
Quoted 2 lines
How does something in
xc_dom.hleaking (what is leaking?) change that?
Currently, libxl_internal.h has
#define INVALID_DOMID ~0
As part of the gnt/dombuidler series, I needed to add INVALID_DOMID to xc_dom.h so I can initialise dom->{console,xenstore}_domid with something which doesn't alias 0 (which is a valid domid), and use it later to confirm that the caller has passed appropriate values.
libxl_internal.h includes xc_dom.h, so the define has to move rather than being duplicated.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Andrew Cooper writes ("[PATCH] tools/libxc: Fix domid parameter types"):
Quoted 7 lines
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.
I like this plan. But I think this comes a bit late for 4.10 ?
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 9 lines · Ian Jackson
Andrew Cooper writes ("[PATCH]
tools/libxc: Fix domid parameter types"):Quoted 7 lines
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.I like this plan. But I think this comes a bit late for 4.10 ?
I'm sorry for it being late, but it is blocking my other series to fix gnttab construction in the domain builder, which really is 4.10 material.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu
Acked-byQuoted 8 lines · Andrew Cooper
Quoted 7 lines · Ian Jackson
Andrew Cooper writes ("[PATCH]
tools/libxc: Fix domid parameter types"):Quoted 6 lines
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)
Quoted 6 lines
Quoted 2 lines
Quoted 1 line
Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.I like this plan. But I think this comes a bit late for 4.10 ?
I'm sorry for it being late, but it is blocking my other series to fix gnttab construction in the domain builder, which really is 4.10 material.
OK. I don't want to block the more important work.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu writes ("Re: [PATCH] tools/libxc: Fix domid parameter types"):
Quoted 3 lines · Andrew Cooper
Quoted 2 lines
I'm sorry for it being late, but it is blocking my other series to fix gnttab construction in the domain builder, which really is 4.10 material.
Ah. OK.
Quoted 3 lines
OK. I don't want to block the more important work.
Acked-by Wei Liu <[email protected]>
Do we need a release ack ? Julien ? I am happy for this to go in.
(Also, my qemu depriv series is outstanding and it would probably be easier for me to fix that up after Andrew's changes than vice versa.)
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 5 lines · Ian Jackson
Wei Liu writes ("Re: [PATCH]
tools/libxc: Fix domid parameter types"):Quoted 3 lines · Andrew Cooper
Quoted 2 lines
I'm sorry for it being late, but it is blocking my other series to fix gnttab construction in the domain builder, which really is 4.10 material.
Quoted 7 lines
Ah. OK.
Quoted 3 lines
OK. I don't want to block the more important work.
Acked-by Wei Liu <[email protected]>Do we need a release ack ? Julien ? I am happy for this to go in.
Cheers,
Quoted 10 lines
(Also, my qemu depriv series is outstanding and it would probably be easier for me to fix that up after Andrew's changes than vice versa.)
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · Andrew Cooper
Mixed throughout libxc are
uint32_t, int, anddomid_tfor domid parameters. With a signed type, and an explicitly 16-bit type, it is exceedingly difficult to construct anINVALID_DOMIDconstant which works with all of them. (The main problem being thatdomid_tgets unconditionally zero extended when promoted to int for arithmatic.)Libxl uses
uint32_tconsistently everywhere, so alter libxc to match.
The following diff is required:
tools/libxl/libxl_dom_save.c +1 -1
@@ -149,7 +149,7 @@ static void domain_suspend_switch_qemu_logdirty_done }void libxl__domain_suspend_common_switch_qemu_logdirty - (int domid,unsigned enable,void *user) + (uint32_t domid,unsigned enable,void *user) {libxl__save_helper_state *shs = user;libxl__egc *egc = shs->egc;
tools/libxl/libxl_internal.h +1 -1
@@ -3793,7 +3793,7 @@ void libxl__xc_domain_saverestore_async_callback_done(libxl__egc *egc, _hidden void libxl__domain_suspend_common_switch_qemu_logdirty - (int domid,unsigned int enable,void *data); + (uint32_t domid,unsigned int enable,void *data); _hidden void libxl__domain_common_switch_qemu_logdirty(libxl__egc *egc,int domid,unsigned enable,libxl__logdirty_switch *lds);
tools/libxl/libxl_save_msgs_gen.pl +1 -1
@@ -27,7 +27,7 @@ our @msgs = ( [ 4, 'srcxA', "postcopy", [] ], [ 5, 'srcxA', "checkpoint", [] ], [ 6, 'srcxA', "wait_checkpoint", [] ], - [ 7, 'scxA', "switch_qemu_logdirty", [qw(int domid + [ 7, 'scxA', "switch_qemu_logdirty", [qw(uint32_t domid unsigned enable)] ], [ 8, 'rcx', "restore_results", ['xen_pfn_t', 'store_gfn', 'xen_pfn_t', 'console_gfn'] ],
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel