From: Roger Pau Monne <roger.pau@citrix.com>
To: Dario Faggioli <raistlin@linux.it>
Cc: Christoph Egger <Christoph.Egger@amd.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2] libxl: introduce LIBXL_DOMAIN_TYPE_INVALID
Date: Thu, 24 May 2012 12:26:38 +0100 [thread overview]
Message-ID: <4FBE1AEE.8000003@citrix.com> (raw)
In-Reply-To: <a3a8dd4938dd4b0e51b3.1337786875@Solace>
Dario Faggioli wrote:
> To avoid recent gcc complaining about:
> libxl.c: In function ‘libxl_primary_console_exec’:
> libxl.c:1233:9: error: case value ‘4294967295’ not in enumerated type ‘libxl_domain_type’ [-Werror=switch]
>
> Adjust code pieces where -Wswitch makes it claim that
> LIBXL_DOMAIN_TYPE_INVALID is not handled.
Thanks for the patch I've tried it and works ok, so the below comment is
just a suggestion about error handling.
> Signed-off-by: Dario Faggioli<dario.faggioli@citrix.com>
> Signed-off-by: Christoph Egger<Christoph.Egger@amd.com>
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -257,6 +257,8 @@ static char ** libxl__build_device_model
> for (i = 0; b_info->extra_hvm&& b_info->extra_hvm[i] != NULL; i++)
> flexarray_append(dm_args, b_info->extra_hvm[i]);
> break;
> + case LIBXL_DOMAIN_TYPE_INVALID:
> + break;
> }
> flexarray_append(dm_args, NULL);
> return (char **) flexarray_contents(dm_args);
> @@ -505,6 +507,8 @@ static char ** libxl__build_device_model
> for (i = 0; b_info->extra_hvm&& b_info->extra_hvm[i] != NULL; i++)
> flexarray_append(dm_args, b_info->extra_hvm[i]);
> break;
> + case LIBXL_DOMAIN_TYPE_INVALID:
> + break;
> }
I think we should use "default" here (and on the previous one), print an
error message, and probably return NULL. I guess we are going to get an
error at some point later, so I think it's better to catch it here.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2012-05-24 11:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 15:27 [PATCH v2] libxl: introduce LIBXL_DOMAIN_TYPE_INVALID Dario Faggioli
2012-05-24 11:26 ` Roger Pau Monne [this message]
2012-05-24 12:51 ` Dario Faggioli
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=4FBE1AEE.8000003@citrix.com \
--to=roger.pau@citrix.com \
--cc=Christoph.Egger@amd.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=raistlin@linux.it \
--cc=xen-devel@lists.xen.org \
/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.