[PATCH 6/6] Remove unused macros and enable -Wunused-macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* m4/virt-compile-warnings.m4: Enable -Wunused-macros
* daemon/libvirtd.c: Remove MAX_LISTEN
* daemon/remote.c: Remote VIR_FROM_THIS
* examples/domain-events/events-c/event-test.c: Remove VIR_DEBUG
* python/libvirt-override.c: Put NAME() inside DEBUG_ERROR
* src/esx/esx*.c: Comment out unused VIR_FROM_THIS
* src/node_device/node_device_hal.c: Remove pointless macros
  for accessing privateData
* src/openvz/openvz_driver.c: Remove CMDBUF_LEN/CMDOP_LEN
* src/qemu/qemu_monitor_text.c: Remove QEMU_CMD_PROMPT
  and QEMU_PASSWD_PROMPT
* src/remote/remote_driver.c: Remove UNIX_PATH_MAX
* src/security/security_stack.c: Remove VIR_FROM_THIS
* src/uml/uml_conf.c: Remove umlLog()
* src/uml/uml_driver.c: Remove TEMPDIR
* src/util/bridge.c: Remove JIFFIES_TO_MS/MS_TO_JIFFIES
* src/util/hooks.c: Ensure VIR_FROM_THIS is used
* src/util/logging.c: Remove VIR_FROM_THIS
* src/util/macvtap.c: Disable unused constants
* src/util/storage_file.c: Disable QCOW1_HDR_TOTAL_SIZE
* src/vbox/vbox_driver.c: Remove duplicated VIR_FROM_THIS
  and make sure it is used
* src/util/pci.c: Disable some unused constants
* src/xen/xen_hypervisor.c: Remove XEN_V0_IOCTL_HYPERCALL_CMD
  and unused DOMFLAGS_CPUMASK/DOMFLAGS_CPUSHIFT
* src/xen/xm_internal.c: Remove XM_XML_ERROR,
  XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU and
  XEND_CONFIG_MIN_VERS_PVFB_NEWCONF
* tools/virsh.c: Remove DIR_MODE/LOCK_MODE, LVL_NOTICE constants
* tests/sockettest.c: Remove DO_TEST_PARSE
---
 daemon/libvirtd.c                            |    2 +-
 daemon/remote.c                              |    1 -
 examples/domain-events/events-c/event-test.c |    2 --
 m4/virt-compile-warnings.m4                  |    1 -
 python/libvirt-override.c                    |    2 ++
 src/driver.c                                 |    3 +--
 src/esx/esx_device_monitor.c                 |    2 +-
 src/esx/esx_interface_driver.c               |    2 +-
 src/esx/esx_network_driver.c                 |    2 +-
 src/esx/esx_nwfilter_driver.c                |    2 +-
 src/esx/esx_secret_driver.c                  |    2 +-
 src/esx/esx_vi.c                             |    7 -------
 src/esx/esx_vi_methods.c                     |    9 +++++----
 src/esx/esx_vi_types.c                       |    3 ++-
 src/libvirt.c                                |    3 ---
 src/node_device/node_device_hal.c            |   17 ++++-------------
 src/openvz/openvz_driver.c                   |    2 --
 src/qemu/qemu_monitor_text.c                 |    3 ---
 src/remote/remote_driver.c                   |    3 ---
 src/security/security_stack.c                |    2 --
 src/uml/uml_conf.c                           |    2 --
 src/uml/uml_driver.c                         |    3 ---
 src/util/bridge.c                            |    3 ---
 src/util/hooks.c                             |    2 +-
 src/util/logging.c                           |    2 --
 src/util/macvtap.c                           |    6 ++++--
 src/util/pci.c                               |    4 ++--
 src/util/storage_file.c                      |    4 +++-
 src/vbox/vbox_driver.c                       |    4 +---
 src/xen/xen_hypervisor.c                     |   14 +++++---------
 src/xen/xm_internal.c                        |    9 ---------
 tests/sockettest.c                           |   10 ----------
 tools/virsh.c                                |   13 ++-----------
 33 files changed, 38 insertions(+), 108 deletions(-)

diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 024f56f..991aaeb 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -3154,7 +3154,7 @@ enum {
     OPT_VERSION = 129
 };
 
-#define MAX_LISTEN 5
+
 int main(int argc, char **argv) {
     struct qemud_server *server = NULL;
     const char *pid_file = NULL;
diff --git a/daemon/remote.c b/daemon/remote.c
index 1700c2d..98279e1 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -62,7 +62,6 @@
 #include "libvirt/libvirt-qemu.h"
 #include "command.h"
 
-#define VIR_FROM_THIS VIR_FROM_REMOTE
 #define REMOTE_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
 
 static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain);
diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c
index 1f46d42..3de2aa8 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -10,8 +10,6 @@
 
 #define VIR_DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
         __func__, __LINE__)
-#define VIR_DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
-        __func__, __LINE__, __VA_ARGS__)
 #define STREQ(a,b) (strcmp(a,b) == 0)
 
 #ifndef ATTRIBUTE_UNUSED
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 24710e6..5022676 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -45,7 +45,6 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
         dontwarn="$dontwarn -Wconversion"
         dontwarn="$dontwarn -Wsign-conversion"
         dontwarn="$dontwarn -Wpacked"
-        dontwarn="$dontwarn -Wunused-macros"
         dontwarn="$dontwarn -Woverlength-strings"
         dontwarn="$dontwarn -Wstack-protector"
 
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 4a9b432..8568ff2 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -2595,7 +2595,9 @@ static char *updateTimeoutName    = NULL;
 static PyObject *removeTimeoutObj = NULL;
 static char *removeTimeoutName    = NULL;
 
+#if DEBUG_ERROR
 #define NAME(fn) ( fn ## Name ? fn ## Name : # fn )
