Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use xc_domaininfo_t #1725

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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