From: Ian Campbell Subject: Re: [PATCH] Rlibxl: refuse to try and migrate an HVM guest using qemu-xen Date: Mon, 23 Jul 2012 11:58:56 +0100 Message-ID: <1343041136.4091.20.camel@zakaz.uk.xensource.com> References: <20461.36759.685003.44867@mariner.uk.xensource.com> <1340970454.10942.97.camel@zakaz.uk.xensource.com> <1340973172.10942.98.camel@zakaz.uk.xensource.com> <1340985702.10942.136.camel@zakaz.uk.xensource.com> <20461.53730.596591.328470@mariner.uk.xensource.com> <1341227946.4625.27.camel@zakaz.uk.xensource.com> <20493.11490.357950.704823@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20493.11490.357950.704823@mariner.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: Ian Jackson Cc: Anthony Perard , "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 2012-07-23 at 11:52 +0100, Ian Jackson wrote: > Ian Campbell writes ("Re: [PATCH] Rlibxl: refuse to try and migrate an HVM guest using qemu-xen"): > > diff -r d29a88850da2 -r c6a2abdee84d tools/libxl/libxl.c > > --- a/tools/libxl/libxl.c Mon Jul 02 12:06:22 2012 +0100 > > +++ b/tools/libxl/libxl.c Mon Jul 02 12:13:25 2012 +0100 > > @@ -746,6 +746,22 @@ int libxl_domain_suspend(libxl_ctx *ctx, > ... > > + switch (libxl__device_model_version_running(gc, domid)) { > > + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: > > + LOG(ERROR, > > + "cannot live migrate HVM domains with qemu-xen device-model"); > > + rc = ERROR_FAIL; > > + goto out_err; > > + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: > > + /* No problem */ > > + break; > > + default: > > + rc = ERROR_FAIL; > > + goto out_err; > > + } > > This last case should abort() or log something or not exist. I think case -1: rc = ERROR_FAIL goto out_err; default: abort() would be OK for 4.2. libxl__device_model_version_running either returns -1 (and logs) or a valid LIBXL_DEVICE_MODEL_VERSION_* so the only thing to catch is a new LIBXL_DEVICE_MODEL_VERSION_*, in which case an abort() seems appropriate since it would be a bug to not handle it here. Possibly -1 ought to become LIBXL_DEVICE_MODEL_VERSION_INVALID too Ian.