[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] make pygrub cope better with big files in guest
On Tue, 29 May 2012, Ian Jackson wrote: M A Young writes ("Re: [Xen-devel] [PATCH] make pygrub cope better with big files in guest"):I am attaching the third version of this patch. The datafile object doesn't have an explicit close so this patch uses del to clean it. I was also using unlink incorrectly which is now fixed.Why does pygrub need to unlink the output files on error ? Shouldn't pygrub's caller do that ? libxl does. We were having a similar discussion on the thread about a rival patch http://lists.xen.org/archives/html/xen-devel/2012-05/msg01499.html I was playing it safe and removing the files quickly when an error occurs, possibly due to one of these files taking the available space. If the calling process will clear up properly and isn't going to be confused by incomplete files then the unlinking isn't needed. Also the two bits of code which read the kernel and ramdisk are now much larger and very similar to each other. Couldn't this be refactored to have less duplication ? The rival patch mentioned above does this, so that might be a reasonable alternative, though it doesn't handle the case of a huge grub (or similar) configuration file. On Tue, 2012-05-29 at 12:30 +0100, Ian Jackson wrote: And, would shutil.copyfileobj be of any use ? It goes back as far as Python 2.3 at least. It might do. I suspect that the fsimage is sufficiently like a file for that to work, though it would need to be tested. Michael Young _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |