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

[libvirt] [PATCH 03/50] list: Rename virdomainlist.[ch] for common use



Except objects of domains, domain snapshots, we will also add APIs
to list objects like storage pools, storage vols, network, interface,
etc. And it's deserved to have the small helper functions in a
common file instead of in separate files.

This patch renames virdomainlist.[ch] to virobjectlist.[ch], and
also renames the macros to filter domain objects more specificly.

src/conf/virdomainlist.c: Renamed to src/conf/virobjectlist.c
src/conf/virdomainlist.h: Renamed to src/conf/virobjectlist.h
src/Makefile.am: s/virdomainlist/virobjectlist/g,
                 s/DOMAIN_LIST/OBJECT_LIST/g
src/conf/domain_conf.c: Likewise
src/libvirt_private.syms: Likewise
tools/virsh.c: Likewise
src/libxl/libxl_driver.c: s/LIST_FILTERS/LIST_DOMAINS_FILTERS/g
src/lxc/lxc_driver.c: Likewise
src/openvz/openvz_driver.c: Likewise
src/qemu/qemu_driver.c: Likewise
src/test/test_driver.c: Likewise
src/uml/uml_driver.c: Likewise
src/vbox/vbox_tmpl.c: Likewise
src/vmware/vmware_driver.c: Likewise
---
 src/Makefile.am                               |    8 +++---
 src/conf/domain_conf.c                        |    2 +-
 src/conf/{virdomainlist.c => virobjectlist.c} |   20 +++++++------
 src/conf/{virdomainlist.h => virobjectlist.h} |   36 +++++++++++++-----------
 src/libvirt_private.syms                      |    2 +-
 src/libxl/libxl_driver.c                      |    4 +-
 src/lxc/lxc_driver.c                          |    4 +-
 src/openvz/openvz_driver.c                    |    4 +-
 src/qemu/qemu_driver.c                        |    4 +-
 src/test/test_driver.c                        |    4 +-
 src/uml/uml_driver.c                          |    4 +-
 src/vbox/vbox_tmpl.c                          |   10 +++---
 src/vmware/vmware_driver.c                    |    4 +-
 tools/virsh.c                                 |   16 +++++-----
 14 files changed, 63 insertions(+), 59 deletions(-)
 rename src/conf/{virdomainlist.c => virobjectlist.c} (90%)
 rename src/conf/{virdomainlist.h => virobjectlist.h} (71%)

diff --git a/src/Makefile.am b/src/Makefile.am
index 4fc42c9..45141c1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -195,9 +195,9 @@ CPU_CONF_SOURCES =						\
 CONSOLE_CONF_SOURCES =						\
 		conf/virconsole.c conf/virconsole.h
 
-# Domain listing helpers
-DOMAIN_LIST_SOURCES =						\
-		conf/virdomainlist.c conf/virdomainlist.h
+# Object listing helpers
+OBJECT_LIST_SOURCES =						\
+		conf/virobjectlist.c conf/virobjectlist.h
 
 CONF_SOURCES =							\
 		$(NETDEV_CONF_SOURCES)				\
@@ -212,7 +212,7 @@ CONF_SOURCES =							\
 		$(SECRET_CONF_SOURCES)				\
 		$(CPU_CONF_SOURCES)				\
 		$(CONSOLE_CONF_SOURCES)				\
-		$(DOMAIN_LIST_SOURCES)
+		$(OBJECT_LIST_SOURCES)
 
 # The remote RPC driver, covering domains, storage, networks, etc
 REMOTE_DRIVER_GENERATED = \
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1b5dad9..f3a7f14 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -51,7 +51,7 @@
 #include "secret_conf.h"
 #include "netdev_vport_profile_conf.h"
 #include "netdev_bandwidth_conf.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #define VIR_FROM_THIS VIR_FROM_DOMAIN
 
