]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
x86/hvm: add domain_relinquish_resources() method
authorPaul Durrant <pdurrant@amazon.com>
Fri, 24 Jan 2020 15:30:58 +0000 (15:30 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 25 Jan 2020 18:43:32 +0000 (18:43 +0000)
There are two functions in hvm.c to deal with tear-down and a domain:
hvm_domain_relinquish_resources() and hvm_domain_destroy(). However, only
the latter has an associated method in 'hvm_funcs'. This patch adds
a method for the former.

A subsequent patch will define a VMX implementation.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c
xen/include/asm-x86/hvm/hvm.h

index d89959488814fdbaa35c7f487252ca6ae4e3cd60..6333ae6aba55a5260572a0aa2d26a555211b1676 100644 (file)
@@ -716,6 +716,9 @@ int hvm_domain_initialise(struct domain *d)
 
 void hvm_domain_relinquish_resources(struct domain *d)
 {
+    if ( hvm_funcs.domain_relinquish_resources )
+        alternative_vcall(hvm_funcs.domain_relinquish_resources, d);
+
     if ( hvm_funcs.nhvm_domain_relinquish_resources )
         hvm_funcs.nhvm_domain_relinquish_resources(d);
 
index 09793c12e97f26daadd86bfee1058dc6831a4d64..9eab1d749376252f125ffe0a204fec8648f6c3f2 100644 (file)
@@ -107,6 +107,7 @@ struct hvm_function_table {
      * Initialise/destroy HVM domain/vcpu resources
      */
     int  (*domain_initialise)(struct domain *d);
+    void (*domain_relinquish_resources)(struct domain *d);
     void (*domain_destroy)(struct domain *d);
     int  (*vcpu_initialise)(struct vcpu *v);
     void (*vcpu_destroy)(struct vcpu *v);