* [PATCH] xenctrl: Make the headers C++ friendly
@ 2014-07-02 16:30 Razvan Cojocaru
2014-07-03 10:56 ` George Dunlap
2014-07-16 14:48 ` Ian Campbell
0 siblings, 2 replies; 6+ messages in thread
From: Razvan Cojocaru @ 2014-07-02 16:30 UTC (permalink / raw)
To: xen-devel; +Cc: Ian.Jackson, tim, Ian.Campbell, Razvan Cojocaru, andrew.cooper3
Moved an enum definition before the typedef that uses it.
Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
tools/libxc/xenctrl.h | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index af6f249..abd8947 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -119,6 +119,16 @@ typedef struct xc_interface_core xc_interface;
typedef struct xc_interface_core xc_evtchn;
typedef struct xc_interface_core xc_gnttab;
typedef struct xc_interface_core xc_gntshr;
+
+enum xc_error_code {
+ XC_ERROR_NONE = 0,
+ XC_INTERNAL_ERROR = 1,
+ XC_INVALID_KERNEL = 2,
+ XC_INVALID_PARAM = 3,
+ XC_OUT_OF_MEMORY = 4,
+ /* new codes need to be added to xc_error_level_to_desc too */
+};
+
typedef enum xc_error_code xc_error_code;
@@ -1766,15 +1776,6 @@ int xc_hvm_inject_trap(
*/
-enum xc_error_code {
- XC_ERROR_NONE = 0,
- XC_INTERNAL_ERROR = 1,
- XC_INVALID_KERNEL = 2,
- XC_INVALID_PARAM = 3,
- XC_OUT_OF_MEMORY = 4,
- /* new codes need to be added to xc_error_level_to_desc too */
-};
-
#define XC_MAX_ERROR_MSG_LEN 1024
typedef struct xc_error {
enum xc_error_code code;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] xenctrl: Make the headers C++ friendly
2014-07-02 16:30 [PATCH] xenctrl: Make the headers C++ friendly Razvan Cojocaru
@ 2014-07-03 10:56 ` George Dunlap
2014-07-03 11:08 ` Razvan Cojocaru
2014-07-16 14:48 ` Ian Campbell
1 sibling, 1 reply; 6+ messages in thread
From: George Dunlap @ 2014-07-03 10:56 UTC (permalink / raw)
To: Razvan Cojocaru
Cc: Tim Deegan, Andrew Cooper, Ian Jackson, Ian Campbell,
xen-devel@lists.xen.org
On Wed, Jul 2, 2014 at 5:30 PM, Razvan Cojocaru
<rcojocaru@bitdefender.com> wrote:
> Moved an enum definition before the typedef that uses it.
Presumably you want this because you have an out-of-tree program that
you want to compile against libxc. You do realize that libxc isn't a
stable API, right? That it may change in incompatible ways in every
release?
I presume you'd rather use a stable API -- in which case maybe we
should ask what it is your application needs, and we can try to come
up with a way to support you. (Perhaps by declaring certain parts of
the libxc interface as "stable", if libxl isn't suitable for some
reason.)
-George
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xenctrl: Make the headers C++ friendly
2014-07-03 10:56 ` George Dunlap
@ 2014-07-03 11:08 ` Razvan Cojocaru
2014-07-03 11:29 ` Slutz, Donald Christopher
0 siblings, 1 reply; 6+ messages in thread
From: Razvan Cojocaru @ 2014-07-03 11:08 UTC (permalink / raw)
To: George Dunlap
Cc: Andrew Cooper, xen-devel@lists.xen.org, Tim Deegan, Ian Jackson,
Ian Campbell
On 07/03/2014 01:56 PM, George Dunlap wrote:
> On Wed, Jul 2, 2014 at 5:30 PM, Razvan Cojocaru
> <rcojocaru@bitdefender.com> wrote:
>> Moved an enum definition before the typedef that uses it.
>
> Presumably you want this because you have an out-of-tree program that
> you want to compile against libxc. You do realize that libxc isn't a
> stable API, right? That it may change in incompatible ways in every
> release?
Yes, I've glimpsed into that by following it since Xen 4.1.
I am indeed compiling an application against libxc.
> I presume you'd rather use a stable API -- in which case maybe we
> should ask what it is your application needs, and we can try to come
> up with a way to support you. (Perhaps by declaring certain parts of
> the libxc interface as "stable", if libxl isn't suitable for some
> reason.)
Thanks, that's a very gracious offer. Well, here's what nm has to say
about what I'm using from the Xen libraries:
xc_copy_to_domain_page
xc_domain_decrease_reservation_exact
xc_domain_get_tsc_info
xc_domain_getinfo
xc_domain_hvm_getcontext_partial
xc_domain_pause
xc_domain_populate_physmap_exact
xc_domain_set_access_required
xc_domain_set_pagefault_info
xc_domain_shutdown
xc_domain_unpause
xc_evtchn_bind_interdomain
xc_evtchn_close
xc_evtchn_fd
xc_evtchn_notify
xc_evtchn_open
xc_evtchn_pending
xc_evtchn_unbind
xc_evtchn_unmask
xc_get_hvm_param
xc_get_mem_access
xc_interface_close
xc_interface_open
xc_map_foreign_batch
xc_map_foreign_range
xc_mem_access_disable
xc_mem_access_enable
xc_mem_access_resume
xc_set_hvm_param
xc_set_mem_access
xc_translate_foreign_address
xc_vcpu_getcontext
xc_vcpu_setcontext
xc_version
xs_close
xs_directory
xs_fileno
xs_is_domain_introduced
xs_open
xs_read
xs_read_watch
xs_unwatch
xs_watch
Libxl is, unfortunately, too high-level for our needs.
Thanks,
Razvan Cojocaru
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xenctrl: Make the headers C++ friendly
2014-07-03 11:08 ` Razvan Cojocaru
@ 2014-07-03 11:29 ` Slutz, Donald Christopher
0 siblings, 0 replies; 6+ messages in thread
From: Slutz, Donald Christopher @ 2014-07-03 11:29 UTC (permalink / raw)
To: Razvan Cojocaru
Cc: Ian Campbell, Andrew Cooper, George Dunlap, Tim Deegan,
xen-devel@lists.xen.org, Ian Jackson
On 07/03/14 07:08, Razvan Cojocaru wrote:
> On 07/03/2014 01:56 PM, George Dunlap wrote:
>> On Wed, Jul 2, 2014 at 5:30 PM, Razvan Cojocaru
>> <rcojocaru@bitdefender.com> wrote:
>>> Moved an enum definition before the typedef that uses it.
>> Presumably you want this because you have an out-of-tree program that
>> you want to compile against libxc. You do realize that libxc isn't a
>> stable API, right? That it may change in incompatible ways in every
>> release?
> Yes, I've glimpsed into that by following it since Xen 4.1.
> I am indeed compiling an application against libxc.
I also have one that is both libxc and libxl in c++. I fixed it by
moving the
typedef:
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 13f816b..37031ad 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -119,7 +119,6 @@ typedef struct xc_interface_core xc_interface;
typedef struct xc_interface_core xc_evtchn;
typedef struct xc_interface_core xc_gnttab;
typedef struct xc_interface_core xc_gntshr;
-typedef enum xc_error_code xc_error_code;
/*
@@ -1756,14 +1755,14 @@ int xc_hvm_inject_trap(
*/
-enum xc_error_code {
+typedef enum xc_error_code {
XC_ERROR_NONE = 0,
XC_INTERNAL_ERROR = 1,
XC_INVALID_KERNEL = 2,
XC_INVALID_PARAM = 3,
XC_OUT_OF_MEMORY = 4,
/* new codes need to be added to xc_error_level_to_desc too */
-};
+} xc_error_code;
#define XC_MAX_ERROR_MSG_LEN 1024
typedef struct xc_error {
So I would like to see either of these done.
>> I presume you'd rather use a stable API -- in which case maybe we
>> should ask what it is your application needs, and we can try to come
>> up with a way to support you. (Perhaps by declaring certain parts of
>> the libxc interface as "stable", if libxl isn't suitable for some
>> reason.)
I have no need for a stable API; but it might allow the C++ code to not
include this file from /usr/include/xenctrl.h
-Don Slutz
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] xenctrl: Make the headers C++ friendly
2014-07-02 16:30 [PATCH] xenctrl: Make the headers C++ friendly Razvan Cojocaru
2014-07-03 10:56 ` George Dunlap
@ 2014-07-16 14:48 ` Ian Campbell
2014-07-16 14:58 ` Razvan Cojocaru
1 sibling, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2014-07-16 14:48 UTC (permalink / raw)
To: Razvan Cojocaru; +Cc: Ian.Jackson, andrew.cooper3, tim, xen-devel
On Wed, 2014-07-02 at 19:30 +0300, Razvan Cojocaru wrote:
> Moved an enum definition before the typedef that uses it.
>
> Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Previously the idea of C++ifying the headers has been controversial but
this particular patch seems OK.
Acked + applied.
Ian.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xenctrl: Make the headers C++ friendly
2014-07-16 14:48 ` Ian Campbell
@ 2014-07-16 14:58 ` Razvan Cojocaru
0 siblings, 0 replies; 6+ messages in thread
From: Razvan Cojocaru @ 2014-07-16 14:58 UTC (permalink / raw)
To: Ian Campbell; +Cc: andrew.cooper3, xen-devel, Ian.Jackson, tim
On 07/16/2014 05:48 PM, Ian Campbell wrote:
> On Wed, 2014-07-02 at 19:30 +0300, Razvan Cojocaru wrote:
>> Moved an enum definition before the typedef that uses it.
>>
>> Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
>> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Previously the idea of C++ifying the headers has been controversial but
> this particular patch seems OK.
>
> Acked + applied.
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-16 14:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02 16:30 [PATCH] xenctrl: Make the headers C++ friendly Razvan Cojocaru
2014-07-03 10:56 ` George Dunlap
2014-07-03 11:08 ` Razvan Cojocaru
2014-07-03 11:29 ` Slutz, Donald Christopher
2014-07-16 14:48 ` Ian Campbell
2014-07-16 14:58 ` Razvan Cojocaru
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.