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: do not overload RuntimeError for "no men

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] pygrub: do not overload RuntimeError for "no menu.lst found"
From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Date: Thu, 20 Oct 2011 10:51:36 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 20 Oct 2011 01:52:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1319099559.3385.121.camel@xxxxxxxxxxxxxxxxxxxxxx>
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: <bd1f7361d3d7f4c767af.1319096998@xxxxxxxxxxxxxxxxxxxxxxx> <1319099559.3385.121.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0
On 10/20/2011 10:32 AM, Ian Campbell wrote:
>  From:pbonzini@xxxxxxxxxx
>
>  # HG changeset patch
>  # User Paolo Bonzini<pbonzini@xxxxxxxxxx>
>  # Date 1319096986 -7200
>  # Node ID bd1f7361d3d7f4c767af21317fb4ec7ea1372f42
>  # Parent  1b110e895e285f43f14532e14c77597e54a0bcd2
>  pygrub will still try the next partition if run_grub exits with a
>  "real" error, thus hiding the root cause from the trace.  Defining
>  a separate exception for "no bootloader config file found" avoids
>  this.

Are all the other RuntimeError's ok or should we be defining a bunch of
more specific exceptions?

get_solaris_slice triggers RuntimeErrors which are eaten by the caller. That's not too nice and could also be replaced by NotFoundError, but it does not hide as many possible errors as run_grub.

read_config triggers a RuntimeError if it cannot find the file image itself. It is called via run_grub (which calls the Grub constructor), so it will become a hard failure after this patch. This is intended; not finding the file image is very wrong.

Grub2ConfigFile triggers RuntimeErrors if it fails to parse the grub.cfg file (wrong menuentry nesting, missing braces, unexpected braces). This is also called via run_grub and will become a hard failure. The new behavior is better than looking for another boot partition, since the actual error is hidden and anyway it's very unlikely that there will be two boot partitions.

Other occurrences are only for the case of __name__ == "__main__", so they are unaffected by the patch.

We need a signed-off-by for this change, per DCO:
http://wiki.xen.org/xenwiki/SubmittingXenPatches

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>

Shall I resend, or can you add it while applying?

Paolo

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

<Prev in Thread] Current Thread [Next in Thread>