From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] pyGrub: Implement error handling on kernel/initrd extraction Date: Tue, 27 Jul 2010 18:42:47 +0200 Message-ID: <4C4F0C87.3050701@redhat.com> References: <4C4D94D8.3040609@redhat.com> <19533.43140.441316.310245@mariner.uk.xensource.com> <4C4E9D7F.1020008@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C4E9D7F.1020008@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Michal Novotny Cc: "'xen-devel@lists.xensource.com'" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On 07/27/2010 10:49 AM, Michal Novotny wrote: > On 07/26/2010 05:23 PM, Ian Jackson wrote: >> Michal Novotny writes ("[Xen-devel] [PATCH] pyGrub: Implement error >> handling on kernel/initrd extraction"): >>> Since we agreed that introduction of dom0-min-space is not the right way >>> to go, it's superseeded by this patch. >> ... >>> - os.write(tfd, data) >>> - os.close(tfd) >>> + try: >>> + os.write(tfd, data) >>> + os.close(tfd) >>> + except OSError, e: >>> + print>>sys.stderr, "pyGrub: %s" % str(e) >>> + sys.exit(1) >> Thanks, but this is not even slightly correct. >> >> Ian. > > Why not? It's been tested and working fine. The try/except block is > working fine and sys.exit(1) is necessary to terminate pyGrub. If os.write gets the OSError it will write the error message as part of the backtrace, and exit anyway. That said I could reproduce the failure Michal started from, which is this error: Error creating domain: (1, 'Internal error', 'xc_dom_do_gunzip: inflate failed (rc=-5)\\n') But I think xend can be forgiven for not treating very well about out-of-disk-space situations... let's just not care. Paolo