[libvirt] [go PATCH 14/37] qemu: move wrapper functions out of compat header

Daniel P. Berrangé berrange at redhat.com
Mon Jul 16 13:24:00 UTC 2018


Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 qemu_compat.go  | 48 ------------------------------------------------
 qemu_compat.h   |  3 ---
 qemu_wrapper.go | 10 ++++++++++
 qemu_wrapper.h  |  3 +++
 4 files changed, 13 insertions(+), 51 deletions(-)
 delete mode 100644 qemu_compat.go

diff --git a/qemu_compat.go b/qemu_compat.go
deleted file mode 100644
index 6cd28b0..0000000
--- a/qemu_compat.go
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of the libvirt-go project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * Copyright (c) 2013 Alex Zorin
- * Copyright (C) 2016 Red Hat, Inc.
- *
- */
-
-package libvirt
-
-/*
-#cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/libvirt-qemu.h>
-#include <assert.h>
-#include "qemu_compat.h"
-
-
-int virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn,
-						     int callbackID)
-{
-#if LIBVIR_VERSION_NUMBER < 1002003
-    assert(0); // Caller should have checked version
-#else
-    return virConnectDomainQemuMonitorEventDeregister(conn, callbackID);
-#endif
-}
-
-*/
-import "C"
diff --git a/qemu_compat.h b/qemu_compat.h
index ad556cc..7756d7f 100644
--- a/qemu_compat.h
+++ b/qemu_compat.h
@@ -39,9 +39,6 @@ typedef void (*virConnectDomainQemuMonitorEventCallback)(virConnectPtr conn,
                                                          void *opaque);
 #endif
 
-int virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn,
-						     int callbackID);
-
 #ifndef VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX
 #define VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX (1 << 0)
 #endif
diff --git a/qemu_wrapper.go b/qemu_wrapper.go
index bbd95cc..ff837a0 100644
--- a/qemu_wrapper.go
+++ b/qemu_wrapper.go
@@ -60,5 +60,15 @@ int virConnectDomainQemuMonitorEventRegisterWrapper(virConnectPtr c,  virDomainP
 #endif
 }
 
+int virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn,
+						     int callbackID)
+{
+#if LIBVIR_VERSION_NUMBER < 1002003
+    assert(0); // Caller should have checked version
+#else
+    return virConnectDomainQemuMonitorEventDeregister(conn, callbackID);
+#endif
+}
+
 */
 import "C"
diff --git a/qemu_wrapper.h b/qemu_wrapper.h
index 9284256..3f4dd6a 100644
--- a/qemu_wrapper.h
+++ b/qemu_wrapper.h
@@ -35,5 +35,8 @@ int virConnectDomainQemuMonitorEventRegisterWrapper(virConnectPtr c,  virDomainP
 						 const char *event, virConnectDomainQemuMonitorEventCallback cb,
 						 long goCallbackId, unsigned int flags);
 
+int virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn,
+						     int callbackID);
+
 
 #endif /* LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__ */
-- 
2.17.1




More information about the libvir-list mailing list