From: Dario Faggioli <raistlin@linux.it>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Christoph Egger <Christoph.Egger@amd.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxl: Introduce LIBXL_DOMAIN_TYPE_INVALID to make gcc happy
Date: Tue, 22 May 2012 18:18:13 +0200 [thread overview]
Message-ID: <1337703493.27368.18.camel@Solace> (raw)
In-Reply-To: <1337699271.10118.140.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 2889 bytes --]
On Tue, 2012-05-22 at 16:07 +0100, Ian Campbell wrote:
> > > I did, I guess we need to check that all callers can cope with this new
> > > return value though?
> > >
> > Sure, that was only to be sure I got what you were saying. :-)
> >
> > What I'm not getting right now is whether or not a proper patch doing
> > such is still interesting or not? Also, how come am I almost the only
> > one seeing that issue? Does it relate to gcc version? :-O
>
> There's been a handful of other reports this week. It does seem to be to
> do with gcc version, yes.
>
Ok then, I didn't notice that. I went through the callers and they seem
to be fine with the change, as the return type of the function is pretty
much always converted to the enum (i.e., libxl_domain_type) and used in
a switch with a proper 'default' clause, in case they care about
something different from _HVM or _PV.
So, the below is what I'm using to build (and run) these days... Or was
it something different that you meant when saying "check that all
callers can cope with this" ?
(I can repost as a separate mail if wanted)
Dario
8<---------------------------
libxl: make libxl__domain_type return 'int'
To avoid gcc > 4.6.3 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]
Callers have been checked and are fine with the change.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
diff -r 6dc80df50fa8 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c Tue May 22 16:30:11 2012 +0200
+++ b/tools/libxl/libxl_dom.c Tue May 22 18:06:41 2012 +0200
@@ -25,7 +25,7 @@
#include "libxl_internal.h"
-libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
+int libxl__domain_type(libxl__gc *gc, uint32_t domid)
{
libxl_ctx *ctx = libxl__gc_owner(gc);
xc_domaininfo_t info;
diff -r 6dc80df50fa8 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Tue May 22 16:30:11 2012 +0200
+++ b/tools/libxl/libxl_internal.h Tue May 22 18:06:41 2012 +0200
@@ -714,7 +714,7 @@ int libxl__self_pipe_eatall(int fd); /*
/* from xl_dom */
-_hidden libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid);
+_hidden int libxl__domain_type(libxl__gc *gc, uint32_t domid);
_hidden int libxl__domain_shutdown_reason(libxl__gc *gc, uint32_t domid);
_hidden int libxl__sched_set_params(libxl__gc *gc, uint32_t domid, libxl_sched_params *scparams);
#define LIBXL__DOMAIN_IS_TYPE(gc, domid, type) \
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2012-05-22 16:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-18 11:24 libxl: build failure due to 'libxl_domain_type' Christoph Egger
2012-05-18 12:21 ` [PATCH] libxl: Introduce LIBXL_DOMAIN_TYPE_INVALID to make gcc happy Christoph Egger
2012-05-18 14:30 ` Dario Faggioli
2012-05-18 14:39 ` Ian Campbell
2012-05-18 14:48 ` Dario Faggioli
2012-05-18 14:55 ` Ian Campbell
2012-05-18 15:07 ` Dario Faggioli
2012-05-22 10:16 ` Ian Campbell
2012-05-22 14:58 ` Dario Faggioli
2012-05-22 15:07 ` Ian Campbell
2012-05-22 16:18 ` Dario Faggioli [this message]
2012-05-23 8:59 ` Christoph Egger
2012-05-23 9:23 ` Dario Faggioli
2012-05-23 9:30 ` Christoph Egger
2012-05-18 15:11 ` Christoph Egger
2012-05-18 15:22 ` Ian Campbell
2012-05-23 10:53 ` Ian Jackson
2012-05-23 11:17 ` Dario Faggioli
2012-05-23 12:37 ` Ian Jackson
2012-05-23 12:49 ` Dario Faggioli
2012-05-23 13:12 ` Dario Faggioli
2012-05-23 13:47 ` Christoph Egger
2012-05-23 14:36 ` Ian Jackson
2012-05-23 15:21 ` 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=1337703493.27368.18.camel@Solace \
--to=raistlin@linux.it \
--cc=Christoph.Egger@amd.com \
--cc=Ian.Campbell@citrix.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).