+#endif
 
 static int
 libvirt_virEventAddHandleFunc  (int fd,
diff --git a/src/driver.c b/src/driver.c
index f882ea1..25623cd 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -30,13 +30,12 @@
 #include "util.h"
 #include "configmake.h"
 
-#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver"
-
 /* Make sure ... INTERNAL_CALL can not be set by the caller */
 verify((VIR_SECRET_GET_VALUE_INTERNAL_CALL &
         VIR_SECRET_GET_VALUE_FLAGS_MASK) == 0);
 
 #ifdef WITH_DRIVER_MODULES
+# define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver"
 
 /* XXX re-implment this for other OS, or use libtools helper lib ? */
 
diff --git a/src/esx/esx_device_monitor.c b/src/esx/esx_device_monitor.c
index d559f96..6d765ac 100644
--- a/src/esx/esx_device_monitor.c
+++ b/src/esx/esx_device_monitor.c
@@ -35,7 +35,7 @@
 #include "esx_vi_methods.h"
 #include "esx_util.h"
 
-#define VIR_FROM_THIS VIR_FROM_ESX
+/* #define VIR_FROM_THIS VIR_FROM_ESX */
 
 
 
diff --git a/src/esx/esx_interface_driver.c b/src/esx/esx_interface_driver.c
index 4bac3d5..8d0b9a2 100644
--- a/src/esx/esx_interface_driver.c
+++ b/src/esx/esx_interface_driver.c
@@ -35,7 +35,7 @@
 #include "esx_vi_methods.h"
 #include "esx_util.h"
 
-#define VIR_FROM_THIS VIR_FROM_ESX
+/* #define VIR_FROM_THIS VIR_FROM_ESX */
 
 
 
diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c
index a64bb8e..7117a60 100644
--- a/src/esx/esx_network_driver.c
+++ b/src/esx/esx_network_driver.c
@@ -35,7 +35,7 @@
 #include "esx_vi_methods.h"
 #include "esx_util.h"
 
-#define VIR_FROM_THIS VIR_FROM_ESX
+/* #define VIR_FROM_THIS VIR_FROM_ESX */
 
 
 
diff --git a/src/esx/esx_nwfilter_driver.c b/src/esx/esx_nwfilter_driver.c
index a9d046d..4ba9f46 100644
--- a/src/esx/esx_nwfilter_driver.c
+++ b/src/esx/esx_nwfilter_driver.c
@@ -34,7 +34,7 @@
 #include "esx_vi_methods.h"
 #include "esx_util.h"
 
-#define VIR_FROM_THIS VIR_FROM_ESX
+/* #define VIR_FROM_THIS VIR_FROM_ESX */
 
 
 
diff --git a/src/esx/esx_secret_driver.c b/src/esx/esx_secret_driver.c
index 1ae7ddc..350d8e0 100644
--- a/src/esx/esx_secret_driver.c
+++ b/src/esx/esx_secret_driver.c
@@ -34,7 +34,7 @@
 #include "esx_vi_methods.h"
 #include "esx_util.h"
 
-#define VIR_FROM_THIS VIR_FROM_ESX
+/* #define VIR_FROM_THIS VIR_FROM_ESX */
 
 
 
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 7446ec5..3b38937 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -40,13 +40,6 @@
 #define VIR_FROM_THIS VIR_FROM_ESX
 
 
-
-#define ESX_VI__SOAP__RESPONSE_XPATH(_type)                                   \
-    ((char *)"/soapenv:Envelope/soapenv:Body/"                                \
-               "vim:"_type"Response/vim:returnval")
-
-
-
 #define ESX_VI__TEMPLATE__ALLOC(_type)                                        \
     int                                                                       \
     esxVI_##_type##_Alloc(esxVI_##_type **ptrptr)                             \
diff --git a/src/esx/esx_vi_methods.c b/src/esx/esx_vi_methods.c
index 5967088..440a62a 100644
--- a/src/esx/esx_vi_methods.c
+++ b/src/esx/esx_vi_methods.c
@@ -1,4 +1,3 @@
-
 /*
  * esx_vi_methods.c: client for the VMware VI API 2.5 to manage ESX hosts
  *
@@ -52,8 +51,10 @@
 
 
 
+#if 0
 #define ESX_VI__METHOD__CHECK_OUTPUT__RequiredList                            \
     ESX_VI__METHOD__CHECK_OUTPUT__NotNone
+#endif
 
 
 
@@ -78,12 +79,12 @@
     }
 
 
-
-#define ESX_VI__METHOD__DESERIALIZE_OUTPUT__RequiredList(_type, _suffix)      \
+#if 0
+#define ESX_VI__METHOD__DESERIALIZE_OUTPUT__RequiredList(_type)               \
     if (esxVI_##_type##_DeserializeList(response->node, output) < 0) {        \
         goto cleanup;                                                         \
     }
-
+#endif
 
 
 #define ESX_VI__METHOD__DESERIALIZE_OUTPUT__OptionalItem(_type, _suffix)      \
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index f3df2b5..56121ef 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -531,11 +531,12 @@
 
 
 
+#if 0
 #define ESX_VI__TEMPLATE__DISPATCH__DEEP_COPY(_type)                          \
     case esxVI_Type_##_type:                                                  \
       return esxVI_##_type##_DeepCopy((esxVI_##_type **)dst,                  \
                                       (esxVI_##_type *)src);
-
+#endif
 
 
 #define ESX_VI__TEMPLATE__DISPATCH__CAST_FROM_ANY_TYPE(_type)                 \
diff --git a/src/libvirt.c b/src/libvirt.c
index 8be18d4..564988b 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -492,9 +492,6 @@ DllMain (HINSTANCE instance ATTRIBUTE_UNUSED,
 #define virLibSecretError(code, ...)                              \
     virReportErrorHelper(NULL, VIR_FROM_SECRET, code, __FILE__,   \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
-#define virLibStreamError(code, ...)                              \
-    virReportErrorHelper(NULL, VIR_FROM_STREAMS, code, __FILE__,  \
-                         __FUNCTION__, __LINE__, __VA_ARGS__)
 #define virLibNWFilterError(code, ...)                            \
     virReportErrorHelper(NULL, VIR_FROM_NWFILTER, code, __FILE__, \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index 3af2bcf..b4a4c73 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -38,21 +38,12 @@
 #include "logging.h"
 #include "node_device_driver.h"
 
-#define VIR_FROM_THIS VIR_FROM_NODEDEV
-
 /*
  * Host device enumeration (HAL implementation)
  */
 
 static virDeviceMonitorStatePtr driverState;
 
-#define CONN_DRV_STATE(conn) \
-        ((virDeviceMonitorStatePtr)((conn)->devMonPrivateData))
-#define DRV_STATE_HAL_CTX(ds) ((LibHalContext *)((ds)->privateData))
-#define CONN_HAL_CTX(conn) DRV_STATE_HAL_CTX(CONN_DRV_STATE(conn))
-
-#define NODE_DEV_UDI(obj) ((const char *)((obj)->privateData)
-
 
 static const char *hal_name(const char *udi)
 {
@@ -441,7 +432,7 @@ static void dev_create(const char *udi)
         return;
 
     nodeDeviceLock(driverState);
-    ctx = DRV_STATE_HAL_CTX(driverState);
+    ctx = driverState->privateData;
 
     if (VIR_ALLOC(def) < 0)
         goto failure;
@@ -600,7 +591,7 @@ static void dbus_watch_callback(int fdatch ATTRIBUTE_UNUSED,
     (void)dbus_watch_handle(watch, dbus_flags);
 
     nodeDeviceLock(driverState);
-    hal_ctx = DRV_STATE_HAL_CTX(driverState);
+    hal_ctx = driverState->privateData;
     dbus_conn = libhal_ctx_get_dbus_connection(hal_ctx);
     nodeDeviceUnlock(driverState);
     while (dbus_connection_dispatch(dbus_conn) == DBUS_DISPATCH_DATA_REMAINS)
@@ -808,7 +799,7 @@ static int halDeviceMonitorShutdown(void)
 {
     if (driverState) {
         nodeDeviceLock(driverState);
-        LibHalContext *hal_ctx = DRV_STATE_HAL_CTX(driverState);
+        LibHalContext *hal_ctx = driverState->privateData;
         virNodeDeviceObjListFree(&driverState->devs);
         (void)libhal_ctx_shutdown(hal_ctx, NULL);
         (void)libhal_ctx_free(hal_ctx);
@@ -834,7 +825,7 @@ static int halDeviceMonitorReload(void)
     virNodeDeviceObjListFree(&driverState->devs);
     nodeDeviceUnlock(driverState);
 
-    hal_ctx = DRV_STATE_HAL_CTX(driverState);
+    hal_ctx = driverState->privateData;
     VIR_INFO0("Creating new objects");
     dbus_error_init(&err);
     udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index fb30c37..c492341 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -63,8 +63,6 @@
 #define VIR_FROM_THIS VIR_FROM_OPENVZ
 
 #define OPENVZ_MAX_ARG 28
-#define CMDBUF_LEN 1488
-#define CMDOP_LEN 288
 
 static int openvzGetProcessInfo(unsigned long long *cpuTime, int vpsid);
 static int openvzGetMaxVCPUs(virConnectPtr conn, const char *type);
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 168c60f..2208573 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -43,9 +43,6 @@
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
-#define QEMU_CMD_PROMPT "\n(qemu) "
-#define QEMU_PASSWD_PROMPT "Password: "
-
 #define DEBUG_IO 0
 
 /* Return -1 for error, 0 for success */
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index bf94e70..7f7687a 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -691,9 +691,6 @@ doRemoteOpen (virConnectPtr conn,
             }
         }
 
-# ifndef UNIX_PATH_MAX
-#  define UNIX_PATH_MAX(addr) (sizeof (addr).sun_path)
-# endif
         struct sockaddr_un addr;
         int trials = 0;
 
diff --git a/src/security/security_stack.c b/src/security/security_stack.c
index 64f745a..5cdcc6a 100644
--- a/src/security/security_stack.c
+++ b/src/security/security_stack.c
@@ -24,8 +24,6 @@
 
 #include "virterror_internal.h"
 
-#define VIR_FROM_THIS VIR_FROM_SECURITY
-
 typedef struct _virSecurityStackData virSecurityStackData;
 typedef virSecurityStackData *virSecurityStackDataPtr;
 
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 7c8fb16..909515f 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -52,8 +52,6 @@
 
 #define VIR_FROM_THIS VIR_FROM_UML
 
-#define umlLog(level, msg, ...)                                     \
-        virLogMessage(__FILE__, level, 0, msg, __VA_ARGS__)
 
 virCapsPtr umlCapsInit(void) {
     struct utsname utsname;
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index e2bd5f2..a26087c 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -65,9 +65,6 @@
 
 #define VIR_FROM_THIS VIR_FROM_UML
 
-/* For storing short-lived temporary files. */
-#define TEMPDIR LOCALSTATEDIR "/cache/libvirt"
-
 typedef struct _umlDomainObjPrivate umlDomainObjPrivate;
 typedef umlDomainObjPrivate *umlDomainObjPrivatePtr;
 struct _umlDomainObjPrivate {
diff --git a/src/util/bridge.c b/src/util/bridge.c
index 3ed71be..00234df 100644
--- a/src/util/bridge.c
+++ b/src/util/bridge.c
@@ -52,9 +52,6 @@
 # include "logging.h"
 # include "network.h"
 
-# define JIFFIES_TO_MS(j) (((j)*1000)/HZ)
-# define MS_TO_JIFFIES(ms) (((ms)*HZ)/1000)
-
 struct _brControl {
     int fd;
 };
diff --git a/src/util/hooks.c b/src/util/hooks.c
index 819c95c..3eeb698 100644
--- a/src/util/hooks.c
+++ b/src/util/hooks.c
@@ -42,7 +42,7 @@
 #define VIR_FROM_THIS VIR_FROM_HOOK
 
 #define virHookReportError(code, ...)                              \
-    virReportErrorHelper(NULL, VIR_FROM_HOOK, code, __FILE__,      \
+    virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__,      \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
 #define LIBVIRT_HOOK_DIR SYSCONFDIR "/libvirt/hooks"
diff --git a/src/util/logging.c b/src/util/logging.c
index 9d18752..0330fec 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -44,8 +44,6 @@
 #include "threads.h"
 #include "files.h"
 
-#define VIR_FROM_THIS VIR_FROM_NONE
-
 /*
  * Macro used to format the message as a string in virLogMessage
  * and borrowed from libxml2 (also used in virRaiseError)
diff --git a/src/util/macvtap.c b/src/util/macvtap.c
index 346eaf6..f563c23 100644
--- a/src/util/macvtap.c
+++ b/src/util/macvtap.c
@@ -71,8 +71,10 @@
 
 # define MICROSEC_PER_SEC       (1000 * 1000)
 
-# define NLMSGBUF_SIZE  256
-# define RATTBUF_SIZE   64
+# if 0
+#  define NLMSGBUF_SIZE  256
+#  define RATTBUF_SIZE   64
+# endif
 
 # define NETLINK_ACK_TIMEOUT_S  2
 
diff --git a/src/util/pci.c b/src/util/pci.c
index 8d2dbb0..0e8cdee 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -96,7 +96,7 @@ struct _pciDeviceList {
 #define PCI_HEADER_TYPE         0x0e    /* Header type */
 #define PCI_HEADER_TYPE_BRIDGE 0x1
 #define PCI_HEADER_TYPE_MASK   0x7f
-#define PCI_HEADER_TYPE_MULTI  0x80
+/*#define PCI_HEADER_TYPE_MULTI  0x80*/
 
 /* PCI30 6.2.1  Device Identification */
 #define PCI_CLASS_DEVICE        0x0a    /* Device class */
@@ -123,7 +123,7 @@ struct _pciDeviceList {
 #define PCI_EXP_DEVCAP_FLR     (1<<28) /* Function Level Reset */
 
 /* Header type 1 BR12 3.2 PCI-to-PCI Bridge Configuration Space Header Format */
-#define PCI_PRIMARY_BUS         0x18    /* BR12 3.2.5.2 Primary bus number */
+/*#define PCI_PRIMARY_BUS         0x18*/    /* BR12 3.2.5.2 Primary bus number */
 #define PCI_SECONDARY_BUS       0x19    /* BR12 3.2.5.3 Secondary bus number */
 #define PCI_SUBORDINATE_BUS     0x1a    /* BR12 3.2.5.4 Highest bus number behind the bridge */
 #define PCI_BRIDGE_CONTROL      0x3e
diff --git a/src/util/storage_file.c b/src/util/storage_file.c
index ede79fa..c427054 100644
--- a/src/util/storage_file.c
+++ b/src/util/storage_file.c
@@ -101,7 +101,9 @@ qedGetBackingStore(char **, int *, const unsigned char *, size_t);
 #define QCOW1_HDR_CRYPT (QCOWX_HDR_IMAGE_SIZE+8+1+1)
 #define QCOW2_HDR_CRYPT (QCOWX_HDR_IMAGE_SIZE+8)
 
-#define QCOW1_HDR_TOTAL_SIZE (QCOW1_HDR_CRYPT+4+8)
+#if 0
+# define QCOW1_HDR_TOTAL_SIZE (QCOW1_HDR_CRYPT+4+8)
+#endif
 #define QCOW2_HDR_TOTAL_SIZE (QCOW2_HDR_CRYPT+4+4+8+8+4+4+8)
 
 #define QCOW2_HDR_EXTENSION_END 0
diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index 9526ee4..6e680ba 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
@@ -42,8 +42,6 @@
 #include "virterror_internal.h"
 #include "util.h"
 
-#define VIR_FROM_THIS VIR_FROM_VBOX
-
 
 extern virDriver vbox22Driver;
 extern virNetworkDriver vbox22NetworkDriver;
@@ -66,7 +64,7 @@ static virDriver vboxDriverDummy;
 #define VIR_FROM_THIS VIR_FROM_VBOX
 
 #define vboxError(code, ...) \
-        virReportErrorHelper(NULL, VIR_FROM_VBOX, code, __FILE__, \
+        virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \
                              __FUNCTION__, __LINE__, __VA_ARGS__)
 
 int vboxRegister(void) {
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 8a9dae5..d7d74a4 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -80,16 +80,12 @@ typedef struct v0_hypercall_struct {
 } v0_hypercall_t;
 
 #ifdef __linux__
-# define XEN_V0_IOCTL_HYPERCALL_CMD \
-        _IOC(_IOC_NONE, 'P', 0, sizeof(v0_hypercall_t))
 /* the new one */
 typedef struct v1_hypercall_struct
 {
     uint64_t op;
     uint64_t arg[5];
 } v1_hypercall_t;
-# define XEN_V1_IOCTL_HYPERCALL_CMD                  \
-    _IOC(_IOC_NONE, 'P', 0, sizeof(v1_hypercall_t))
 typedef v1_hypercall_t hypercall_t;
 #elif defined(__sun)
 typedef privcmd_hypercall_t hypercall_t;
@@ -140,8 +136,6 @@ static regex_t xen_cap_rec;
 # define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
 # define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
 # define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
-# define DOMFLAGS_CPUMASK      255 /* CPU to which this domain is bound.      */
-# define DOMFLAGS_CPUSHIFT       8
 # define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
 # define DOMFLAGS_SHUTDOWNSHIFT 16
 #endif
@@ -2709,13 +2703,13 @@ xenHypervisorMakeCapabilities(virConnectPtr conn)
         }
     }
 
-    capabilities = fopen ("/sys/hypervisor/properties/capabilities", "r");
+    capabilities = fopen(HYPERVISOR_CAPABILITIES, "r");
     if (capabilities == NULL) {
         if (errno != ENOENT) {
             VIR_FORCE_FCLOSE(cpuinfo);
             virReportSystemError(errno,
                                  _("cannot read file %s"),
-                                 "/sys/hypervisor/properties/capabilities");
+                                 HYPERVISOR_CAPABILITIES);
             return NULL;
         }
     }
@@ -3175,7 +3169,9 @@ xenHypervisorGetDomInfo(virConnectPtr conn, int id, virDomainInfoPtr info)
             break;
         case DOMFLAGS_SHUTDOWN:
             /* The domain is shutdown.  Determine the cause. */
-            domain_shutdown_cause = domain_flags >> DOMFLAGS_SHUTDOWNSHIFT;
+            domain_shutdown_cause =
+                (domain_flags >> DOMFLAGS_SHUTDOWNSHIFT) &
+                DOMFLAGS_SHUTDOWNMASK;
             switch (domain_shutdown_cause) {
                 case SHUTDOWN_crash:
                     info->state = VIR_DOMAIN_CRASHED;
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 7f73588..6c43811 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -52,14 +52,6 @@
 
 #define VIR_FROM_THIS VIR_FROM_XENXM
 
-#ifdef WITH_RHEL5_API
-# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 0
-# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 2
-#else
-# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 3
-# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3
-#endif
-
 /* The true Xen limit varies but so far is always way
    less than 1024, which is the Linux kernel limit according
    to sched.h, so we'll match that for now */
@@ -78,7 +70,6 @@ static int xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
 #define XEND_CONFIG_FILE "xend-config.sxp"
 #define XEND_PCI_CONFIG_PREFIX "xend-pci-"
 #define QEMU_IF_SCRIPT "qemu-ifup"
-#define XM_XML_ERROR "Invalid xml"
 
 struct xenUnifiedDriver xenXMDriver = {
     xenXMOpen, /* open */
diff --git a/tests/sockettest.c b/tests/sockettest.c
index 2c9ff03..bb44496 100644
--- a/tests/sockettest.c
+++ b/tests/sockettest.c
@@ -170,16 +170,6 @@ mymain(int argc ATTRIBUTE_UNUSED,
     if (!virTestGetDebug())
         virSetErrorFunc(NULL, testQuietError);
 
-#define DO_TEST_PARSE(addrstr, family, pass)                            \
-    do {                                                                \
-        virSocketAddr addr;                                             \
-        struct testParseData data = { &addr, addrstr, family, pass };   \
-        memset(&addr, 0, sizeof(addr));                                 \
-        if (virtTestRun("Test parse " addrstr,                          \
-                        1, testParseHelper, &data) < 0)                 \
-            ret = -1;                                                   \
-    } while (0)
-
 #define DO_TEST_PARSE_AND_FORMAT(addrstr, family, pass)                 \
     do {                                                                \
         virSocketAddr addr;                                             \
diff --git a/tools/virsh.c b/tools/virsh.c
index 4765f5c..d1c3fe3 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -80,12 +80,12 @@ static char *progname;
  */
 #define MSG_BUFFER    4096
 #define SIGN_NAME     "virsh"
-#define DIR_MODE      (S_IWUSR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)  /* 0755 */
 #define FILE_MODE     (S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH)                                /* 0644 */
-#define LOCK_MODE     (S_IWUSR | S_IRUSR)                                                    /* 0600 */
 #define LVL_DEBUG     "DEBUG"
 #define LVL_INFO      "INFO"
+#if 0
 #define LVL_NOTICE    "NOTICE"
+#endif
 #define LVL_WARNING   "WARNING"
 #define LVL_ERROR     "ERROR"
 
@@ -409,15 +409,6 @@ _vshStrdup(vshControl *ctl, const char *s, const char *filename, int line)
     exit(EXIT_FAILURE);
 }
 
-/* Poison the raw allocating identifiers in favor of our vsh variants.  */
-#undef malloc
-#undef calloc
-#undef realloc
-#undef strdup
-#define malloc use_vshMalloc_instead_of_malloc
-#define calloc use_vshCalloc_instead_of_calloc
-#define realloc use_vshRealloc_instead_of_realloc
-#define strdup use_vshStrdup_instead_of_strdup
 
 static int idsorter(const void *a, const void *b) {
   const int *ia = (const int *)a;
-- 
1.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]