tools/libxc: change xc_memshr_fork_reset API to match hypervisor

Need to separately specify if the reset is for the memory or for the VM state,
or both.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
Tamas K Lengyel authored and Andrew Cooper committed 2022-05-18 18:31:11 +01:00
1 parent c8040aefe6
commit b7d885695f
2 files changed
+8 -2

No files matched your search

+2 -1
View File
@@ -2290,7 +2290,8 @@ int xc_memshr_fork(xc_interface *xch,
*
* With VMs that have a lot of memory this call may block for a long time.
*/
int xc_memshr_fork_reset(xc_interface *xch, uint32_t forked_domain);
int xc_memshr_fork_reset(xc_interface *xch, uint32_t forked_domain,
bool reset_state, bool reset_memory);
/* Debug calls: return the number of pages referencing the shared frame backing
* the input argument. Should be one or greater.
+6 -1
View File
@@ -257,12 +257,17 @@ int xc_memshr_fork(xc_interface *xch, uint32_t pdomid, uint32_t domid,
return xc_memshr_memop(xch, domid, &mso);
}
int xc_memshr_fork_reset(xc_interface *xch, uint32_t domid)
int xc_memshr_fork_reset(xc_interface *xch, uint32_t domid, bool reset_state,
bool reset_memory)
{
xen_mem_sharing_op_t mso;
memset(&mso, 0, sizeof(mso));
mso.op = XENMEM_sharing_op_fork_reset;
if ( reset_state )
mso.u.fork.flags |= XENMEM_FORK_RESET_STATE;
if ( reset_memory )
mso.u.fork.flags |= XENMEM_FORK_RESET_MEMORY;
return xc_memshr_memop(xch, domid, &mso);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.