All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Glauber de Oliveira Costa <gcosta@redhat.com>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] Error message for device not found at blkif.py
Date: Wed, 18 Oct 2006 15:59:30 -0500	[thread overview]
Message-ID: <453695B2.9080307@us.ibm.com> (raw)
In-Reply-To: <20061018200845.GB16266@redhat.com>

Instead of throwing a VmError, could you subclass VmError with a more 
specific error and throw that?

That will pass higher level info about the error to xm which means we 
can do a better job in there (this is especially important when we 
eventually localize xm).

Thanks,

Anthony Liguori


Glauber de Oliveira Costa wrote:
> Hi,
> 
> if blkdev_name_to_number() fails to assign a number to the specified
> device, it returns None, causing a far-away-from-self-explanatory
> message to be delivered. Better test for this condition and say exactly
> what happened.
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --- xen-3.0.3-testing-11633/./tools/python/build/lib.linux-x86_64-2.4/xen/xend/server/blkif.py.orig	2006-09-28 18:52:39.000000000 -0400
> +++ xen-3.0.3-testing-11633/./tools/python/build/lib.linux-x86_64-2.4/xen/xend/server/blkif.py	2006-10-18 15:58:28.000000000 -0400
> @@ -81,6 +81,9 @@ class BlkifController(DevController):
>                           'acm_policy' : policy})
>  
>          devid = blkif.blkdev_name_to_number(dev)
> +        if not devid:
> +            raise VmError('Unable to find number for device (%s)'%(dev))
> +
>          front = { 'virtual-device' : "%i" % devid,
>                    'device-type' : dev_type
>                  }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2006-10-18 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-18 20:08 [PATCH] Error message for device not found at blkif.py Glauber de Oliveira Costa
2006-10-18 20:59 ` Anthony Liguori [this message]
2006-10-18 21:28   ` Glauber de Oliveira Costa
2006-10-18 21:37     ` Anthony Liguori
2006-10-18 21:41     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=453695B2.9080307@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=gcosta@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.