mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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:
1 parent
c8040aefe6
commit
b7d885695f
2 files changed
+8
-2
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||