From: Ian Jackson Subject: Re: [PATCH] libxl: fix dm destruction when there is no pid Date: Fri, 4 May 2012 18:18:51 +0100 Message-ID: <20388.3963.30725.320365@mariner.uk.xensource.com> References: <1336048277-39554-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1336048277-39554-1-git-send-email-roger.pau@citrix.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: Roger Pau Monne Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[Xen-devel] [PATCH] libxl: fix dm destruction when there is no pid"): > Fix qemu dm model destruction if the pid in xenstore is 0 (or is not > present). Firstly, this needs rewrapping. Secondly, > pid = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/image/device-model-pid", domid)); > if (!pid) { > + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't find device model's pid"); > + ret = ERROR_INVAL; > + goto out; > + } > + if (!atoi(pid)) { > int stubdomid = libxl_get_stubdom_id(ctx, domid); This seems to change the logic regarding stubdoms. Are you sure this is correct ? Previously if the entry didn't exist, we took the stubdom path. > - xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid)); > - xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/hvmloader", domid)); > > out: > + xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid)); > + xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/hvmloader", domid)); While moving this, you might as well rewrap it (or use GCSPRINTF). Ian.