diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 0520ce988e72a9eee627e9818842dc71806c05b0..4d1db3aad9b3db026e67ba1a762d834ea04185e3 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -45,6 +45,7 @@ #include "xen_xm.h" #include "virtypedparam.h" #include "viruri.h" +#include "virdomainlist.h" #define VIR_FROM_THIS VIR_FROM_LIBXL @@ -3858,6 +3859,24 @@ libxlIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED) return 1; } +static int +libxlListAllDomains(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags) +{ + libxlDriverPrivatePtr driver = conn->privateData; + int ret = -1; + + virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1); + + libxlDriverLock(driver); + ret = virDomainList(conn, driver->domains.objs, domains, flags); + libxlDriverUnlock(driver); + + return ret; +} + + static virDriver libxlDriver = { .no = VIR_DRV_LIBXL, @@ -3872,6 +3891,7 @@ static virDriver libxlDriver = { .getCapabilities = libxlGetCapabilities, /* 0.9.0 */ .listDomains = libxlListDomains, /* 0.9.0 */ .numOfDomains = libxlNumDomains, /* 0.9.0 */ + .listAllDomains = libxlListAllDomains, /* 0.9.13 */ .domainCreateXML = libxlDomainCreateXML, /* 0.9.0 */ .domainLookupByID = libxlDomainLookupByID, /* 0.9.0 */ .domainLookupByUUID = libxlDomainLookupByUUID, /* 0.9.0 */ diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 1b91a6d99d9ca00a576337d8b66e3168238a9811..b58aeae632eaaf5ea1e8af7795700ca1f9227e0e 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -61,6 +61,7 @@ #include "virtime.h" #include "virtypedparam.h" #include "viruri.h" +#include "virdomainlist.h" #define VIR_FROM_THIS VIR_FROM_LXC @@ -3880,6 +3881,23 @@ cleanup: return ret; } +static int +lxcListAllDomains(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags) +{ + lxc_driver_t *driver = conn->privateData; + int ret = -1; + + virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1); + + lxcDriverLock(driver); + ret = virDomainList(conn, driver->domains.objs, domains, flags); + lxcDriverUnlock(driver); + + return ret; +} + static int lxcVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED, virHashIterator iter, void *data) @@ -3920,6 +3938,7 @@ static virDriver lxcDriver = { .getCapabilities = lxcGetCapabilities, /* 0.6.5 */ .listDomains = lxcListDomains, /* 0.4.2 */ .numOfDomains = lxcNumDomains, /* 0.4.2 */ + .listAllDomains = lxcListAllDomains, /* 0.9.13 */ .domainCreateXML = lxcDomainCreateAndStart, /* 0.4.4 */ .domainLookupByID = lxcDomainLookupByID, /* 0.4.2 */ .domainLookupByUUID = lxcDomainLookupByUUID, /* 0.4.2 */ diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 10c2664a20342906eed37eeae02ca328a2dd945a..c9150e0b74ba94b07930ccc52721ceeacb967591 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -60,6 +60,7 @@ #include "command.h" #include "viruri.h" #include "stats_linux.h" +#include "virdomainlist.h" #define VIR_FROM_THIS VIR_FROM_OPENVZ @@ -2052,6 +2053,23 @@ cleanup: return ret; } +static int +openvzListAllDomains(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags) +{ + struct openvz_driver *driver = conn->privateData; + int ret = -1; + + virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1); + + openvzDriverLock(driver); + ret = virDomainList(conn, driver->domains.objs, domains, flags); + openvzDriverUnlock(driver); + + return ret; +} + static virDriver openvzDriver = { .no = VIR_DRV_OPENVZ, @@ -2070,6 +2088,7 @@ static virDriver openvzDriver = { .getCapabilities = openvzGetCapabilities, /* 0.4.6 */ .listDomains = openvzListDomains, /* 0.3.1 */ .numOfDomains = openvzNumDomains, /* 0.3.1 */ + .listAllDomains = openvzListAllDomains, /* 0.9.13 */ .domainCreateXML = openvzDomainCreateXML, /* 0.3.3 */ .domainLookupByID = openvzDomainLookupByID, /* 0.3.1 */ .domainLookupByUUID = openvzDomainLookupByUUID, /* 0.3.1 */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 628730e1ddca5b94f2257316bdd0f2b7993b2d75..2177c3096d3598da90814c4ad0e1a7bd3200b0d7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13140,6 +13140,23 @@ cleanup: return ret; } +static int +qemuListAllDomains(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags) +{ + struct qemud_driver *driver = conn->privateData; + int ret = -1; + + virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1); + + qemuDriverLock(driver); + ret = virDomainList(conn, driver->domains.objs, domains, flags); + qemuDriverUnlock(driver); + + return ret; +} + static virDriver qemuDriver = { .no = VIR_DRV_QEMU, .name = QEMU_DRIVER_NAME, @@ -13155,6 +13172,7 @@ static virDriver qemuDriver = { .getCapabilities = qemudGetCapabilities, /* 0.2.1 */ .listDomains = qemudListDomains, /* 0.2.0 */ .numOfDomains = qemudNumDomains, /* 0.2.0 */ + .listAllDomains = qemuListAllDomains, /* 0.9.13 */ .domainCreateXML = qemudDomainCreate, /* 0.2.0 */ .domainLookupByID = qemudDomainLookupByID, /* 0.2.0 */ .domainLookupByUUID = qemudDomainLookupByUUID, /* 0.2.0 */ diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 703874118f69c1da796c5d99081a9118dcc62d7a..b3b774d5f42583127572e4846762faf7eb22e9fd 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -52,6 +52,7 @@ #include "virfile.h" #include "virtypedparam.h" #include "virrandom.h" +#include "virdomainlist.h" #define VIR_FROM_THIS VIR_FROM_TEST @@ -5517,6 +5518,23 @@ static int testNWFilterClose(virConnectPtr conn) { return 0; } +static int testListAllDomains(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags) +{ + testConnPtr privconn = conn->privateData; + int ret; + + virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1); + + testDriverLock(privconn); + ret = virDomainList(conn, privconn->domains.objs, domains, flags); + testDriverUnlock(privconn); + + return ret; +} + + static virDriver testDriver = { .no = VIR_DRV_TEST, .name = "Test", @@ -5529,6 +5547,7 @@ static virDriver testDriver = { .getCapabilities = testGetCapabilities, /* 0.2.1 */ .listDomains = testListDomains, /* 0.1.1 */ .numOfDomains = testNumOfDomains, /* 0.1.1 */ + .listAllDomains = testListAllDomains, /* 0.9.13 */ .domainCreateXML = testDomainCreateXML, /* 0.1.4 */ .domainLookupByID = testLookupDomainByID, /* 0.1.1 */ .domainLookupByUUID = testLookupDomainByUUID, /* 0.1.1 */ diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 219246dcbb1013310c389601150262c3dc6a1104..098ee7ba6b508a2c791aac5b3c219de97d6f6c7d 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -64,6 +64,7 @@ #include "virnetdevtap.h" #include "virnodesuspend.h" #include "viruri.h" +#include "virdomainlist.h" #define VIR_FROM_THIS VIR_FROM_UML @@ -2519,6 +2520,22 @@ static void umlDomainEventQueue(struct uml_driver *driver, virDomainEventStateQueue(driver->domainEventState, event); } +static int umlListAllDomains(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags) +{ + struct uml_driver *driver = conn->privateData; + int ret = -1; + + virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1); + + umlDriverLock(driver); + ret = virDomainList(conn, driver->domains.objs, domains, flags); + umlDriverUnlock(driver); + + return ret; +} + static virDriver umlDriver = { @@ -2533,6 +2550,7 @@ static virDriver umlDriver = { .getCapabilities = umlGetCapabilities, /* 0.5.0 */ .listDomains = umlListDomains, /* 0.5.0 */ .numOfDomains = umlNumDomains, /* 0.5.0 */ + .listAllDomains = umlListAllDomains, /* 0.9.13 */ .domainCreateXML = umlDomainCreate, /* 0.5.0 */ .domainLookupByID = umlDomainLookupByID, /* 0.5.0 */ .domainLookupByUUID = umlDomainLookupByUUID, /* 0.5.0 */ diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 8f9d92270cdf12e7e26d6e788db062b203a2d9d2..a3356516e6b363bc6b3393bfead30430540595b0 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -33,6 +33,7 @@ #include "vmx.h" #include "vmware_conf.h" #include "vmware_driver.h" +#include "virdomainlist.h" static const char *vmw_types[] = { "player", "ws" }; @@ -994,6 +995,24 @@ vmwareIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED) return 1; } +static int +vmwareListAllDomains(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags) +{ + struct vmware_driver *driver = conn->privateData; + int ret = -1; + + virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1); + + vmwareDriverLock(driver); + ret = virDomainList(conn, driver->domains.objs, domains, flags); + vmwareDriverUnlock(driver); + return ret; +} + + + static virDriver vmwareDriver = { .no = VIR_DRV_VMWARE, .name = "VMWARE", @@ -1003,6 +1022,7 @@ static virDriver vmwareDriver = { .version = vmwareGetVersion, /* 0.8.7 */ .listDomains = vmwareListDomains, /* 0.8.7 */ .numOfDomains = vmwareNumDomains, /* 0.8.7 */ + .listAllDomains = vmwareListAllDomains, /* 0.9.13 */ .domainCreateXML = vmwareDomainCreateXML, /* 0.8.7 */ .domainLookupByID = vmwareDomainLookupByID, /* 0.8.7 */ .domainLookupByUUID = vmwareDomainLookupByUUID, /* 0.8.7 */