]> xenbits.xensource.com Git - xen.git/commitdiff
tools/libxc: change xc_memshr_fork_reset API to match hypervisor
authorTamas K Lengyel <tamas.lengyel@intel.com>
Tue, 26 Apr 2022 18:25:54 +0000 (14:25 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 May 2022 17:31:11 +0000 (18:31 +0100)
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>
tools/include/xenctrl.h
tools/libs/ctrl/xc_memshr.c

index 95bd5eca677f3f1d2b111aafa5a01435544052f6..1b089a2c0270e080c9caf9657e720396d2fd6844 100644 (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.
index a6cfd7dccf0a0b0281db73f25aaca1ffdf95450b..a0d0b894e2172c1433df4606a50c5f4cdc1e2373 100644 (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);
 }