Re: [PATCHv2 8/9] virNodeGetCPUMapFlags: Implement driver support

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

 



On 10/16/2012 08:05 AM, Viktor Mihajlovski wrote:
> Driver support added for:
> - test, pretending 8 host CPUS, 3 being online
> - qemu, using nodeGetCPUMapFlags

We should implement this for as many drivers as possible; at least LXC
also comes to mind as being able to support this (I'm not quite as sure
about Xen).

Obviously, we can't push this until 7/9 is sorted out; but this is what
I'm thinking of squashing.

diff --git i/src/lxc/lxc_driver.c w/src/lxc/lxc_driver.c
index 87305db..2072f00 100644
--- i/src/lxc/lxc_driver.c
+++ w/src/lxc/lxc_driver.c
@@ -2736,6 +2736,7 @@ static virDriver lxcDriver = {
     .nodeGetMemoryStats = nodeGetMemoryStats, /* 0.9.3 */
     .nodeGetCellsFreeMemory = nodeGetCellsFreeMemory, /* 0.6.5 */
     .nodeGetFreeMemory = nodeGetFreeMemory, /* 0.6.5 */
+    .nodeGetCPUMap = nodeGetCPUMap, /* 1.0.0 */
     .domainEventRegister = lxcDomainEventRegister, /* 0.7.0 */
     .domainEventDeregister = lxcDomainEventDeregister, /* 0.7.0 */
     .isEncrypted = lxcIsEncrypted, /* 0.7.3 */
diff --git i/src/openvz/openvz_driver.c w/src/openvz/openvz_driver.c
index 2f51c1c..fb3c552 100644
--- i/src/openvz/openvz_driver.c
+++ w/src/openvz/openvz_driver.c
@@ -2127,6 +2127,7 @@ static virDriver openvzDriver = {
     .nodeGetMemoryStats = nodeGetMemoryStats, /* 0.9.12 */
     .nodeGetCellsFreeMemory = nodeGetCellsFreeMemory, /* 0.9.12 */
     .nodeGetFreeMemory = nodeGetFreeMemory, /* 0.9.12 */
+    .nodeGetCPUMap = nodeGetCPUMap, /* 1.0.0 */
     .getCapabilities = openvzGetCapabilities, /* 0.4.6 */
     .listDomains = openvzListDomains, /* 0.3.1 */
     .numOfDomains = openvzNumDomains, /* 0.3.1 */
diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index 37e334c..5a1c185 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -14196,7 +14196,7 @@ static virDriver qemuDriver = {
     .domainGetCPUStats = qemuDomainGetCPUStats, /* 0.9.11 */
     .nodeGetMemoryParameters = nodeGetMemoryParameters, /* 0.10.2 */
     .nodeSetMemoryParameters = nodeSetMemoryParameters, /* 0.10.2 */
-    .nodeGetCPUMapFlags = nodeGetCPUMapFlags, /* 1.0.0 */
+    .nodeGetCPUMap = nodeGetCPUMap, /* 1.0.0 */
 };


diff --git i/src/test/test_driver.c w/src/test/test_driver.c
index 24f3b11..58c4e67 100644
--- i/src/test/test_driver.c
+++ w/src/test/test_driver.c
@@ -5687,10 +5687,11 @@ static int testListAllDomains(virConnectPtr conn,
     return ret;
 }

-static int testNodeGetCPUMapFlags(virConnectPtr conn,
-                                  unsigned char **cpumap,
-                                  unsigned int *online,
-                                  unsigned int flags)
+static int
+testNodeGetCPUMap(virConnectPtr conn,
+                  unsigned char **cpumap,
+                  unsigned int *online,
+                  unsigned int flags)
 {
     testConnPtr privconn = conn->privateData;
     int ret = -1;
@@ -5785,7 +5786,7 @@ static virDriver testDriver = {
     .domainEventRegisterAny = testDomainEventRegisterAny, /* 0.8.0 */
     .domainEventDeregisterAny = testDomainEventDeregisterAny, /* 0.8.0 */
     .isAlive = testIsAlive, /* 0.9.8 */
-    .nodeGetCPUMapFlags = testNodeGetCPUMapFlags, /* 1.0.0 */
+    .nodeGetCPUMap = testNodeGetCPUMap, /* 1.0.0 */
 };

 static virNetworkDriver testNetworkDriver = {
diff --git i/src/uml/uml_driver.c w/src/uml/uml_driver.c
index ba37eb7..2c6e820 100644
--- i/src/uml/uml_driver.c
+++ w/src/uml/uml_driver.c
@@ -2612,6 +2612,7 @@ static virDriver umlDriver = {
     .nodeGetMemoryStats = nodeGetMemoryStats, /* 0.9.3 */
     .nodeGetCellsFreeMemory = nodeGetCellsFreeMemory, /* 0.5.0 */
     .nodeGetFreeMemory = nodeGetFreeMemory, /* 0.5.0 */
+    .nodeGetCPUMap = nodeGetCPUMap, /* 1.0.0 */
     .domainEventRegister = umlDomainEventRegister, /* 0.9.4 */
     .domainEventDeregister = umlDomainEventDeregister, /* 0.9.4 */
     .isEncrypted = umlIsEncrypted, /* 0.7.3 */


-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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