From: Ian Jackson Subject: Re: [PATCH v2 3/5] libxl: xsrestrict QEMU Date: Mon, 8 Jun 2015 16:53:26 +0100 Message-ID: <21877.47734.651727.659516@mariner.uk.xensource.com> References: <1433417299-3568-3-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1433417299-3568-3-git-send-email-stefano.stabellini@eu.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: Stefano Stabellini Cc: xen-devel@lists.xensource.com, wei.liu2@citrix.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("[PATCH v2 3/5] libxl: xsrestrict QEMU"): > Check whether QEMU supports the xsrestrict option, by parsing its --help > output. Store the result on xenstore for future reference on a per QEMU > binary basis, so that device_model_override still works fine with it. ... > + pid = fork(); > + if (pid < 0) > + return ERROR_FAIL; Sadly, direct use of fork is forbidden. See the doc comment for libxl__ev_child_fork. I hereby volunteer to fix this. But we should probably wait for this series to settle down a bit first, as what you have done is suitable for testing with xl, at least. For now, please add a note to the commit message subject ("WIP" or "RFC" or something). And, I spotted this: > + /* father parses the output */ Normally we use "parent" rather than imputing gender to processes... > + s = libxl__strdup(gc, dm); > + libxl__replace_chr(gc, s, '/', '_'); > + s = libxl__sprintf(gc, "libxl/%s/%s", s, opt); > + buf = libxl__xs_read(gc, XBT_NULL, s); > + if (buf != NULL) > + return !strcmp(buf, "1"); This cacheing mechanism is pretty nasty. Wouldn't it be better to save the qemu help output in a disk file, or something ? Ian.