[libvirt] [PATCH 0/3] Fix filling of nodeinfo structure and add test cases
by Peter Krempa
For explanation see patch 1/3.
Peter Krempa (3):
nodeinfo: Fix gathering of nodeinfo data structure
test: Add new test case for nodeinfotest
test: Add test case for nodeinfotest if host machine doesn't have
NUMA
src/nodeinfo.c | 311 +++++++++-------
.../linux-nodeinfo-sysfs-test-2/node/node0/cpu0 | 1 +
.../linux-nodeinfo-sysfs-test-2/node/node0/cpu1 | 1 +
.../linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt | 2 +-
.../linux-nodeinfo-sysfs-test-3/node/node0/cpu0 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node0/cpu12 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node0/cpu16 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node0/cpu20 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node0/cpu4 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node0/cpu8 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node0/meminfo | 38 +-
.../linux-nodeinfo-sysfs-test-3/node/node1/cpu24 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node1/cpu28 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node1/cpu32 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node1/cpu36 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node1/cpu40 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node1/cpu44 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node1/meminfo | 36 +-
.../linux-nodeinfo-sysfs-test-3/node/node2/cpu11 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node2/cpu15 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node2/cpu19 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node2/cpu23 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node2/cpu3 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node2/cpu7 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node2/meminfo | 38 +-
.../linux-nodeinfo-sysfs-test-3/node/node3/cpu27 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node3/cpu31 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node3/cpu35 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node3/cpu39 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node3/cpu43 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node3/cpu47 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node3/meminfo | 38 +-
.../linux-nodeinfo-sysfs-test-3/node/node4/cpu10 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node4/cpu14 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node4/cpu18 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node4/cpu2 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node4/cpu22 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node4/cpu6 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node4/meminfo | 38 +-
.../linux-nodeinfo-sysfs-test-3/node/node5/cpu26 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node5/cpu30 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node5/cpu34 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node5/cpu38 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node5/cpu42 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node5/cpu46 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node5/meminfo | 38 +-
.../linux-nodeinfo-sysfs-test-3/node/node6/cpu1 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node6/cpu13 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node6/cpu17 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node6/cpu21 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node6/cpu5 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node6/cpu9 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node6/meminfo | 40 +-
.../linux-nodeinfo-sysfs-test-3/node/node7/cpu25 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node7/cpu29 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node7/cpu33 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node7/cpu37 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node7/cpu41 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node7/cpu45 | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node7/meminfo | 38 +-
.../linux-nodeinfo-sysfs-test-3/node/possible | Bin 4 -> 5 bytes
.../linux-nodeinfo-sysfs-test-4-x86.cpuinfo | 400 ++++++++++++++++++++
.../cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../cpu/cpu0/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu1/online | 1 +
.../cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../cpu/cpu1/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu10/online | 1 +
.../cpu/cpu10/topology/core_id | 1 +
.../cpu/cpu10/topology/physical_package_id | 1 +
.../cpu/cpu10/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu11/online | 1 +
.../cpu/cpu11/topology/core_id | 1 +
.../cpu/cpu11/topology/physical_package_id | 1 +
.../cpu/cpu11/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu12/online | 1 +
.../cpu/cpu12/topology/core_id | 1 +
.../cpu/cpu12/topology/physical_package_id | 1 +
.../cpu/cpu12/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu13/online | 1 +
.../cpu/cpu13/topology/core_id | 1 +
.../cpu/cpu13/topology/physical_package_id | 1 +
.../cpu/cpu13/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu14/online | 1 +
.../cpu/cpu14/topology/core_id | 1 +
.../cpu/cpu14/topology/physical_package_id | 1 +
.../cpu/cpu14/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu15/online | 1 +
.../cpu/cpu15/topology/core_id | 1 +
.../cpu/cpu15/topology/physical_package_id | 1 +
.../cpu/cpu15/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu2/online | 1 +
.../cpu/cpu2/topology/core_id | 1 +
.../cpu/cpu2/topology/physical_package_id | 1 +
.../cpu/cpu2/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu3/online | 1 +
.../cpu/cpu3/topology/core_id | 1 +
.../cpu/cpu3/topology/physical_package_id | 1 +
.../cpu/cpu3/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu4/online | 1 +
.../cpu/cpu4/topology/core_id | 1 +
.../cpu/cpu4/topology/physical_package_id | 1 +
.../cpu/cpu4/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu5/online | 1 +
.../cpu/cpu5/topology/core_id | 1 +
.../cpu/cpu5/topology/physical_package_id | 1 +
.../cpu/cpu5/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu6/online | 1 +
.../cpu/cpu6/topology/core_id | 1 +
.../cpu/cpu6/topology/physical_package_id | 1 +
.../cpu/cpu6/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu7/online | 1 +
.../cpu/cpu7/topology/core_id | 1 +
.../cpu/cpu7/topology/physical_package_id | 1 +
.../cpu/cpu7/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu8/online | 1 +
.../cpu/cpu8/topology/core_id | 1 +
.../cpu/cpu8/topology/physical_package_id | 1 +
.../cpu/cpu8/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/cpu/cpu9/online | 1 +
.../cpu/cpu9/topology/core_id | 1 +
.../cpu/cpu9/topology/physical_package_id | 1 +
.../cpu/cpu9/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu0 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu1 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu2 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu3 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu4 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu5 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu6 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/cpu7 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node0/meminfo | 29 ++
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu10 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu11 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu12 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu13 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu14 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu15 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu8 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/cpu9 | 1 +
.../linux-nodeinfo-sysfs-test-4/node/node1/meminfo | 29 ++
.../linux-nodeinfo-sysfs-test-4/node/possible | Bin 0 -> 5 bytes
.../linux-nodeinfo-sysfs-test-5-x86.cpuinfo | 100 +++++
.../cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/core_siblings | 1 +
.../cpu/cpu0/topology/core_siblings_list | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../cpu/cpu0/topology/thread_siblings | 1 +
.../cpu/cpu0/topology/thread_siblings_list | 1 +
.../linux-nodeinfo-sysfs-test-5/cpu/cpu1/online | 1 +
.../cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/core_siblings | 1 +
.../cpu/cpu1/topology/core_siblings_list | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../cpu/cpu1/topology/thread_siblings | 1 +
.../cpu/cpu1/topology/thread_siblings_list | 1 +
.../linux-nodeinfo-sysfs-test-5/cpu/cpu2/online | 1 +
.../cpu/cpu2/topology/core_id | 1 +
.../cpu/cpu2/topology/core_siblings | 1 +
.../cpu/cpu2/topology/core_siblings_list | 1 +
.../cpu/cpu2/topology/physical_package_id | 1 +
.../cpu/cpu2/topology/thread_siblings | 1 +
.../cpu/cpu2/topology/thread_siblings_list | 1 +
.../linux-nodeinfo-sysfs-test-5/cpu/cpu3/online | 1 +
.../cpu/cpu3/topology/core_id | 1 +
.../cpu/cpu3/topology/core_siblings | 1 +
.../cpu/cpu3/topology/core_siblings_list | 1 +
.../cpu/cpu3/topology/physical_package_id | 1 +
.../cpu/cpu3/topology/thread_siblings | 1 +
.../cpu/cpu3/topology/thread_siblings_list | 1 +
tests/nodeinfotest.c | 2 +
173 files changed, 1053 insertions(+), 280 deletions(-)
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu0
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu1
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu0
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu12
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu16
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu20
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu4
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu8
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu24
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu28
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu32
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu36
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu40
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu44
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu11
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu15
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu19
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu23
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu3
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu7
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu27
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu31
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu35
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu39
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu43
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu47
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu10
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu14
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu18
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu2
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu22
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu6
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu26
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu30
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu34
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu38
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu42
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu46
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu1
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu13
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu17
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu21
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu5
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu9
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu25
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu29
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu33
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu37
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu41
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu45
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4-x86.cpuinfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu10/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu10/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu10/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu10/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu11/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu11/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu11/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu11/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu12/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu12/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu12/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu12/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu13/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu13/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu13/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu13/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu14/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu14/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu14/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu14/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu15/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu15/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu15/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu15/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu2/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu2/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu3/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu3/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu4/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu4/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu4/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu4/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu5/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu5/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu5/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu5/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu6/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu6/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu6/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu6/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu7/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu7/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu7/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu7/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu8/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu8/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu8/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu8/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu9/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu9/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu9/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/cpu/cpu9/topology/thread_siblings
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu0
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu1
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu2
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu3
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu4
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu5
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu6
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/cpu7
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node0/meminfo
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu10
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu11
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu12
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu13
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu14
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu15
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu8
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/cpu9
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/node1/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-4/node/possible
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5-x86.cpuinfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu0/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu0/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu0/topology/thread_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu1/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu1/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu1/topology/thread_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu2/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu2/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu2/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu2/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu2/topology/thread_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu3/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu3/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu3/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu3/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-5/cpu/cpu3/topology/thread_siblings_list
--
1.7.8.6
12 years, 5 months
[libvirt] [PATCH 0/3] fix segfault when trying to discover netfs pool sources
by Peter Krempa
https://bugzilla.redhat.com/show_bug.cgi?id=837470
There's a regression in the netfs detection code that causes a double-free
error when the detection fails. After fixing the regression another one
appeared connected with adding multiple pool source hosts. This series fixes
both problems.
Peter Krempa (3):
storage_conf: Break long line and polish coding style
storage_backend_fs: Don't free a part of a structure on error
storage_backend_fs: Allocate entry for host before accessing it
src/conf/storage_conf.c | 12 ++++++------
src/storage/storage_backend_fs.c | 11 ++++-------
2 files changed, 10 insertions(+), 13 deletions(-)
--
1.7.8.6
12 years, 5 months
[libvirt] [PATCH RESEND] add xhci support
by Gerd Hoffmann
qemu 1.1 features a xhci controller,
this patch adds support for it.
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
docs/formatdomain.html.in | 4 ++--
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 3 +++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 5 ++++-
7 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 1f30772..e1c0af5 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1820,8 +1820,8 @@
A "usb" controller has an optional attribute <code>model</code>,
which is one of "piix3-uhci", "piix4-uhci", "ehci",
"ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3",
- "vt82c686b-uhci" or "pci-ohci". The PowerPC64 "spapr-vio"
- addresses do not have an associated controller.
+ "vt82c686b-uhci", "pci-ohci" or "nec-xhci". The PowerPC64
+ "spapr-vio" addresses do not have an associated controller.
</p>
<p>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 46e539d..8630625 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1201,6 +1201,7 @@
<value>ich9-uhci3</value>
<value>vt82c686b-uhci</value>
<value>pci-ohci</value>
+ <value>nec-xhci</value>
</choice>
</attribute>
</optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 81c6308..4651765 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -257,7 +257,8 @@ VIR_ENUM_IMPL(virDomainControllerModelUSB, VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
"ich9-uhci2",
"ich9-uhci3",
"vt82c686b-uhci",
- "pci-ohci")
+ "pci-ohci",
+ "nec-xhci")
VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
"mount",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 44280ba..3712785 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -631,6 +631,7 @@ enum virDomainControllerModelUSB {
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3,
VIR_DOMAIN_CONTROLLER_MODEL_USB_VT82C686B_UHCI,
VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI,
+ VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI,
VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST
};
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4308833..578daeb 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -165,6 +165,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"hda-micro", /* 95 */
"dump-guest-memory",
+ "nec-usb-xhci",
);
@@ -1421,6 +1422,8 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
qemuCapsSet(flags, QEMU_CAPS_VT82C686B_USB_UHCI);
if (strstr(str, "name \"pci-ohci\""))
qemuCapsSet(flags, QEMU_CAPS_PCI_OHCI);
+ if (strstr(str, "name \"nec-usb-xhci\""))
+ qemuCapsSet(flags, QEMU_CAPS_NEC_USB_XHCI);
if (strstr(str, "name \"usb-redir\""))
qemuCapsSet(flags, QEMU_CAPS_USB_REDIR);
if (strstr(str, "name \"usb-hub\""))
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 640f7f5..83c135b 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -132,6 +132,7 @@ enum qemuCapsFlags {
QEMU_CAPS_NO_USER_CONFIG = 94, /* -no-user-config */
QEMU_CAPS_HDA_MICRO = 95, /* -device hda-micro */
QEMU_CAPS_DUMP_GUEST_MEMORY = 96, /* dump-guest-memory command */
+ QEMU_CAPS_NEC_USB_XHCI = 97, /* -device nec-usb-xhci */
QEMU_CAPS_LAST, /* this must always be the last item */
};
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index bd4f96a..6549f57 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -106,7 +106,8 @@ VIR_ENUM_IMPL(qemuControllerModelUSB, VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
"ich9-usb-uhci2",
"ich9-usb-uhci3",
"vt82c686b-usb-uhci",
- "pci-ohci");
+ "pci-ohci",
+ "nec-usb-xhci");
VIR_ENUM_DECL(qemuDomainFSDriver)
VIR_ENUM_IMPL(qemuDomainFSDriver, VIR_DOMAIN_FS_DRIVER_TYPE_LAST,
@@ -2598,6 +2599,8 @@ qemuControllerModelUSBToCaps(int model)
return QEMU_CAPS_VT82C686B_USB_UHCI;
case VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI:
return QEMU_CAPS_PCI_OHCI;
+ case VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI:
+ return QEMU_CAPS_NEC_USB_XHCI;
default:
return -1;
}
--
1.7.1
12 years, 5 months
[libvirt] numa query
by kapil jain
Hi,
I have a host machine which contains 4 numa nodes each with 2 GB memory and 4 cpus. I am using qem-kvm hypervisor.
I am trying to create a guest with the similar topology (4 numa nodes, with only 2 vcpus and 1 GB memory) as host. Each vcpu is 1-1 pinned to physical cpus(i.e. guest{socket0 cpu0} is pinned to host{socket0 cpu0). But one critical requirement is that one guest socket should not have memory from two host sockets to avoid numa access completely.
With the current constructs of numa/topology I am able to create the guest. But memory is not mapped as socket 1-1. numatune is not helping. Please suggest a possible way.
Thanks,
Kapil
12 years, 5 months
[libvirt] [PATCH] docs: Improve patch submission guidelines
by Michal Privoznik
We should really advise (new) developers to send rebased patches
that apply cleanly and use git-send-email rather than all other
obscure ways.
---
docs/hacking.html.in | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 89f9980..96859fd 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -11,19 +11,43 @@
<li><p>Post patches in unified diff format. A command similar to this
should work:</p>
-<pre>
+<del><pre>
diff -urp libvirt.orig/ libvirt.modified/ > libvirt-myfeature.patch
-</pre>
+</pre></del>
<p>
or:
</p>
<pre>
git diff > libvirt-myfeature.patch
</pre>
+ However, the usual workflow of libvirt developer is:
+<pre>
+ git checkout master
+ git pull
+ git checkout -b workbranch
+ Hack, committing any changes along the way
+</pre>
+ Then, when you want to post your patches:
+<pre>
+ git checkout master
+ git pull
+ git checkout workbranch
+ git rebase master
+ (fix any conflicts)
+ git send-email --compose --to=libvir-list(a)redhat.com master
+</pre>
+ Please follow this as close as you can, especially the rebase and git
+ send-email part as it makes developer's, who is reviewing your patch
+ set, life easier. One should avoid sending patches as attachment but
+ rather send them in email body among with commit message.
</li>
+
<li>Split large changes into a series of smaller patches, self-contained
if possible, with an explanation of each patch and an explanation of how
- the sequence of patches fits together.</li>
+ the sequence of patches fits together. Moreover, please keep in mind that
+ it's required to be able to compile cleanly after each patch.
+ </li>
+
<li>Make sure your patches apply against libvirt GIT. Developers
only follow GIT and don't care much about released versions.</li>
<li><p>Run the automated tests on your code before submitting any changes.
--
1.7.8.6
12 years, 5 months
[libvirt] [PATCH 00/15] Major refactor of LXC controller code
by Daniel P. Berrange
The LXC controller code (libvirt_lxc binary) has grown rather large
and complicated over time. One of the particularly bad problems is
that there is no single store of global state. The results is that
methods are passing around huge lists of parameters and it becomes
unclear who is responsible for cleaning up state on failure. Although
they are harmless in this context, there are many FDs which are
leaked in the normal shutdown path.
This series refactors everything so that a virLXCControllerPtr
object holds all global state. The final patch also switches over
to using the virNetServer APIs for the client/server monitor socket
handling.
There should be no functional change in this series, but it prepares
the way for the next fun bit which is to introduce a full RPC
protocol between libvirtd & libvirt_lxc. This will enable us to
provide a bunch of interesting new APIs that are desired for LXC.
Don't be put off by the large patch series - each change is fairly
small & self-contained, with primarily just renaming of variables
and funtions
daemon/libvirtd.c | 3
daemon/remote.c | 3
daemon/remote.h | 3
src/Makefile.am | 41 -
src/libvirt_private.syms | 1
src/lxc/lxc_container.c | 10
src/lxc/lxc_container.h | 2
src/lxc/lxc_controller.c | 1250 +++++++++++++++++++++--------------------------
src/rpc/virnetserver.c | 120 ++--
src/rpc/virnetserver.h | 6
src/util/virfile.c | 138 +++++
src/util/virfile.h | 3
12 files changed, 819 insertions(+), 761 deletions(-)
12 years, 5 months
[libvirt] [PATCH] ESX: Add routines to interface driver
by Ata Bohra
From: Ata E Husain <ata.husain(a)hotmail.com>
Includes most of the dirver routines except DefineXML, I am working on it and will update patch for it soon.
diff --git a/src/esx/esx_interface_driver.c b/src/esx/esx_interface_driver.c
index 5713137..4feadc2 100644
--- a/src/esx/esx_interface_driver.c
+++ b/src/esx/esx_interface_driver.c
@@ -23,6 +23,10 @@
*/
#include <config.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <libxml/parser.h>
#include "internal.h"
#include "util.h"
@@ -34,10 +38,10 @@
#include "esx_vi.h"
#include "esx_vi_methods.h"
#include "esx_util.h"
+#include "interface_conf.h"
#define VIR_FROM_THIS VIR_FROM_ESX
-
-
+#define XML_CAST (const xmlChar*)
static virDrvOpenStatus
esxInterfaceOpen(virConnectPtr conn,
@@ -67,10 +71,565 @@ esxInterfaceClose(virConnectPtr conn)
+static int
+esxNumOfInterfaces(virConnectPtr conn)
+{
+ esxPrivate *priv = conn->interfacePrivateData;
+ esxVI_HostVirtualNic *virtualNicList = NULL;
+ const esxVI_HostVirtualNic *virtualNic = NULL;
+ int count = 0;
+
+ if (esxVI_EnsureSession(priv->primary) < 0 ||
+ esxVI_LookupVirtualNicList(priv->primary, &virtualNicList) < 0) {
+ goto cleanup;
+ }
+
+ if (virtualNicList == NULL) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not retrieve vNic List"));
+
+ goto cleanup;
+ }
+
+ for (virtualNic = virtualNicList;
+ virtualNic != NULL;
+ virtualNic = virtualNic->_next) {
+ count++;
+ }
+
+cleanup:
+ esxVI_HostVirtualNic_Free(&virtualNicList);
+
+ return count;
+}
+
+
+
+static int
+esxNumOfDefinedInterfaces(virConnectPtr conn)
+{
+ conn->interfacePrivateData = NULL;
+
+ // ESX interfaces are always active
+ return 0;
+}
+
+
+
+static int
+esxListInterfaces(virConnectPtr conn, char **names, int maxnames)
+{
+ esxPrivate *priv = conn->interfacePrivateData;
+ esxVI_HostVirtualNic *virtualNicList = NULL;
+ const esxVI_HostVirtualNic *virtualNic = NULL;
+ int result = -1;
+ int i = 0;
+
+ if (esxVI_EnsureSession(priv->primary) < 0 ||
+ esxVI_LookupVirtualNicList(priv->primary,
+ &virtualNicList) < 0) {
+ goto cleanup;
+ }
+
+ if (virtualNicList == NULL) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not retrieve vNIC List"));
+ goto cleanup;
+ }
+
+ for (i= 0, virtualNic = virtualNicList;
+ virtualNic != NULL && i < maxnames;
+ ++i, virtualNic = virtualNic->_next) {
+ names[i] = strdup(virtualNic->device);
+
+ if (names[i] == NULL) {
+ for(;i >=0;--i) {
+ VIR_FREE(names[i]);
+ }
+ virReportOOMError();
+ goto cleanup;
+ }
+ }
+
+ result = i;
+ cleanup:
+ esxVI_HostVirtualNic_Free(&virtualNicList);
+
+ return result;
+}
+
+
+
+static int
+esxListDefinedInterfaces(virConnectPtr conn, char **names, int maxnames)
+{
+ conn->interfacePrivateData = NULL;
+ *names = NULL;
+
+ /* keeps compiler happy */
+ VIR_DEBUG("Max Interfaces: %d", maxnames);
+ /* ESX interfaces are always active */
+ return 0;
+}
+
+
+
+static virInterfacePtr
+esxInterfaceLookupByName(virConnectPtr conn, const char *name)
+{
+ esxPrivate *priv = conn->interfacePrivateData;
+ esxVI_HostVirtualNic *virtualNicList = NULL;
+ const esxVI_HostVirtualNic *virtualNic = NULL;
+ virInterfacePtr ret = NULL;
+
+ if (esxVI_EnsureSession(priv->primary) < 0 ||
+ esxVI_LookupVirtualNicList(priv->primary,
+ &virtualNicList) < 0) {
+ goto cleanup;
+ }
+
+ if (virtualNicList == 0) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not retrieve vNIC List"));
+ goto cleanup;
+ }
+
+
+ for(virtualNic = virtualNicList;
+ virtualNic != NULL;
+ virtualNic = virtualNic->_next) {
+ if (STREQ(virtualNic->device, name)) {
+ if (virtualNic->spec == NULL ||
+ virtualNic->spec->mac == NULL) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Malformed HostVirtualNicSpec"));
+ goto cleanup;
+ }
+
+ ret = virGetInterface(conn, virtualNic->device, virtualNic->spec->mac);
+ break;
+ }
+ }
+
+ cleanup:
+ esxVI_HostVirtualNic_Free(&virtualNicList);
+
+ return ret;
+}
+
+
+
+static virInterfacePtr
+esxInterfaceLookupByMACString(virConnectPtr conn, const char *mac)
+{
+ esxPrivate *priv = conn->interfacePrivateData;
+ esxVI_HostVirtualNic *virtualNicList = NULL;
+ const esxVI_HostVirtualNic *virtualNic = NULL;
+ virInterfacePtr ret = NULL;
+
+ if (esxVI_EnsureSession(priv->primary) < 0 ||
+ esxVI_LookupVirtualNicList(priv->primary,
+ &virtualNicList) < 0) {
+ goto cleanup;
+ }
+
+ if (virtualNicList == 0) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not retrieve vNIC List"));
+ goto cleanup;
+ }
+
+
+ for(virtualNic = virtualNicList;
+ virtualNic != NULL;
+ virtualNic = virtualNic->_next) {
+ if (virtualNic->spec == NULL ||
+ virtualNic->spec->mac == NULL) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Malformed HostVirtualNicSpec"));
+ goto cleanup;
+ }
+
+ if (STREQ(virtualNic->spec->mac, mac)) {
+ ret =
+ virGetInterface(conn, virtualNic->device, virtualNic->spec->mac);
+ break;
+ }
+ }
+
+ cleanup:
+ esxVI_HostVirtualNic_Free(&virtualNicList);
+
+ return ret;
+}
+
+
+/**
+ * Generates native XML descritpor for a given interface.
+ * For instance:
+ * <interface type="bridge" name="%s">
+ * <start mode="onboot"/>"
+ * <mtu size="%d"/>"
+ * <mac address="%s"/>
+ * <protocol family="ipv4">
+ * <dhcp/>
+ * <ip address="%s" prefix="%d"/>
+ * <route gateway="%s"/>
+ * </protocol>
+ * <bridge stp="off">
+ * <interface type="ethernet" name="%s">
+ * <mac address="%s"/>
+ * </interface>
+ * </bridge>
+ * </interface>
+ */
+static char*
+esxGetNativeInterfaceXMLDesc(const esxVI_HostVirtualNic *virtualNic,
+ const esxVI_HostIpRouteConfig *ipRouteConfig,
+ const esxVI_PhysicalNic *physicalNicList,
+ const unsigned int flags)
+{
+ const esxVI_PhysicalNic *physicalNic = NULL;
+ xmlDocPtr doc = NULL;
+ xmlNodePtr root = NULL;
+ xmlNodePtr startNode = NULL;
+ xmlNodePtr mtuNode = NULL;
+ xmlNodePtr protocolNode = NULL;
+ xmlNodePtr bridgeNode = NULL;
+ xmlNodePtr dhcpNode = NULL;
+ xmlChar *xmlbuff = NULL;
+ int use_static = 0;
+ struct in_addr addr;
+ uint32_t host_addr = 0;
+ int zero_count = 0;
+ int masklen = 0;
+ int i = 0;
+ virBuffer item = VIR_BUFFER_INITIALIZER;
+ int bufferSize = 0;
+ char *ret = NULL;
+
+ if (VIR_INTERFACE_XML_INACTIVE & flags) {
+ use_static = 1;
+ }
+
+ doc = xmlNewDoc(XML_CAST "1.0");
+ root = xmlNewDocNode(doc, NULL, XML_CAST "interface", NULL);
+
+ xmlNewProp(root, XML_CAST "type", XML_CAST "bridge");
+ xmlNewProp(root, XML_CAST "name", XML_CAST virtualNic->device);
+ xmlDocSetRootElement(doc, root);
+
+ /* define boot start mode */
+ startNode = xmlNewChild(root, NULL, XML_CAST "start", NULL);
+ xmlNewProp(startNode, XML_CAST "mode", XML_CAST "onboot");
+
+ /* append mtu value */
+ mtuNode = xmlNewChild(root, NULL, XML_CAST "mtu", NULL);
+ virBufferAsprintf(&item, "%d",virtualNic->spec->mtu &&
+ virtualNic->spec->mtu->value ?
+ virtualNic->spec->mtu->value :
+ 1500);
+ const char *mtustr = virBufferContentAndReset(&item);
+ if (mtustr == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ xmlNewProp(mtuNode, XML_CAST "size", XML_CAST mtustr);
+
+ /* append mac address field */
+ if (!use_static && virtualNic->spec->mac) {
+ xmlNodePtr mac_node = xmlNewChild(root, NULL, XML_CAST "mac", NULL);
+ xmlNewProp(mac_node, XML_CAST "address",
+ XML_CAST virtualNic->spec->mac);
+ }
+
+ /* TODO - Handle VLAN (via portgroup?) */
+ if (virtualNic->spec->ip->subnetMask &&
+ *virtualNic->spec->ip->subnetMask &&
+ inet_aton(virtualNic->spec->ip->subnetMask, &addr) == 0) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Error parsing netmask"));
+ goto cleanup;
+ }
+
+ host_addr = ntohl(addr.s_addr);
+ /* Calculate masklen */
+ for (i = 0; i < 32; ++i) {
+ if (host_addr & 0x01) {
+ break;
+ }
+ zero_count++;
+ host_addr >>= 1;
+ }
+ masklen = 32 - zero_count;
+
+ /* append protocol field */
+ /* TODO - Add IPv6 Support */
+ protocolNode = xmlNewChild(root, NULL, XML_CAST "protocol", NULL);
+ xmlNewProp(protocolNode, XML_CAST "family", XML_CAST "ipv4");
+ if (virtualNic->spec->ip->dhcp == 1) {
+ dhcpNode = xmlNewChild(protocolNode, NULL, XML_CAST "dhcp", NULL);
+ /* avoids compiler warning */
+ VIR_DEBUG("dhcpNode name: %s", (char *)dhcpNode->name);
+ }
+
+ if (virtualNic->spec->ip->dhcp != 1 || !use_static) {
+ if (virtualNic->spec->ip->ipAddress &&
+ *virtualNic->spec->ip->ipAddress) {
+ xmlNodePtr ipAddrNode =
+ xmlNewChild(protocolNode, NULL, XML_CAST "ip", NULL);
+ xmlNewProp(ipAddrNode, XML_CAST "address", XML_CAST
+ virtualNic->spec->ip->ipAddress);
+
+ virBufferAsprintf(&item, "%d", masklen);
+ const char *maskstr = virBufferContentAndReset(&item);
+ if (maskstr == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ xmlNewProp(ipAddrNode, XML_CAST "prefix", XML_CAST maskstr);
+
+ xmlNodePtr routeNode =
+ xmlNewChild(protocolNode, NULL, XML_CAST "route", NULL);
+ xmlNewProp(routeNode, XML_CAST "gateway",
+ XML_CAST ipRouteConfig->defaultGateway);
+ }
+ }
+
+ /* Add bridge information */
+ bridgeNode = xmlNewChild(root, NULL, XML_CAST "bridge", NULL);
+ xmlNewProp(bridgeNode, XML_CAST "stp", XML_CAST "off");
+
+ for (physicalNic = physicalNicList;
+ physicalNic != NULL;
+ physicalNic = physicalNic->_next) {
+ xmlNodePtr bridgeIfaceNode =
+ xmlNewChild(bridgeNode, NULL, XML_CAST "interface", NULL);
+ xmlNewProp(bridgeIfaceNode, XML_CAST "type", XML_CAST "ethernet");
+ xmlNewProp(bridgeIfaceNode, XML_CAST "name",
+ XML_CAST physicalNic->device);
+
+ xmlNodePtr bridgeIfaceMacNode =
+ xmlNewChild(bridgeIfaceNode, NULL, XML_CAST "mac", NULL);
+ xmlNewProp(bridgeIfaceMacNode, XML_CAST "address",
+ XML_CAST physicalNic->mac);
+ }
+
+ xmlDocDumpFormatMemory(doc, &xmlbuff, &bufferSize, 1);
+ if (xmlbuff == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ ret = strdup((char *)xmlbuff);
+ if (ret == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ cleanup:
+ VIR_FREE(mtustr);
+ if (xmlbuff != NULL) {
+ xmlFree(xmlbuff);
+ }
+ xmlFreeDoc(doc);
+
+ return ret;
+}
+
+
+
+static char*
+esxInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags)
+{
+ esxPrivate *priv = iface->conn->interfacePrivateData;
+ esxVI_HostVirtualNic *virtualNicList = NULL;
+ esxVI_HostVirtualNic *virtualNic = NULL;
+ esxVI_PhysicalNic *physicalNicList = NULL;
+ esxVI_PhysicalNic *matchingPhysicalNicList = NULL;
+ esxVI_HostIpRouteConfig *ipRouteConfig = NULL;
+ esxVI_HostPortGroup *portGroupList = NULL;
+ esxVI_HostVirtualSwitch *virtualSwitchList = NULL;
+ esxVI_String *propertyNameList = NULL;
+ esxVI_ObjectContent *hostSystem = NULL;
+ esxVI_DynamicProperty *dynamicProperty = NULL;
+ virInterfaceDefPtr def = NULL;
+ char *xmlstr = NULL;
+ char *ret = NULL;
+
+ if (esxVI_EnsureSession(priv->primary) < 0 ||
+ esxVI_String_AppendValueListToList(&propertyNameList,
+ "config.network.vnic\0"
+ "config.network.ipRouteConfig\0"
+ "config.network.vswitch\0"
+ "config.network.pnic\0"
+ "config.network.portgroup\0") < 0 ||
+ esxVI_LookupHostSystemProperties(priv->primary, propertyNameList,
+ &hostSystem) < 0) {
+ goto cleanup;
+ }
+
+ for (dynamicProperty = hostSystem->propSet; dynamicProperty != NULL;
+ dynamicProperty = dynamicProperty->_next) {
+ if (STREQ(dynamicProperty->name, "config.network.vnic")) {
+ if (esxVI_HostVirtualNic_CastListFromAnyType(dynamicProperty->val,
+ &virtualNicList)
+ < 0) {
+ goto cleanup;
+ }
+ } else if (STREQ(dynamicProperty->name, "config.network.ipRouteConfig")) {
+ if (esxVI_HostIpRouteConfig_CastFromAnyType(dynamicProperty->val,
+ &ipRouteConfig)) {
+ goto cleanup;
+ }
+ } else if (STREQ(dynamicProperty->name, "config.network.vswitch")) {
+ if (esxVI_HostVirtualSwitch_CastListFromAnyType
+ (dynamicProperty->val, &virtualSwitchList) < 0) {
+ goto cleanup;
+ }
+ } else if (STREQ(dynamicProperty->name, "config.network.pnic")) {
+ if (esxVI_PhysicalNic_CastListFromAnyType(dynamicProperty->val,
+ &physicalNicList)
+ < 0) {
+ goto cleanup;
+ }
+ } else if (STREQ(dynamicProperty->name, "config.network.portgroup")) {
+ if (esxVI_HostPortGroup_CastListFromAnyType(dynamicProperty->val,
+ &portGroupList)
+ < 0) {
+ goto cleanup;
+ }
+ } else {
+ VIR_WARN("Unexpected '%s' property", dynamicProperty->name);
+ }
+ }
+
+ if (!virtualNicList ||
+ !ipRouteConfig ||
+ !virtualSwitchList ||
+ !portGroupList) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to retrieve network parameters"));
+
+ goto cleanup;
+ }
+
+ for (virtualNic = virtualNicList;
+ virtualNic != NULL;
+ virtualNic = virtualNic->_next) {
+ if (STREQ(virtualNic->device, iface->name)) {
+ break;
+ }
+ }
+
+ if (virtualNic == NULL) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not find Interface"));
+ goto cleanup;
+ }
+
+ if (esxVI_LookupPhysicalNicFromPortGroup(virtualNic->portgroup,
+ portGroupList,
+ virtualSwitchList,
+ physicalNicList,
+ &matchingPhysicalNicList) < 0) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No Physical NIC found matching Virtual NIC's portgroup"));
+ goto cleanup;
+ }
+
+ /* create a xml descriptor and parse it using virInterfaceDefParseString */
+ xmlstr = esxGetNativeInterfaceXMLDesc(virtualNic,
+ ipRouteConfig,
+ matchingPhysicalNicList,
+ flags);
+ if (xmlstr == NULL) {
+ goto cleanup;
+ }
+
+ def = virInterfaceDefParseString(xmlstr);
+ if (!def) {
+ goto cleanup;
+ }
+
+ ret = virInterfaceDefFormat(def);
+ if (!ret) {
+ goto cleanup;
+ }
+
+ cleanup:
+ esxVI_HostVirtualNic_Free(&virtualNicList);
+ esxVI_PhysicalNic_Free(&physicalNicList);
+ esxVI_PhysicalNic_Free(&matchingPhysicalNicList);
+ esxVI_HostPortGroup_Free(&portGroupList);
+ esxVI_HostVirtualSwitch_Free(&virtualSwitchList);
+ esxVI_HostIpRouteConfig_Free(&ipRouteConfig);
+ esxVI_ObjectContent_Free(&hostSystem);
+ esxVI_String_Free(&propertyNameList);
+ virInterfaceDefFree(def);
+ VIR_FREE(xmlstr);
+
+ return ret;
+}
+
+
+
+static int
+esxInterfaceUndefine(virInterfacePtr iface)
+{
+ esxPrivate *priv = iface->conn->interfacePrivateData;
+
+ if (esxVI_RemoveVirtualNic(
+ priv->primary,
+ priv->primary->hostSystem->configManager->networkSystem,
+ iface->name) < 0) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Error deleting interface"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
+
+static int
+esxInterfaceCreate(virInterfacePtr iface, unsigned int flags)
+{
+ iface->conn->interfacePrivateData = NULL;
+
+ virCheckFlags(0, -1);
+
+ /* ESX interfaces are always active */
+ return 0;
+}
+
+
+static int
+esxInterfaceDestroy(virInterfacePtr iface, unsigned int flags)
+{
+ iface->conn->privateData = NULL;
+
+ virCheckFlags(0, -1);
+
+ /* ESX does not support deactivating interfaces */
+ return 1;
+}
+
static virInterfaceDriver esxInterfaceDriver = {
.name = "ESX",
- .open = esxInterfaceOpen, /* 0.7.6 */
- .close = esxInterfaceClose, /* 0.7.6 */
+ .open = esxInterfaceOpen, /* 0.7.6 */
+ .close = esxInterfaceClose, /* 0.7.6 */
+ .numOfInterfaces = esxNumOfInterfaces, /* 0.9.x */
+ .numOfDefinedInterfaces = esxNumOfDefinedInterfaces, /* 0.9.x */
+ .listInterfaces = esxListInterfaces, /* 0.9.x */
+ .listDefinedInterfaces = esxListDefinedInterfaces, /* 0.9.x */
+ .interfaceLookupByName = esxInterfaceLookupByName, /* 0.9.x */
+ .interfaceLookupByMACString = esxInterfaceLookupByMACString, /* 0.9.x */
+ .interfaceGetXMLDesc = esxInterfaceGetXMLDesc, /* 0.9.x */
+ .interfaceUndefine = esxInterfaceUndefine, /* 0.9.x */
+ .interfaceCreate = esxInterfaceCreate, /* 0.9.x */
+ .interfaceDestroy = esxInterfaceDestroy, /* 0.9.x */
};
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 5b5ab69..df9f8df 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -4414,4 +4414,134 @@ esxVI_LookupManagedObjectHelper(esxVI_Context *ctx,
+int
+esxVI_LookupVirtualNicList(esxVI_Context* ctx,
+ esxVI_HostVirtualNic** virtualNicList)
+{
+ int result = -1;
+ esxVI_String *propertyNameList = NULL;
+ esxVI_DynamicProperty *dynamicProperty = NULL;
+ esxVI_ObjectContent* hostSystem = NULL;
+
+ if (esxVI_String_AppendValueListToList(
+ &propertyNameList, "config.network.vnic\0") < 0 ||
+ esxVI_LookupHostSystemProperties(ctx, propertyNameList, &hostSystem) < 0) {
+ goto cleanup;
+ }
+
+ if (hostSystem == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not retrieve the HostSystem object"));
+
+ goto cleanup;
+ }
+
+ for (dynamicProperty = hostSystem->propSet;
+ dynamicProperty != NULL;
+ dynamicProperty = dynamicProperty->_next) {
+ if (STREQ(dynamicProperty->name, "config.network.vnic")) {
+ if (esxVI_HostVirtualNic_CastListFromAnyType(dynamicProperty->val,
+ virtualNicList) < 0) {
+ goto cleanup;
+ }
+ break;
+ } else {
+ VIR_WARN("Unexpected '%s' property", dynamicProperty->name);
+ }
+ }
+
+ result = 0;
+
+cleanup:
+ esxVI_String_Free(&propertyNameList);
+ esxVI_ObjectContent_Free(&hostSystem);
+
+ return result;
+}
+
+
+
+int
+esxVI_LookupPhysicalNicFromPortGroup(
+ const char *portgroup,
+ const esxVI_HostPortGroup *portGroupList,
+ const esxVI_HostVirtualSwitch *virtualSwitchList,
+ const esxVI_PhysicalNic *physicalNicList,
+ esxVI_PhysicalNic **ret_physicalNicList)
+{
+ int result = -1;
+ const esxVI_HostPortGroup *portGroup = NULL;
+ const esxVI_HostVirtualSwitch *virtualSwitch = NULL;
+ esxVI_PhysicalNic *matchingPhysicalNicList = NULL;
+ const esxVI_PhysicalNic *physicalNic = NULL;
+ esxVI_PhysicalNic *tempPhysicalNic = NULL;
+ const esxVI_String *pnicKey = NULL;
+
+ if (portgroup == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No Portgroup found!"));
+ goto cleanup;
+ }
+
+ /* Go through all the port groups to find the one that matches. */
+ for (portGroup = portGroupList;
+ portGroup != NULL;
+ portGroup = portGroup->_next) {
+ if (STREQ(portGroup->spec->name, portgroup)) {
+ break;
+ }
+ }
+
+ if (portGroup == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not find Host port group"));
+ goto cleanup;
+ }
+
+ /* Go through all the virtual switches to find the one that matches */
+ for (virtualSwitch = virtualSwitchList;
+ virtualSwitch != NULL;
+ virtualSwitch = virtualSwitch->_next) {
+ if (STREQ(portGroup->spec->vswitchName, virtualSwitch->name)) {
+ break;
+ }
+ }
+
+ if (virtualSwitch == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not find Virtual Switch"));
+ goto cleanup;
+ }
+
+ /* Go through all physical nics */
+ for (pnicKey = virtualSwitch->pnic;
+ pnicKey != NULL;
+ pnicKey = pnicKey->_next) {
+ /* O(n^2), but probably faster than a hash due to small N */
+ for (physicalNic = physicalNicList;
+ physicalNic != NULL;
+ physicalNic = physicalNic->_next) {
+
+ if (STREQ(pnicKey->value, physicalNic->key)) {
+ if (esxVI_PhysicalNic_DeepCopy(&tempPhysicalNic,
+ (esxVI_PhysicalNic *)physicalNic) < 0 ||
+ esxVI_PhysicalNic_AppendToList(&matchingPhysicalNicList,
+ tempPhysicalNic) < 0) {
+ goto cleanup;
+ }
+ tempPhysicalNic = NULL;
+ }
+ }
+ }
+
+ *ret_physicalNicList = matchingPhysicalNicList;
+ matchingPhysicalNicList = NULL; /* no cleanup needed */
+ tempPhysicalNic = NULL; /* no cleanup needed */
+ result = 0;
+ cleanup:
+ esxVI_PhysicalNic_Free(&matchingPhysicalNicList);
+ esxVI_PhysicalNic_Free(&tempPhysicalNic);
+ return result;
+}
+
#include "esx_vi.generated.c"
diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h
index 78d3986..11bc52e 100644
--- a/src/esx/esx_vi.h
+++ b/src/esx/esx_vi.h
@@ -487,6 +487,16 @@ int esxVI_ParseHostCpuIdInfo(esxVI_ParsedHostCpuIdInfo *parsedHostCpuIdInfo,
int esxVI_ProductVersionToDefaultVirtualHWVersion(esxVI_ProductVersion productVersion);
+int esxVI_LookupVirtualNicList(esxVI_Context* ctx,
+ esxVI_HostVirtualNic** virtualNicList);
+
+int esxVI_LookupPhysicalNicFromPortGroup(
+ const char *portgroup,
+ const esxVI_HostPortGroup *portGroupList,
+ const esxVI_HostVirtualSwitch *virtualSwitchList,
+ const esxVI_PhysicalNic *physicalNicList,
+ esxVI_PhysicalNic **ret_physicalNicList);
+
# include "esx_vi.generated.h"
#endif /* __ESX_VI_H__ */
diff --git a/src/esx/esx_vi_generator.input b/src/esx/esx_vi_generator.input
index 1a67a8c..b99fee6 100644
--- a/src/esx/esx_vi_generator.input
+++ b/src/esx/esx_vi_generator.input
@@ -57,6 +57,29 @@ enum AutoStartWaitHeartbeatSetting
systemDefault
end
+enum HostConfigChangeOperation
+ add
+ edit
+ remove
+end
+
+enum HostIpConfigIpV6AdressStatus
+ deprecated
+ duplicate
+ inaccessible
+ invalid
+ preferred
+ tentative
+ unknown
+end
+
+enum HostIpConfigV6AdressConfigType
+ dhcp
+ linklayer
+ manual
+ other
+ random
+end
enum ManagedEntityStatus
gray
@@ -89,6 +112,12 @@ enum PerfSummaryType
none
end
+enum PortGroupConnecteeType
+ host
+ systemManagement
+ unknown
+ virtualMachine
+end
enum PropertyChangeOp
add
@@ -197,6 +226,12 @@ object DeviceBackedVirtualDiskSpec extends VirtualDiskSpec
String device r
end
+object DistributedVirtualSwitchPortConnection
+ Int connectionCookie o
+ String portgroupKey o
+ String portKey o
+ String switchUuid r
+end
object DynamicProperty
String name r
@@ -316,6 +351,34 @@ object HostFileSystemVolume
Long capacity r
end
+object HostIpConfig
+ Boolean dhcp r
+ String ipAddress o
+ HostIpConfigIpV6AddressConfiguration ipV6Config o
+ String subnetMask o
+end
+
+object HostIpConfigIpV6Address
+ String dadState o
+ String ipAddress r
+ DateTime lifetime o
+ String operation o
+ String origin o
+ Int prefixLength r
+end
+
+object HostIpConfigIpV6AddressConfiguration
+ Boolean autoConfigurationEnabled o
+ Boolean dhcpV6Enabled o
+ HostIpConfigIpV6Address ipV6Address ol
+end
+
+object HostIpRouteConfig
+ String defaultGateway o
+ String gatewayDevice o
+ String ipV6DefaultGateway o
+ String ipV6GatewayDevice o
+end
object HostMountInfo
String path o
@@ -331,11 +394,134 @@ object HostNasVolume extends HostFileSystemVolume
end
+object HostNicTeamingPolicy
+ HostNicFailureCriteria failureCriteria o
+ HostNicOrderPolicy nicOrder o
+ Boolean notifySwitches o
+ String policy o
+ Boolean reversePolicy o
+ Boolean rollingOrder o
+end
+
+object HostNetOffloadCapabilities
+ Boolean csumOffload o
+ Boolean tcpSegmentation o
+ Boolean zeroCopyXmit o
+end
+
+object HostNetworkSecurityPolicy
+ Boolean allowPromiscuous o
+ Boolean forgedTransmits o
+ Boolean macChanges o
+end
+
+object HostNetworkPolicy
+ HostNicTeamingPolicy nicTeaming o
+ HostNetOffloadCapabilities offloadPolicy o
+ HostNetworkSecurityPolicy security o
+ HostNetworkTrafficShapingPolicy shapingPolicy o
+end
+
+object HostNetworkTrafficShapingPolicy
+ Long averageBandwidth o
+ Long burstLong o
+ Boolean enabled o
+ Long peakBandwidth o
+end
+
+object HostNicFailureCriteria
+ String checkSpeed o
+ Int speed o
+ Boolean checkDuplex o
+ Boolean fullDuplex o
+ Boolean checkErrorPercent o
+ Int percentage o
+ Boolean checkBeacon o
+end
+
+object HostNicOrderPolicy
+ String activeNic ol
+ String standbyNic ol
+end
+
+object HostPortGroup
+ String key r
+ HostPortGroupPort port ol
+ String vswitch r
+ HostNetworkPolicy computedPolicy r
+ HostPortGroupSpec spec r
+end
+
+object HostPortGroupPort
+ String key o
+ String mac ol
+ String type r
+end
+
+object HostPortGroupSpec
+ String name r
+ HostNetworkPolicy policy r
+ Int vlanId r
+ String vswitchName r
+end
+
object HostScsiDiskPartition
String diskName r
Int partition r
end
+object HostVirtualNic
+ String device r
+ String key r
+ String port o
+ String portgroup r
+ HostVirtualNicSpec spec r
+end
+
+object HostVirtualNicSpec
+ DistributedVirtualSwitchPortConnection distributedVirtualPort o
+ HostIpConfig ip o
+ String mac o
+ Int mtu o
+ String portgroup o
+ Boolean tsoEnabled o
+end
+
+
+object HostVirtualSwitch
+ String key r
+ Int mtu o
+ String name r
+ Int numPorts r
+ Int numPortsAvailable r
+ String pnic ol
+ String portgroup ol
+ HostVirtualSwitchSpec spec r
+end
+
+object HostVirtualSwitchBridge
+end
+
+object HostVirtualSwitchAutoBridge extends HostVirtualSwitchBridge
+ String excludedNicDevice ol
+end
+
+object HostVirtualSwitchBeaconBridge extends HostVirtualSwitchBridge
+ Int interval r
+end
+
+object HostVirtualSwitchBondBridge extends HostVirtualSwitchBridge
+ HostVirtualSwitchBeaconBridge beacon o
+ LinkDiscoveryProtocolConfig linkDiscoveryProtocolConfig o
+ String nicDevice rl
+end
+
+object HostVirtualSwitchSpec
+ HostVirtualSwitchBridge bridge o
+ Int mtu o
+ Int numPorts r
+ HostNetworkPolicy policy o
+end
object HostVmfsVolume extends HostFileSystemVolume
Int blockSizeMb r
@@ -355,6 +541,10 @@ end
object IsoImageFileQuery extends FileQuery
end
+object LinkDiscoveryProtocolConfig
+ String operation r
+ String protocol r
+end
object LocalDatastoreInfo extends DatastoreInfo
String path o
@@ -398,6 +588,10 @@ object OptionType
Boolean valueIsReadonly o
end
+object OptionValue
+ String key r
+ AnyType value r
+end
object PerfCounterInfo
Int key r
@@ -454,6 +648,27 @@ object PerfSampleInfo
Int interval r
end
+object PhysicalNic
+ String device r
+ String driver o
+ String key o
+ PhysicalNicInfo linkSpeed o
+ String mac r
+ String pci r
+ PhysicalNicSpec spec r
+ PhysicalNicInfo validLinkSpecification ol
+ Boolean wakeOnLanSupported r
+end
+
+object PhysicalNicInfo
+ Boolean duplex r
+ Int speedMb r
+end
+
+object PhysicalNicSpec
+ HostIpConfig ip o
+ PhysicalNicInfo linkSpeed o
+end
object PropertyChange
String name r
@@ -490,7 +705,6 @@ object ResourceAllocationInfo
Long overheadLimit o
end
-
object ResourcePoolResourceUsage
Long reservationUsed r
Long reservationUsedForVm r
@@ -954,6 +1168,10 @@ method RemoveSnapshot_Task returns ManagedObjectReference r
Boolean removeChildren r
end
+method RemoveVirtualNic
+ ManagedObjectReference _this r
+ String device r
+end
method RetrieveProperties returns ObjectContent ol
ManagedObjectReference _this:propertyCollector r
@@ -1002,6 +1220,16 @@ method UnregisterVM
ManagedObjectReference _this r
end
+method UpdateIpRouteConfig
+ ManagedObjectReference _this r
+ HostIpRouteConfig config r
+end
+
+method UpdateVirtualNic
+ ManagedObjectReference _this r
+ String device r
+ HostVirtualNicSpec nic r
+end
method WaitForUpdates returns UpdateSet r
ManagedObjectReference _this:propertyCollector r
diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py
index 8a128df..787a28c 100755
--- a/src/esx/esx_vi_generator.py
+++ b/src/esx/esx_vi_generator.py
@@ -371,8 +371,12 @@ class Property(Member):
% self.name
elif self.occurrence in [OCCURRENCE__REQUIRED_LIST,
OCCURRENCE__OPTIONAL_LIST]:
- return " ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_LIST(%s, %s)\n" \
- % (self.type, self.name)
+ if self.type == "String":
+ return " ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_STRING_LIST(%s, %s)\n" \
+ % (self.type, self.name)
+ else:
+ return " ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_LIST(%s, %s)\n" \
+ % (self.type, self.name)
elif self.type == "String":
return " ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_VALUE(String, %s)\n" \
% self.name
@@ -1505,7 +1509,10 @@ predefined_objects = ["AnyType",
additional_enum_features = { "ManagedEntityStatus" : Enum.FEATURE__ANY_TYPE,
"TaskInfoState" : Enum.FEATURE__ANY_TYPE,
- "VirtualMachinePowerState" : Enum.FEATURE__ANY_TYPE }
+ "VirtualMachinePowerState" : Enum.FEATURE__ANY_TYPE ,
+ "HostIpConfigIpV6AdressStatus" : Enum.FEATURE__ANY_TYPE,
+ "HostIpConfigV6AdressConfigType" : Enum.FEATURE__ANY_TYPE,
+ "PortGroupConnecteeType" : Enum.FEATURE__ANY_TYPE }
additional_object_features = { "AutoStartDefaults" : Object.FEATURE__ANY_TYPE,
"AutoStartPowerInfo" : Object.FEATURE__ANY_TYPE,
@@ -1519,8 +1526,31 @@ additional_object_features = { "AutoStartDefaults" : Object.FEATURE__AN
Object.FEATURE__ANY_TYPE,
"HostDatastoreBrowserSearchResults" : Object.FEATURE__LIST |
Object.FEATURE__ANY_TYPE,
+ "HostIpConfig" : Object.FEATURE__DEEP_COPY,
+ "HostIpRouteConfig" : Object.FEATURE__ANY_TYPE,
+ "HostIpConfigIpV6Address" : Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__DEEP_COPY,
+ "HostIpConfigIpV6AddressConfiguration" : Object.FEATURE__DEEP_COPY,
+ "HostPortGroup" : Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE,
+ "HostVirtualNic" : Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__LIST,
+ "HostVirtualSwitch" : Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__LIST,
+ "KeyValue" : Object.FEATURE__ANY_TYPE,
"ManagedObjectReference" : Object.FEATURE__ANY_TYPE,
+ "PhysicalNic" : Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__DEEP_COPY,
"ObjectContent" : Object.FEATURE__DEEP_COPY,
+ "OptionValue" : Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__LIST,
+ "PhysicalNic" : Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__DEEP_COPY,
+ "PhysicalNicSpec" : Object.FEATURE__DEEP_COPY,
+ "PhysicalNicLinkInfo" : Object.FEATURE__LIST,
"ResourcePoolResourceUsage" : Object.FEATURE__ANY_TYPE,
"ServiceContent" : Object.FEATURE__DESERIALIZE,
"SharesInfo" : Object.FEATURE__ANY_TYPE,
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index bcc310f..f23af8d 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -475,7 +475,23 @@
continue; \
}
-
+#define ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_STRING_LIST(_type, _name) \
+ if (xmlStrEqual(childNode->name, BAD_CAST #_name)) { \
+ char *value = NULL; \
+ \
+ if (esxVI_String_DeserializeValue(childNode, &value) < 0 || \
+ value == NULL) { \
+ goto failure; \
+ } \
+ \
+ if (esxVI_##_type##_AppendValueToList(&(*ptrptr)->_name, \
+ value) < 0) { \
+ VIR_FREE(value); \
+ goto failure; \
+ } \
+ \
+ continue; \
+ }
/*
* A required property must be != 0 (NULL for pointers, "undefined" == 0 for
--
1.7.9.5
12 years, 5 months
[libvirt] [PATCH] [libvirt-java] Fix typo in Domain.java.
by Claudio Bley
Hi.
I sent a few mails on friday, 6th July, via gmane.org but they haven't
made it to the list yet. As I'm a subscriber now, I'm resending them
directly. Sorry for any duplicates in advance.
Just a small typo fix:
---
diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index fe9f3b0..71c6397 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -678,7 +678,7 @@ public class Domain {
* @return 0 in case of success, and -1 in case of error
* @throws LibvirtException
*/
- public int managedSaveRemote() throws LibvirtException {
+ public int managedSaveRemove() throws LibvirtException {
int returnValue = libvirt.virDomainManagedSaveRemove(VDP, 0);
processError();
return returnValue;
---
Best regards,
Claudio.
--
AV-Test GmbH, Henricistraße 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>
Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern
12 years, 5 months
[libvirt] Release of libvirt-java 0.4.8
by Daniel Veillard
I have tagged the git tree and pushed the tarball and rpms at:
ftp://libvirt.org/libvirt/java/
This release includes the few improvement and fixes made to the java
bindings since the last release last year:
Bug fixes:
Return a byte[] array with secretGetValue (Wido den Hollander)
Fix for the jna parameter passing issue (Daniel Veillard)
Improvements:
Add flags to StoragePoolRefresh (Wido den Hollander)
Allow byte[] arrays to be set as a secretValue (Wido den Hollander)
Added domain flags up to libvirt-0.9.12 (Stefan Majer)
Added error constants up to libvirt-0.9.12 (Stefan Majer)
Add an automated build control script (Daniel P. Berrange)
Documentation:
Fix most of the javadoc reported problems (Daniel Veillard)
Cleanups:
Spaces cleanup and reformating of a few comments (Daniel Veillard)
Cleanup trailing white space issues (Daniel Veillard)
thanks for the help and contributions :-) !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
12 years, 5 months
[libvirt] [PATCH 0/3] esx: Storage volume up- and download
by Matthias Bolte
I started the download part and the stream driver quite a while ago
but stopped and put it aside as I realized that the storage volume
API up- and download functions assume one file per volume. This is a
problem with ESX as a VMDK can consist of two files. To solve this
now I added two new flags: METADATA and CONTENT. With this flags the
user can specify which part of such a volume to transfer. See patch
3/3 for more details.
Matthias
12 years, 5 months