Skip to content

Commit

Permalink
Use xc_domaininfo_t (#1725)
Browse files Browse the repository at this point in the history
* Use xc_domaininfo_t

* Update LibVMI
  • Loading branch information
tklengyel authored Oct 11, 2023
1 parent f67ddb0 commit bed7d79
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/xen_helper/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions src/xen_helper/xen_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bed7d79

Please sign in to comment.