From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH for 4.6 v4 2/3] xl/libxl: disallow saving a guest with vNUMA configured Date: Fri, 11 Sep 2015 15:24:21 +0100 Message-ID: <1441981461.3549.54.camel@citrix.com> References: <1441979409-3064-1-git-send-email-wei.liu2@citrix.com> <1441979409-3064-3-git-send-email-wei.liu2@citrix.com> <1441980035.3549.41.camel@citrix.com> <20150911141415.GN1695@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZaPFc-0006by-QN for xen-devel@lists.xenproject.org; Fri, 11 Sep 2015 14:24:28 +0000 In-Reply-To: <20150911141415.GN1695@zion.uk.xensource.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: Wei Liu Cc: Xen-devel , Ian Jackson , andrew.cooper3@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2015-09-11 at 15:14 +0100, Wei Liu wrote: @@ -1636,6 +1638,20 @@ void libxl__domain_save(libxl__egc *egc, > libxl__domain_suspend_state *dss) > | (debug ? XCFLAGS_DEBUG : 0) > | (dss->hvm ? XCFLAGS_HVM : 0); > > + /* Disallow saving a guest with vNUMA configured because migration > + * stream does not preserve node information. > + * > + * Do not differentiate "no vnuma configuration" from "empty vnuma > + * configuration". > + */ > + rc = xc_domain_getvnuma(CTX->xch, domid, &nr_vnodes, &nr_vmemranges, > + &nr_vcpus, NULL, NULL, NULL); Sorry for not noticing this before but this is putting a non-libxl error code in a variable named rc, which is verboten in coding style. Not least because I think it is now possible to get through this function successfully without changing it from the rc == -1 which might be assigned here (in the case where xs_suspend_evtchn_port returns < 0). Ian. > + if (rc != -1 || errno != XEN_EOPNOTSUPP) { > + LOG(ERROR, "Cannot save a guest with vNUMA configured"); > + rc = ERROR_FAIL; > + goto out; > + } > + > dss->guest_evtchn.port = -1; > dss->guest_evtchn_lockfd = -1; > dss->guest_responded = 0;