From: Ian Jackson Subject: Re: [PATCH v2 5/5] libxl: spawns two QEMUs for HVM guests Date: Tue, 9 Jun 2015 11:02:28 +0100 Message-ID: <21878.47540.365857.882349@mariner.uk.xensource.com> References: <1433417299-3568-5-git-send-email-stefano.stabellini@eu.citrix.com> <20150607115251.GU29102@zion.uk.xensource.com> <21877.47166.670829.722550@mariner.uk.xensource.com> <21877.50507.506479.620721@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xensource.com, Wei Liu , Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("Re: [PATCH v2 5/5] libxl: spawns two QEMUs for HVM guests"): > On Mon, 8 Jun 2015, Ian Jackson wrote: > > I think the right answer is probably to start all the qemus in > > parallel, and count (or otherwise record) the spawn outcomes. > > They are already started in parallel with this patch. > Where should libxl_create.c:qdisk_spawn_outcome store the outcome? > Somewhere in dcs->build_state? Who would check for that? Each qemu already needs a record in the dcs, or hanging off it, for the libxl__ev_child. You can store the exit status (or an rc derived from it) there. The spawn_outcome function does something like this: int worst_rc = 0; libxl_report_child_exitstatus(...) dcs->qemus[myself]->rc = status ? ERROR_QEMU_DIED : 0; for (i=0; iqemus[i].childw)) return; if (dcs->qemus[i].rc IS WORSE THAN worst_rc) worst_rc = dcs->qemus[i].rc; } /* all qemus have completed */ if (worst_rc) domcreate_complete(egc, dcs, worst_rc) else domain_create_do_next_thing(egc, dcs, ...); Ian.