[PATCH 1/6] Remove unused macros

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

 



In the order of appearance:

* MAX_LISTEN - never used
  added by 23ad665c (qemud) and addec57 (lock daemon)

* NEXT_FREE_CLASS_ID - never used, added by 07d1b6b

* virLockError - never used, added by eb8268a4

* OPENVZ_MAX_ARG, CMDBUF_LEN, CMDOP_LEN
  unused since the removal of ADD_ARG_LIT in d8b31306

* QEMU_NB_PER_CPU_STAT_PARAM - unused since 897808e

* QEMU_CMD_PROMPT, QEMU_PASSWD_PROMPT - unused since 1dc10a7

* TEST_MODEL_WORDSIZE - unused since c25c18f7

* TEMPDIR - never used, added by 714bef5

* NSIG - workaround around old headers
  added by commit 60ed1d2
  unused since virExec was moved by commit 02e8691

* DO_TEST_PARSE - never used, added by 9afa006

* DIFF_MSEC, GETTIMEOFDAY - unused since eee6eb6
---
 daemon/libvirtd.c               |  1 -
 src/conf/network_conf.c         |  1 -
 src/locking/lock_daemon.c       |  1 -
 src/locking/lock_driver_lockd.c |  4 ----
 src/openvz/openvz_driver.c      |  4 ----
 src/qemu/qemu_driver.c          |  2 --
 src/qemu/qemu_monitor_text.c    |  3 ---
 src/test/test_driver.c          |  1 -
 src/uml/uml_driver.c            |  3 ---
 src/util/virutil.c              |  4 ----
 tests/sockettest.c              | 10 ----------
 tests/testutils.c               |  5 -----
 12 files changed, 39 deletions(-)

diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 2366d63..55acee2 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1097,7 +1097,6 @@ daemonUsage(const char *argv0, bool privileged)
     }
 }
 
-#define MAX_LISTEN 5
 int main(int argc, char **argv) {
     virNetServerPtr srv = NULL;
     char *remote_config_file = NULL;
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index b334b64..f4a9df0 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -47,7 +47,6 @@
 
 #define MAX_BRIDGE_ID 256
 #define VIR_FROM_THIS VIR_FROM_NETWORK
-#define NEXT_FREE_CLASS_ID 3
 /* currently, /sbin/tc implementation allows up to 16 bits for minor class size */
 #define CLASS_ID_BITMAP_SIZE (1<<16)
 
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 8cc6979..bb165c0 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -1111,7 +1111,6 @@ virLockDaemonUsage(const char *argv0, bool privileged)
     }
 }
 
-#define MAX_LISTEN 5
 int main(int argc, char **argv) {
     virNetServerProgramPtr lockProgram = NULL;
     char *remote_config_file = NULL;
diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c
index 72a4a0c..3a48a6a 100644
--- a/src/locking/lock_driver_lockd.c
+++ b/src/locking/lock_driver_lockd.c
@@ -38,10 +38,6 @@
 
 VIR_LOG_INIT("locking.lock_driver_lockd");
 
-#define virLockError(code, ...)                                     \
-    virReportErrorHelper(VIR_FROM_THIS, code, __FILE__,             \
-                         __FUNCTION__, __LINE__, __VA_ARGS__)
-
 typedef struct _virLockManagerLockDaemonPrivate virLockManagerLockDaemonPrivate;
 typedef virLockManagerLockDaemonPrivate *virLockManagerLockDaemonPrivatePtr;
 
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index d29e35b..f9f924f 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -63,10 +63,6 @@
 
 VIR_LOG_INIT("openvz.openvz_driver");
 
-#define OPENVZ_MAX_ARG 28
-#define CMDBUF_LEN 1488
-#define CMDOP_LEN 288
-
 #define OPENVZ_NB_MEM_PARAM 3
 
 static int openvzGetProcessInfo(unsigned long long *cpuTime, int vpsid);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index becf415..9e28bf9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -110,8 +110,6 @@ VIR_LOG_INIT("qemu.qemu_driver");
 
 #define QEMU_NB_NUMA_PARAM 2
 
-#define QEMU_NB_PER_CPU_STAT_PARAM 2
-
 #define QEMU_SCHED_MIN_PERIOD              1000LL
 #define QEMU_SCHED_MAX_PERIOD           1000000LL
 #define QEMU_SCHED_MIN_QUOTA               1000LL
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 9973a17..f26bc78 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -51,9 +51,6 @@
 
 VIR_LOG_INIT("qemu.qemu_monitor_text");
 
-#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/test/test_driver.c b/src/test/test_driver.c
index 07cc032..d49c4b3 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -122,7 +122,6 @@ static int defaultConnections;
 static virMutex defaultLock = VIR_MUTEX_INITIALIZER;
 
 #define TEST_MODEL "i686"
-#define TEST_MODEL_WORDSIZE 32
 #define TEST_EMULATOR "/usr/bin/test-hv"
 
 static const virNodeInfo defaultNodeInfo = {
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 2d59126..6b4f655 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -71,9 +71,6 @@
 
 VIR_LOG_INIT("uml.uml_driver");
 
-/* 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/virutil.c b/src/util/virutil.c
index 658723b..79cdb7a 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -81,10 +81,6 @@
 #include "virstring.h"
 #include "virutil.h"
 
-#ifndef NSIG
-# define NSIG 32
-#endif
-
 verify(sizeof(gid_t) <= sizeof(unsigned int) &&
        sizeof(uid_t) <= sizeof(unsigned int));
 
diff --git a/tests/sockettest.c b/tests/sockettest.c
index fbb5db8..0d348d9 100644
--- a/tests/sockettest.c
+++ b/tests/sockettest.c
@@ -259,16 +259,6 @@ mymain(void)
      */
     virtTestQuiesceLibvirtErrors(false);
 
-#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,                          \
-                        testParseHelper, &data) < 0)                    \
-            ret = -1;                                                   \
-    } while (0)
-
 #define DO_TEST_PARSE_AND_FORMAT(addrstr, family, pass)                 \
     do {                                                                \
         virSocketAddr addr;                                             \
diff --git a/tests/testutils.c b/tests/testutils.c
index f2db4a0..bebb14b 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -62,11 +62,6 @@
 
 VIR_LOG_INIT("tests.testutils");
 
-#define GETTIMEOFDAY(T) gettimeofday(T, NULL)
-#define DIFF_MSEC(T, U)                                 \
-    ((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \
-      ((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0)
-
 #include "virfile.h"
 
 static unsigned int testDebug = -1;
-- 
2.0.5

--
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]