]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
libxc: eliminate static variables, use xentoollog; API change
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 28 May 2010 08:30:19 +0000 (09:30 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 28 May 2010 08:30:19 +0000 (09:30 +0100)
This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).

Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.

There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.

All libxc callers have been adjusted accordingly.

Also update QEMU_TAG for corresponding qemu change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
lib/sys.c

index 9ce99544f5a57776ee51c1912b3b4476386237e7..42681742b8e999c2308fb3eff9d7ce916000f463 100644 (file)
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -84,7 +84,8 @@
 
 #define NOFILE 32
 extern int xc_evtchn_close(int fd);
-extern int xc_interface_close(int fd);
+struct xc_interface;
+extern int xc_interface_close_core(struct xc_interface*, int fd);
 extern int xc_gnttab_close(int fd);
 
 pthread_mutex_t fd_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -413,7 +414,7 @@ int close(int fd)
        }
 #endif
        case FTYPE_XC:
-           xc_interface_close(fd);
+           xc_interface_close_core(0,fd);
            return 0;
        case FTYPE_EVTCHN:
             xc_evtchn_close(fd);