From bed7d79afb493674b394f11d32991b7ffba2adac Mon Sep 17 00:00:00 2001 From: Tamas K Lengyel Date: Wed, 11 Oct 2023 12:29:56 -0400 Subject: [PATCH] Use xc_domaininfo_t (#1725) * Use xc_domaininfo_t * Update LibVMI --- libvmi | 2 +- src/xen_helper/private.h | 6 +++--- src/xen_helper/xen_helper.c | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libvmi b/libvmi index e2313ccfe..f47a56814 160000 --- a/libvmi +++ b/libvmi @@ -1 +1 @@ -Subproject commit e2313ccfe01f93cb1eaa148000823a8e3239d251 +Subproject commit f47a5681423a7b20d95ac7021198e98789e57866 diff --git a/src/xen_helper/private.h b/src/xen_helper/private.h index 23717c540..99c1669b2 100644 --- a/src/xen_helper/private.h +++ b/src/xen_helper/private.h @@ -122,7 +122,7 @@ static const char* xc_functions[] = "xc_evtchn_open", "xc_evtchn_close", "xc_evtchn_fd", - "xc_domain_getinfo", + "xc_domain_getinfolist", "xc_domctl", "xc_domain_pause", "xc_domain_unpause", @@ -164,8 +164,8 @@ struct xenlibwrapper int (*xc_evtchn_fd) (xc_evtchn* xce); - int (*xc_domain_getinfo) - (xc_interface* xch, uint32_t first_domid, unsigned int max_doms, xc_dominfo_t* info); + int (*xc_domain_getinfolist) + (xc_interface* xch, uint32_t first_domid, unsigned int max_doms, xc_domaininfo_t* info); int (*xc_domctl) (xc_interface* xch, struct xen_domctl* domctl); diff --git a/src/xen_helper/xen_helper.c b/src/xen_helper/xen_helper.c index aebc32181..d33a105be 100644 --- a/src/xen_helper/xen_helper.c +++ b/src/xen_helper/xen_helper.c @@ -271,10 +271,10 @@ int xen_get_dom_info(xen_interface_t* xen, const char* input, domid_t* domID, else { - xc_dominfo_t info = { 0 }; + xc_domaininfo_t info = { 0 }; - if ( 1 == xen->xlw.xc_domain_getinfo(xen->xc, _domID, 1, &info) - && info.domid == _domID) + if ( 1 == xen->xlw.xc_domain_getinfolist(xen->xc, _domID, 1, &info) + && info.domain == _domID) { _name = xen->xlw.libxl_domid_to_name(xen->xl_ctx, _domID); } @@ -292,10 +292,10 @@ int xen_get_dom_info(xen_interface_t* xen, const char* input, domid_t* domID, uint64_t xen_get_maxmemkb(xen_interface_t* xen, domid_t domID) { - xc_dominfo_t info = { 0 }; + xc_domaininfo_t info = { 0 }; - if ( 1 == xen->xlw.xc_domain_getinfo(xen->xc, domID, 1, &info) && info.domid == domID) - return info.max_memkb; + if ( 1 == xen->xlw.xc_domain_getinfolist(xen->xc, domID, 1, &info) && info.domain == domID) + return info.max_pages << (XC_PAGE_SHIFT-10); return 0; } @@ -325,9 +325,9 @@ void xen_force_resume(xen_interface_t* xen, domid_t domID) { do { - xc_dominfo_t info = {0}; + xc_domaininfo_t info = {0}; - if (1 == xen->xlw.xc_domain_getinfo(xen->xc, domID, 1, &info) && info.domid == domID && info.paused) + if (1 == xen->xlw.xc_domain_getinfolist(xen->xc, domID, 1, &info) && info.domain == domID && (info.flags & XEN_DOMINF_paused)) xen->xlw.xc_domain_unpause(xen->xc, domID); else break;