From: Ian Jackson Subject: Re: [PATCH] xl, libxl: Add per-device and global permissive config options for pci passthrough Date: Thu, 29 Mar 2012 15:34:50 +0100 Message-ID: <20340.29450.734768.962985@mariner.uk.xensource.com> References: <980c34bd5e5127bbe985.1332867786@kodo2> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <980c34bd5e5127bbe985.1332867786@kodo2> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org George Dunlap writes ("[Xen-devel] [PATCH] xl, libxl: Add per-device and global permissive config options for pci passthrough"): > + /* Don't restrict writes to the PCI config space from this VM */ > + if(pcidev->permissive) { Missing space after "if". > + sysfs_path = libxl__sprintf(gc, SYSFS_PCIBACK_DRIVER"/permissive"); > + f = fopen(sysfs_path, "w"); ... > + fprintf(f, PCI_BDF, pcidev->domain, pcidev->bus, > + pcidev->dev, pcidev->func); > + fclose(f); Do this fprintf and fclose need error checking at all ? If the actual write fails, atm you will ignore it. I agree with most of the other comments. TBH although it would be nice to move this parsing to libxlu I don't think you should be required to do it as part of this patch. But I'd encourage you to do so :-). Thanks, Ian.