From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2] libxc: try to find last used pfn when migrating Date: Wed, 2 Dec 2015 12:36:28 +0000 Message-ID: <565EE5CC.50208@citrix.com> References: <1449042137-25804-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1449042137-25804-1-git-send-email-jgross@suse.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: Juergen Gross , xen-devel@lists.xen.org, Ian.Campbell@citrix.com, ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com, wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On 02/12/15 07:42, Juergen Gross wrote: > diff --git a/tools/libxc/xc_sr_save_x86_hvm.c b/tools/libxc/xc_sr_save_x86_hvm.c > index cdee774..3c879ed 100644 > --- a/tools/libxc/xc_sr_save_x86_hvm.c > +++ b/tools/libxc/xc_sr_save_x86_hvm.c > @@ -135,6 +135,20 @@ static int x86_hvm_normalise_page(struct xc_sr_context *ctx, > static int x86_hvm_setup(struct xc_sr_context *ctx) > { > xc_interface *xch = ctx->xch; > + xen_pfn_t nr_pfns; > + > + if ( xc_domain_nr_gpfns(xch, ctx->domid, &nr_pfns) < 0 ) > + { > + PERROR("Unable to obtain the guest p2m size"); > + return -1; > + } > + if ( nr_pfns > ~XEN_DOMCTL_PFINFO_LTAB_MASK ) > + { > + PERROR("Cannot save this big a guest"); Strictly speaking to match the moved code, this should set errno = E2BIG. However, the error handling in libxc is in a dire state, and the error message is retained, which is the important point. Entire patch Reviewed-by: Andrew Cooper with or without the errno tweaks. ~Andrew