WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] pyGrub: Implement error handling on kernel/initr

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] pyGrub: Implement error handling on kernel/initrd extraction
From: Michal Novotny <minovotn@xxxxxxxxxx>
Date: Tue, 27 Jul 2010 10:49:03 +0200
Cc: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 27 Jul 2010 01:51:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19533.43140.441316.310245@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4C4D94D8.3040609@xxxxxxxxxx> <19533.43140.441316.310245@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4
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.

Michal

--
Michal Novotny<minovotn@xxxxxxxxxx>, RHCE
Virtualization Team (xen userspace), Red Hat


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel