> -----Original Message----- > From: Xen-devel <xen-devel-boun...@lists.xenproject.org> On Behalf Of Jan > Beulich > Sent: 29 January 2020 13:00 > To: xen-devel@lists.xenproject.org > Cc: Andrew Cooper <andrew.coop...@citrix.com>; Paul Durrant > <p...@xen.org>; Wei Liu <w...@xen.org>; Roger Pau Monné > <roger....@citrix.com> > Subject: [Xen-devel] [PATCH v2] x86/HVM: relinquish resources also from > hvm_domain_destroy() > > Domain creation failure paths don't call domain_relinquish_resources(), > yet allocations and alike done from hvm_domain_initialize() need to be > undone nevertheless. Call the function also from hvm_domain_destroy(), > after making sure all descendants are idempotent. > > Note that while viridian_{domain,vcpu}_deinit() were already used in > ways suggesting they're idempotent, viridian_time_vcpu_deinit() actually > wasn't: One can't kill a timer that was never initialized. > > For hvm_destroy_all_ioreq_servers()'s purposes make > relocate_portio_handler() return whether the to be relocated port range > was actually found. This seems cheaper than introducing a flag into > struct hvm_domain's ioreq_server sub-structure. > > In hvm_domain_initialise() additionally > - use XFREE() also to replace adjacent xfree(), > - use hvm_domain_relinquish_resources() as being idempotent now. > There as well as in hvm_domain_destroy() the explicit call to > rtc_deinit() isn't needed anymore. > > In hvm_domain_relinquish_resources() additionally drop a no longer > relevant if(). > > Fixes: e7a9b5e72f26 ("viridian: separately allocate domain and vcpu > structures") > Fixes: 26fba3c85571 ("viridian: add implementation of synthetic timers") > Signed-off-by: Jan Beulich <jbeul...@suse.com>
LGTM Reviewed-by: Paul Durrant <pdurr...@amazon.com> > Reviewed-by: Roger Pau Monné <roger....@citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel