From: Christoph Egger <Christoph.Egger@amd.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [PATCH] libxl: Introduce LIBXL_DOMAIN_TYPE_INVALID to make gcc happy
Date: Fri, 18 May 2012 14:21:10 +0200 [thread overview]
Message-ID: <4FB63EB6.10803@amd.com> (raw)
In-Reply-To: <4FB63171.3020102@amd.com>
[-- Attachment #1: Type: text/plain, Size: 661 bytes --]
Introduce LIBXL_DOMAIN_TYPE_INVALID.
Change libxl__domain_type() to return LIBXL_DOMAIN_TYPE_INVALID rather
hardcoding -1.
Adjust code pieces where gcc 4.5.3 claims that LIBXL_DOMAIN_TYPE_INVALID
is not handled.
This fixes the build error with gcc 4.5.3 reported here:
http://lists.xen.org/archives/html/xen-devel/2012-05/msg01269.html
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_libxl.diff --]
[-- Type: text/plain, Size: 1985 bytes --]
diff -r 99263132665b tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Fri May 18 12:38:55 2012 +0200
+++ b/tools/libxl/libxl.c Fri May 18 14:10:47 2012 +0200
@@ -1230,7 +1230,7 @@ int libxl_primary_console_exec(libxl_ctx
case LIBXL_DOMAIN_TYPE_PV:
rc = libxl_console_exec(ctx, domid_vm, 0, LIBXL_CONSOLE_TYPE_PV);
break;
- case -1:
+ case LIBXL_DOMAIN_TYPE_INVALID:
LOG(ERROR,"unable to get domain type for domid=%"PRIu32,domid_vm);
rc = ERROR_FAIL;
break;
diff -r 99263132665b tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c Fri May 18 12:38:55 2012 +0200
+++ b/tools/libxl/libxl_dm.c Fri May 18 14:10:47 2012 +0200
@@ -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;
}
ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);
diff -r 99263132665b tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c Fri May 18 12:38:55 2012 +0200
+++ b/tools/libxl/libxl_dom.c Fri May 18 14:10:47 2012 +0200
@@ -33,9 +33,9 @@ libxl_domain_type libxl__domain_type(lib
ret = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
if (ret != 1)
- return -1;
+ return LIBXL_DOMAIN_TYPE_INVALID;
if (info.domain != domid)
- return -1;
+ return LIBXL_DOMAIN_TYPE_INVALID;
if (info.flags & XEN_DOMINF_hvm_guest)
return LIBXL_DOMAIN_TYPE_HVM;
else
[-- Attachment #3: 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-18 12:21 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 ` Christoph Egger [this message]
2012-05-18 14:30 ` [PATCH] libxl: Introduce LIBXL_DOMAIN_TYPE_INVALID to make gcc happy 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
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=4FB63EB6.10803@amd.com \
--to=christoph.egger@amd.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).