From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v6 07/10] libxc: introduce soft reset for HVM domains Date: Wed, 20 May 2015 16:10:04 +0100 Message-ID: <555CA3CC.2080003@citrix.com> References: <1431510585-12544-1-git-send-email-vkuznets@redhat.com> <1431510585-12544-8-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yv5fL-0002TW-42 for xen-devel@lists.xenproject.org; Wed, 20 May 2015 15:12:15 +0000 In-Reply-To: <1431510585-12544-8-git-send-email-vkuznets@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov , xen-devel@lists.xenproject.org Cc: Andrew Jones , Keir Fraser , Ian Campbell , Stefano Stabellini , Andrew Cooper , Julien Grall , Ian Jackson , Olaf Hering , Tim Deegan , David Vrabel , Jan Beulich , Wei Liu , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org Hi Vitaly, On 13/05/15 10:49, Vitaly Kuznetsov wrote: > +int xc_domain_soft_reset(xc_interface *xch, uint32_t source_dom, > + uint32_t dest_dom, domid_t console_domid, > + unsigned long *console_mfn, domid_t store_domid, > + unsigned long *store_mfn) > +{ > + xc_dominfo_t old_info, new_info; > + int rc = 1; > + > + uint32_t hvm_buf_size = 0; > + uint64_t nr_trans; > + uint8_t *hvm_buf = NULL; > + unsigned long console_pfn, store_pfn, io_pfn, buffio_pfn; > + uint64_t hvm_params[HVM_NR_PARAMS]; > + xen_pfn_t sharedinfo_pfn; > + > + DPRINTF("%s: soft reset domid %u -> %u", __func__, source_dom, dest_dom); > + > + if ( xc_domain_getinfo(xch, source_dom, 1, &old_info) != 1 ) > + { > + PERROR("Could not get old domain info"); > + return 1; > + } > + > + if ( xc_domain_getinfo(xch, dest_dom, 1, &new_info) != 1 ) > + { > + PERROR("Could not get new domain info"); > + return 1; > + } xc_domain_getinfo returns the first domain ID used from dest_dom. If dest_dom doesn't exist it may return another domain. Therefore you have to check that the info correspond to the correct domain. Regards, -- Julien Grall