On 17.07.2013 18:42, Jim Fehlig wrote: > Stefan Bader wrote: >> I tried to follow previous changes. This worked for me using Xen-4.3 >> and the xm stack (I know rather deprecated but as long as one can get >> it working, still). >> > > Agreed, we should keep the legacy driver working with the latest Xen > release until its dependencies (xm/xend) are completely removed. > >> -Stefan >> >> --- >> >> >From 4c36fb22f01689472f6e170a8df6e08fd8c27a42 Mon Sep 17 00:00:00 2001 >> From: Stefan Bader <stefan.bader@xxxxxxxxxxxxx> >> Date: Mon, 15 Jul 2013 19:25:23 +0200 >> Subject: [PATCH] xen: Add interface versions for Xen 4.3 >> >> Xen 4.3 changes sysctl version to 0xA and domctl version to 0x9. Update >> the hypervisor driver to work with those. >> >> Signed-off-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx> >> --- >> src/xen/xen_hypervisor.c | 129 ++++++++++++++++++++++++++++++++++------------ >> 1 file changed, 97 insertions(+), 32 deletions(-) >> >> diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c >> index 39e641e..ff92556 100644 >> --- a/src/xen/xen_hypervisor.c >> +++ b/src/xen/xen_hypervisor.c >> @@ -271,6 +271,24 @@ struct xen_v2d8_getdomaininfo { >> }; >> typedef struct xen_v2d8_getdomaininfo xen_v2d8_getdomaininfo; >> >> +struct xen_v2d9_getdomaininfo { >> + domid_t domain; /* the domain number */ >> + uint32_t flags; /* flags, see before */ >> + uint64_t tot_pages ALIGN_64; /* total number of pages used */ >> + uint64_t max_pages ALIGN_64; /* maximum number of pages allowed */ >> + uint64_t outstanding_pages ALIGN_64; >> + uint64_t shr_pages ALIGN_64; /* number of shared pages */ >> + uint64_t paged_pages ALIGN_64; /* number of paged pages */ >> + uint64_t shared_info_frame ALIGN_64; /* MFN of shared_info struct */ >> + uint64_t cpu_time ALIGN_64; /* CPU time used */ >> + uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */ >> + uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */ >> + uint32_t ssidref; >> + xen_domain_handle_t handle; >> + uint32_t cpupool; >> +}; >> +typedef struct xen_v2d9_getdomaininfo xen_v2d9_getdomaininfo; >> + >> union xen_getdomaininfo { >> struct xen_v0_getdomaininfo v0; >> struct xen_v2_getdomaininfo v2; >> @@ -278,6 +296,7 @@ union xen_getdomaininfo { >> struct xen_v2d6_getdomaininfo v2d6; >> struct xen_v2d7_getdomaininfo v2d7; >> struct xen_v2d8_getdomaininfo v2d8; >> + struct xen_v2d9_getdomaininfo v2d9; >> }; >> typedef union xen_getdomaininfo xen_getdomaininfo; >> >> @@ -288,6 +307,7 @@ union xen_getdomaininfolist { >> struct xen_v2d6_getdomaininfo *v2d6; >> struct xen_v2d7_getdomaininfo *v2d7; >> struct xen_v2d8_getdomaininfo *v2d8; >> + struct xen_v2d8_getdomaininfo *v2d9; >> }; >> typedef union xen_getdomaininfolist xen_getdomaininfolist; >> >> @@ -325,7 +345,9 @@ typedef struct xen_v2s5_availheap xen_v2s5_availheap; >> #define XEN_GETDOMAININFOLIST_ALLOC(domlist, size) \ >> (hv_versions.hypervisor < 2 ? \ >> (VIR_ALLOC_N(domlist.v0, (size)) == 0) : \ >> - (hv_versions.dom_interface >= 8 ? \ >> + (hv_versions.dom_interface >= 9 ? \ >> + (VIR_ALLOC_N(domlist.v2d9, (size)) == 0) : \ >> + (hv_versions.dom_interface == 8 ? \ >> (VIR_ALLOC_N(domlist.v2d8, (size)) == 0) : \ >> (hv_versions.dom_interface == 7 ? \ >> (VIR_ALLOC_N(domlist.v2d7, (size)) == 0) : \ >> @@ -333,12 +355,14 @@ typedef struct xen_v2s5_availheap xen_v2s5_availheap; >> (VIR_ALLOC_N(domlist.v2d6, (size)) == 0) : \ >> (hv_versions.dom_interface == 5 ? \ >> (VIR_ALLOC_N(domlist.v2d5, (size)) == 0) : \ >> - (VIR_ALLOC_N(domlist.v2, (size)) == 0)))))) >> + (VIR_ALLOC_N(domlist.v2, (size)) == 0))))))) >> > > I'll be happy when we can ignore changes to sysctl and domctl interface > in this driver so this madness can stop :). > > [...] >> >> >> @@ -1916,6 +1968,19 @@ xenHypervisorInit(struct xenHypervisorVersions *override_versions) >> } >> } >> >> + /* Xen 4.3 >> + * sysctl version A -> xen-4.3 release >> + * domctl version 9 -> xen-4.3 release >> > > I like to reference the commits that bump the versions, making it easy > to look at the interface changes. > >> + */ >> + hv_versions.sys_interface = 0xA; /* XEN_SYSCTL_INTERFACE_VERSION */ >> + if (virXen_getdomaininfo(fd, 0, &info) == 1) { >> + hv_versions.dom_interface = 0x9; /* XEN_DOMCTL_INTERFACE_VERSION */ >> + if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0) { >> + VIR_DEBUG("Using hypervisor call v2, sys verA dom ver9"); >> + goto done; >> + } >> > > Tabs here instead of spaces, caught by 'make syntax-check'. Ah good to know/remember that. A bit of a problem jumping between projects (the remember part). > > All of the existing logic uses decimal for the interface version > numbers. I've changed all uses of hex to decimal, added the commits > that bumped the versions, and pushed the patch. Thanks, yes I was struggling myself a bit which way to go. As for the references to commits. I would rather use git, previous references looked to be from mecurial. -Stefan > > Thanks for fixing this! > > Regards, > Jim > >> + } >> + >> hv_versions.hypervisor = 1; >> hv_versions.sys_interface = -1; >> if (virXen_getdomaininfo(fd, 0, &info) == 1) { >>
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list