diff --git a/src/conf/virdomainlist.c b/src/conf/virobjectlist.c
similarity index 90%
rename from src/conf/virdomainlist.c
rename to src/conf/virobjectlist.c
index 2b0b878..91eb660 100644
--- a/src/conf/virdomainlist.c
+++ b/src/conf/virobjectlist.c
@@ -1,5 +1,7 @@
 /**
- * virdomainlist.c: Helpers for listing and filtering domains.
+ *virobjectlist.h: Helpers for listing and filtering objects
+ *                 like domains, domain snapshots, storage pools,
+ *                 storage vols, networks, etc.
  *
  * Copyright (C) 2012 Red Hat, Inc.
  *
@@ -22,7 +24,7 @@
 
 #include <config.h>
 
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #include "internal.h"
 #include "virhash.h"
@@ -31,7 +33,7 @@
 #include "datatypes.h"
 #include "virterror_internal.h"
 
-#define VIR_FROM_THIS VIR_FROM_DOMAIN
+#define VIR_FROM_THIS VIR_FROM_NONE
 
 struct virDomainListData {
     virConnectPtr conn;
@@ -58,7 +60,7 @@ virDomainListPopulate(void *payload,
     /* check if the domain matches the filter */
 
     /* filter by active state */
-    if (MATCH(VIR_CONNECT_LIST_FILTERS_ACTIVE) &&
+    if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE) &&
         !((MATCH(VIR_CONNECT_LIST_DOMAINS_ACTIVE) &&
            virDomainObjIsActive(vm)) ||
           (MATCH(VIR_CONNECT_LIST_DOMAINS_INACTIVE) &&
@@ -66,7 +68,7 @@ virDomainListPopulate(void *payload,
         goto cleanup;
 
     /* filter by persistence */
-    if (MATCH(VIR_CONNECT_LIST_FILTERS_PERSISTENT) &&
+    if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT) &&
         !((MATCH(VIR_CONNECT_LIST_DOMAINS_PERSISTENT) &&
            vm->persistent) ||
           (MATCH(VIR_CONNECT_LIST_DOMAINS_TRANSIENT) &&
@@ -74,7 +76,7 @@ virDomainListPopulate(void *payload,
         goto cleanup;
 
     /* filter by domain state */
-    if (MATCH(VIR_CONNECT_LIST_FILTERS_STATE)) {
+    if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE)) {
         int st = virDomainObjGetState(vm, NULL);
         if (!((MATCH(VIR_CONNECT_LIST_DOMAINS_RUNNING) &&
                st == VIR_DOMAIN_RUNNING) ||
@@ -90,7 +92,7 @@ virDomainListPopulate(void *payload,
     }
 
     /* filter by existence of managed save state */
-    if (MATCH(VIR_CONNECT_LIST_FILTERS_MANAGEDSAVE) &&
+    if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE) &&
         !((MATCH(VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE) &&
            vm->hasManagedSave) ||
           (MATCH(VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE) &&
@@ -98,13 +100,13 @@ virDomainListPopulate(void *payload,
             goto cleanup;
 
     /* filter by autostart option */
-    if (MATCH(VIR_CONNECT_LIST_FILTERS_AUTOSTART) &&
+    if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART) &&
         !((MATCH(VIR_CONNECT_LIST_DOMAINS_AUTOSTART) && vm->autostart) ||
           (MATCH(VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART) && !vm->autostart)))
         goto cleanup;
 
     /* filter by snapshot existence */
-    if (MATCH(VIR_CONNECT_LIST_FILTERS_SNAPSHOT)) {
+    if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT)) {
         int nsnap = virDomainSnapshotObjListNum(&vm->snapshots, NULL, 0);
         if (!((MATCH(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT) && nsnap > 0) ||
               (MATCH(VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT) && nsnap <= 0)))
diff --git a/src/conf/virdomainlist.h b/src/conf/virobjectlist.h
similarity index 71%
rename from src/conf/virdomainlist.h
rename to src/conf/virobjectlist.h
index e623129..510a900 100644
--- a/src/conf/virdomainlist.h
+++ b/src/conf/virobjectlist.h
@@ -1,5 +1,7 @@
 /**
- * virdomainlist.h: Helpers for listing and filtering domains.
+ * virobjectlist.h: Helpers for listing and filtering objects
+ *                  like domains, storage pools, storage vols
+ *                  networks, etc.
  *
  * Copyright (C) 2012 Red Hat, Inc.
  *
@@ -19,46 +21,46 @@
  *
  * Author: Peter Krempa <pkrempa redhat com>
  */
-#ifndef __VIR_DOMAIN_LIST_H__
-# define __VIR_DOMAIN_LIST_H__
+#ifndef __VIR_OBJECT_LIST_H__
+# define __VIR_OBJECT_LIST_H__
 
 # include "internal.h"
 # include "virhash.h"
 # include "domain_conf.h"
 
-# define VIR_CONNECT_LIST_FILTERS_ACTIVE           \
+# define VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE   \
                 (VIR_CONNECT_LIST_DOMAINS_ACTIVE | \
                  VIR_CONNECT_LIST_DOMAINS_INACTIVE)
 
-# define VIR_CONNECT_LIST_FILTERS_PERSISTENT           \
+# define VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT   \
                 (VIR_CONNECT_LIST_DOMAINS_PERSISTENT | \
                  VIR_CONNECT_LIST_DOMAINS_TRANSIENT)
 
-# define VIR_CONNECT_LIST_FILTERS_STATE             \
+# define VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE     \
                 (VIR_CONNECT_LIST_DOMAINS_RUNNING | \
                  VIR_CONNECT_LIST_DOMAINS_PAUSED  | \
                  VIR_CONNECT_LIST_DOMAINS_SHUTOFF | \
                  VIR_CONNECT_LIST_DOMAINS_OTHER)
 
-# define VIR_CONNECT_LIST_FILTERS_MANAGEDSAVE           \
+# define VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE   \
                 (VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE | \
                  VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE)
 
-# define VIR_CONNECT_LIST_FILTERS_AUTOSTART            \
+# define VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART   \
                 (VIR_CONNECT_LIST_DOMAINS_AUTOSTART | \
                  VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART)
 
-# define VIR_CONNECT_LIST_FILTERS_SNAPSHOT               \
+# define VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT       \
                 (VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT | \
                  VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT)
 
-# define VIR_CONNECT_LIST_FILTERS_ALL                   \
-                (VIR_CONNECT_LIST_FILTERS_ACTIVE      | \
-                 VIR_CONNECT_LIST_FILTERS_PERSISTENT  | \
-                 VIR_CONNECT_LIST_FILTERS_STATE       | \
-                 VIR_CONNECT_LIST_FILTERS_MANAGEDSAVE | \
-                 VIR_CONNECT_LIST_FILTERS_AUTOSTART   | \
-                 VIR_CONNECT_LIST_FILTERS_SNAPSHOT)
+# define VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL                   \
+                (VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE      | \
+                 VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT  | \
+                 VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE       | \
+                 VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE | \
+                 VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART   | \
+                 VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT)
 
 # define VIR_DOMAIN_SNAPSHOT_FILTERS_METADATA           \
                (VIR_DOMAIN_SNAPSHOT_LIST_METADATA     | \
@@ -81,4 +83,4 @@ int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
                            virDomainSnapshotPtr **snaps,
                            unsigned int flags);
 
-#endif /* __VIR_DOMAIN_LIST_H__ */
+#endif /* __VIR_OBJECT_LIST_H__ */
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 03f7f3e..a15abe4 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1240,7 +1240,7 @@ virConsoleOpen;
 virDBusGetSystemBus;
 
 
-# virdomainlist.h
+# virobjectlist.h
 virDomainList;
 virDomainListSnapshots;
 
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 4d1db3a..e763799 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -45,7 +45,7 @@
 #include "xen_xm.h"
 #include "virtypedparam.h"
 #include "viruri.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #define VIR_FROM_THIS VIR_FROM_LIBXL
 
@@ -3867,7 +3867,7 @@ libxlListAllDomains(virConnectPtr conn,
     libxlDriverPrivatePtr driver = conn->privateData;
     int ret = -1;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     libxlDriverLock(driver);
     ret = virDomainList(conn, driver->domains.objs, domains, flags);
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 2d931db..40141f9 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -61,7 +61,7 @@
 #include "virtime.h"
 #include "virtypedparam.h"
 #include "viruri.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #define VIR_FROM_THIS VIR_FROM_LXC
 
@@ -3888,7 +3888,7 @@ lxcListAllDomains(virConnectPtr conn,
     lxc_driver_t *driver = conn->privateData;
     int ret = -1;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     lxcDriverLock(driver);
     ret = virDomainList(conn, driver->domains.objs, domains, flags);
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 8ecd83b..25391f5 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -60,7 +60,7 @@
 #include "command.h"
 #include "viruri.h"
 #include "stats_linux.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #define VIR_FROM_THIS VIR_FROM_OPENVZ
 
@@ -2061,7 +2061,7 @@ openvzListAllDomains(virConnectPtr conn,
     struct openvz_driver *driver = conn->privateData;
     int ret = -1;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     openvzDriverLock(driver);
     ret = virDomainList(conn, driver->domains.objs, domains, flags);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d3988b8..5db334d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -92,7 +92,7 @@
 #include "virnodesuspend.h"
 #include "virtime.h"
 #include "virtypedparam.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
@@ -13159,7 +13159,7 @@ qemuListAllDomains(virConnectPtr conn,
     struct qemud_driver *driver = conn->privateData;
     int ret = -1;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     qemuDriverLock(driver);
     ret = virDomainList(conn, driver->domains.objs, domains, flags);
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 061f687..0207dc6 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -52,7 +52,7 @@
 #include "virfile.h"
 #include "virtypedparam.h"
 #include "virrandom.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #define VIR_FROM_THIS VIR_FROM_TEST
 
@@ -5525,7 +5525,7 @@ static int testListAllDomains(virConnectPtr conn,
     testConnPtr privconn = conn->privateData;
     int ret;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     testDriverLock(privconn);
     ret = virDomainList(conn, privconn->domains.objs, domains, flags);
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 098ee7b..7359e21 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -64,7 +64,7 @@
 #include "virnetdevtap.h"
 #include "virnodesuspend.h"
 #include "viruri.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 #define VIR_FROM_THIS VIR_FROM_UML
 
@@ -2527,7 +2527,7 @@ static int umlListAllDomains(virConnectPtr conn,
     struct uml_driver *driver = conn->privateData;
     int ret = -1;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     umlDriverLock(driver);
     ret = virDomainList(conn, driver->domains.objs, domains, flags);
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index e0e6db7..365270e 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -57,7 +57,7 @@
 #include "virfile.h"
 #include "fdstream.h"
 #include "viruri.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 /* This one changes from version to version. */
 #if VBOX_API_VERSION == 2002
@@ -9257,7 +9257,7 @@ vboxListAllDomains(virConnectPtr conn,
     bool active;
     PRUint32 snapshotCount;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     /* filter out flag options that will produce 0 results in vbox driver:
      * - managed save: vbox guests don't have managed save images
@@ -9305,13 +9305,13 @@ vboxListAllDomains(virConnectPtr conn,
                     active = false;
 
                 /* filter by active state */
-                if (MATCH(VIR_CONNECT_LIST_FILTERS_ACTIVE) &&
+                if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE) &&
                     !((MATCH(VIR_CONNECT_LIST_DOMAINS_ACTIVE) && active) ||
                       (MATCH(VIR_CONNECT_LIST_DOMAINS_INACTIVE) && !active)))
                     continue;
 
                 /* filter by snapshot existence */
-                if (MATCH(VIR_CONNECT_LIST_FILTERS_SNAPSHOT)) {
+                if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT)) {
                     rc = machine->vtbl->GetSnapshotCount(machine, &snapshotCount);
                     if (NS_FAILED(rc)) {
                         vboxError(VIR_ERR_INTERNAL_ERROR,
@@ -9326,7 +9326,7 @@ vboxListAllDomains(virConnectPtr conn,
                 }
 
                 /* filter by machine state */
-                if (MATCH(VIR_CONNECT_LIST_FILTERS_STATE) &&
+                if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE) &&
                     !((MATCH(VIR_CONNECT_LIST_DOMAINS_RUNNING) &&
                        state == MachineState_Running) ||
                       (MATCH(VIR_CONNECT_LIST_DOMAINS_PAUSED) &&
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index 2b9a275..cfdaa2c 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -34,7 +34,7 @@
 #include "vmx.h"
 #include "vmware_conf.h"
 #include "vmware_driver.h"
-#include "virdomainlist.h"
+#include "virobjectlist.h"
 
 static const char *vmw_types[] = { "player", "ws" };
 
@@ -1098,7 +1098,7 @@ vmwareListAllDomains(virConnectPtr conn,
     struct vmware_driver *driver = conn->privateData;
     int ret = -1;
 
-    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
+    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
 
     vmwareDriverLock(driver);
     vmwareDomainObjListUpdateAll(&driver->domains, driver);
diff --git a/tools/virsh.c b/tools/virsh.c
index b9e159b..40f3be3 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -65,7 +65,7 @@
 #include "conf/domain_conf.h"
 #include "virtypedparam.h"
 #include "intprops.h"
-#include "conf/virdomainlist.h"
+#include "conf/virobjectlist.h"
 
 static char *progname;
 
@@ -1100,7 +1100,7 @@ fallback:
     virResetLastError();
 
     /* list active domains, if necessary */
-    if (!MATCH(VIR_CONNECT_LIST_FILTERS_ACTIVE) ||
+    if (!MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE) ||
         MATCH(VIR_CONNECT_LIST_DOMAINS_ACTIVE)) {
         if ((nids = virConnectNumOfDomains(ctl->conn)) < 0) {
             vshError(ctl, "%s", _("Failed to list active domains"));
@@ -1117,7 +1117,7 @@ fallback:
         }
     }
 
-    if (!MATCH(VIR_CONNECT_LIST_FILTERS_ACTIVE) ||
+    if (!MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE) ||
         MATCH(VIR_CONNECT_LIST_DOMAINS_INACTIVE)) {
         if ((nnames = virConnectNumOfDefinedDomains(ctl->conn)) < 0) {
             vshError(ctl, "%s", _("Failed to list inactive domains"));
@@ -1161,7 +1161,7 @@ filter:
         dom = list->domains[i];
 
         /* persistence filter */
-        if (MATCH(VIR_CONNECT_LIST_FILTERS_PERSISTENT)) {
+        if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT)) {
             if ((persistent = virDomainIsPersistent(dom)) < 0) {
                 vshError(ctl, "%s", _("Failed to get domain persistence info"));
                 goto cleanup;
@@ -1173,7 +1173,7 @@ filter:
         }
 
         /* domain state filter */
-        if (MATCH(VIR_CONNECT_LIST_FILTERS_STATE)) {
+        if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE)) {
             if (virDomainGetState(dom, &state, NULL, 0) < 0) {
                 vshError(ctl, "%s", _("Failed to get domain state"));
                 goto cleanup;
@@ -1193,7 +1193,7 @@ filter:
         }
 
         /* autostart filter */
-        if (MATCH(VIR_CONNECT_LIST_FILTERS_AUTOSTART)) {
+        if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART)) {
             if (virDomainGetAutostart(dom, &autostart) < 0) {
                 vshError(ctl, "%s", _("Failed to get domain autostart state"));
                 goto cleanup;
@@ -1205,7 +1205,7 @@ filter:
         }
 
         /* managed save filter */
-        if (MATCH(VIR_CONNECT_LIST_FILTERS_MANAGEDSAVE)) {
+        if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE)) {
             if ((mansave = virDomainHasManagedSaveImage(dom, 0)) < 0) {
                 vshError(ctl, "%s",
                          _("Failed to check for managed save image"));
@@ -1218,7 +1218,7 @@ filter:
         }
 
         /* snapshot filter */
-        if (MATCH(VIR_CONNECT_LIST_FILTERS_SNAPSHOT)) {
+        if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT)) {
             if ((nsnap = virDomainSnapshotNum(dom, 0)) < 0) {
                 vshError(ctl, "%s", _("Failed to get snapshot count"));
                 goto cleanup;
-- 
1.7.7.3


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