[libvirt] [PATCH] libvirt-guests: Remove LISTFILE if it's empty when stopping service
by Osier Yang
$LISTFILE is created even no domain is running, and the empty
$LISTFILE could cause improper service status.
stoped ,with saved guests
Which is not right, as there is no domain was saved.
---
tools/libvirt-guests.init.sh | 42 +++++++++++++++++++++++-------------------
1 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/tools/libvirt-guests.init.sh b/tools/libvirt-guests.init.sh
index aafb4d4..c0d8a7e 100644
--- a/tools/libvirt-guests.init.sh
+++ b/tools/libvirt-guests.init.sh
@@ -461,26 +461,30 @@ stop() {
done
set +f
- while read uri list; do
- if "$suspending"; then
- eval_gettext "Suspending guests on \$uri URI..."; echo
- else
- eval_gettext "Shutting down guests on \$uri URI..."; echo
- fi
+ if [ -s $LISTFILE ]; then
+ while read uri list; do
+ if "$suspending"; then
+ eval_gettext "Suspending guests on \$uri URI..."; echo
+ else
+ eval_gettext "Shutting down guests on \$uri URI..."; echo
+ fi
- if [ "$PARALLEL_SHUTDOWN" -gt 1 ] &&
- ! "$suspending"; then
- shutdown_guests_parallel "$uri" "$list"
- else
- for guest in $list; do
- if "$suspending"; then
- suspend_guest "$uri" "$guest"
- else
- shutdown_guest "$uri" "$guest"
- fi
- done
- fi
- done <"$LISTFILE"
+ if [ "$PARALLEL_SHUTDOWN" -gt 1 ] &&
+ ! "$suspending"; then
+ shutdown_guests_parallel "$uri" "$list"
+ else
+ for guest in $list; do
+ if "$suspending"; then
+ suspend_guest "$uri" "$guest"
+ else
+ shutdown_guest "$uri" "$guest"
+ fi
+ done
+ fi
+ done <"$LISTFILE"
+ else
+ rm -f $LISTFILE
+ fi
rm -f "$VAR_SUBSYS_LIBVIRT_GUESTS"
}
--
1.7.7.3
12 years, 6 months
[libvirt] [PATCHv2 0/4] improve node info collection
by Eric Blake
This builds on Osier's patch v1 here:
https://www.redhat.com/archives/libvir-list/2012-May/msg00663.html
to add some tests as recommended by Dan Berrange.
Patches 1-3 are new, and patch 4 is Osier's patch plus a change
to the testsuite to show what really changed. According to sysfs
of the AMD machine that he and I were playing with, there were 8
NUMA nodes of 6 CPUs each in a staggered grouping; for example,
/sys/devices/system/node/node0/cpulist shows 0,4,8,12,16,20.
I'd have to think a lot more about whether we are representing
things correctly with the hack of going by cpuinfo's claim of
12 cores (2 cores per socket, with 6 sockets). For example,
is node/has_cpu any better than node/possible, or any better
than a readdir() over node/ looking for all node[0-9]*
subdirectories? At any rate, having tests will help us feel
better about any v3 tweaks to this series.
Please feel free to contribute more tests for machines with
different NUMA configurations that you have access to.
Eric Blake (3):
nodeinfo: drop static variable
nodeinfo: avoid probing host filesystem during test
nodeinfo: add some more tests
Osier Yang (1):
nodeinfo: Get the correct CPU number on AMD Magny Cours platform
src/nodeinfo.c | 181 ++-
.../linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt | 1 +
.../linux-nodeinfo-sysfs-test-2-x86.cpuinfo | 52 +
.../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-2/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-2/node/node0/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-2/node/possible | 1 +
.../linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt | 1 +
.../linux-nodeinfo-sysfs-test-3-x86.cpuinfo | 1248 ++++++++++++++++++++
.../cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../cpu/cpu0/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/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-3/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-3/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-3/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-3/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-3/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-3/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-3/cpu/cpu16/online | 1 +
.../cpu/cpu16/topology/core_id | 1 +
.../cpu/cpu16/topology/physical_package_id | 1 +
.../cpu/cpu16/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu17/online | 1 +
.../cpu/cpu17/topology/core_id | 1 +
.../cpu/cpu17/topology/physical_package_id | 1 +
.../cpu/cpu17/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu18/online | 1 +
.../cpu/cpu18/topology/core_id | 1 +
.../cpu/cpu18/topology/physical_package_id | 1 +
.../cpu/cpu18/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu19/online | 1 +
.../cpu/cpu19/topology/core_id | 1 +
.../cpu/cpu19/topology/physical_package_id | 1 +
.../cpu/cpu19/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/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-3/cpu/cpu20/online | 1 +
.../cpu/cpu20/topology/core_id | 1 +
.../cpu/cpu20/topology/physical_package_id | 1 +
.../cpu/cpu20/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu21/online | 1 +
.../cpu/cpu21/topology/core_id | 1 +
.../cpu/cpu21/topology/physical_package_id | 1 +
.../cpu/cpu21/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu22/online | 1 +
.../cpu/cpu22/topology/core_id | 1 +
.../cpu/cpu22/topology/physical_package_id | 1 +
.../cpu/cpu22/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu23/online | 1 +
.../cpu/cpu23/topology/core_id | 1 +
.../cpu/cpu23/topology/physical_package_id | 1 +
.../cpu/cpu23/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu24/online | 1 +
.../cpu/cpu24/topology/core_id | 1 +
.../cpu/cpu24/topology/physical_package_id | 1 +
.../cpu/cpu24/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu25/online | 1 +
.../cpu/cpu25/topology/core_id | 1 +
.../cpu/cpu25/topology/physical_package_id | 1 +
.../cpu/cpu25/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu26/online | 1 +
.../cpu/cpu26/topology/core_id | 1 +
.../cpu/cpu26/topology/physical_package_id | 1 +
.../cpu/cpu26/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu27/online | 1 +
.../cpu/cpu27/topology/core_id | 1 +
.../cpu/cpu27/topology/physical_package_id | 1 +
.../cpu/cpu27/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu28/online | 1 +
.../cpu/cpu28/topology/core_id | 1 +
.../cpu/cpu28/topology/physical_package_id | 1 +
.../cpu/cpu28/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu29/online | 1 +
.../cpu/cpu29/topology/core_id | 1 +
.../cpu/cpu29/topology/physical_package_id | 1 +
.../cpu/cpu29/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/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-3/cpu/cpu30/online | 1 +
.../cpu/cpu30/topology/core_id | 1 +
.../cpu/cpu30/topology/physical_package_id | 1 +
.../cpu/cpu30/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu31/online | 1 +
.../cpu/cpu31/topology/core_id | 1 +
.../cpu/cpu31/topology/physical_package_id | 1 +
.../cpu/cpu31/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu32/online | 1 +
.../cpu/cpu32/topology/core_id | 1 +
.../cpu/cpu32/topology/physical_package_id | 1 +
.../cpu/cpu32/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu33/online | 1 +
.../cpu/cpu33/topology/core_id | 1 +
.../cpu/cpu33/topology/physical_package_id | 1 +
.../cpu/cpu33/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu34/online | 1 +
.../cpu/cpu34/topology/core_id | 1 +
.../cpu/cpu34/topology/physical_package_id | 1 +
.../cpu/cpu34/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu35/online | 1 +
.../cpu/cpu35/topology/core_id | 1 +
.../cpu/cpu35/topology/physical_package_id | 1 +
.../cpu/cpu35/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu36/online | 1 +
.../cpu/cpu36/topology/core_id | 1 +
.../cpu/cpu36/topology/physical_package_id | 1 +
.../cpu/cpu36/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu37/online | 1 +
.../cpu/cpu37/topology/core_id | 1 +
.../cpu/cpu37/topology/physical_package_id | 1 +
.../cpu/cpu37/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu38/online | 1 +
.../cpu/cpu38/topology/core_id | 1 +
.../cpu/cpu38/topology/physical_package_id | 1 +
.../cpu/cpu38/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu39/online | 1 +
.../cpu/cpu39/topology/core_id | 1 +
.../cpu/cpu39/topology/physical_package_id | 1 +
.../cpu/cpu39/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/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-3/cpu/cpu40/online | 1 +
.../cpu/cpu40/topology/core_id | 1 +
.../cpu/cpu40/topology/physical_package_id | 1 +
.../cpu/cpu40/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu41/online | 1 +
.../cpu/cpu41/topology/core_id | 1 +
.../cpu/cpu41/topology/physical_package_id | 1 +
.../cpu/cpu41/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu42/online | 1 +
.../cpu/cpu42/topology/core_id | 1 +
.../cpu/cpu42/topology/physical_package_id | 1 +
.../cpu/cpu42/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu43/online | 1 +
.../cpu/cpu43/topology/core_id | 1 +
.../cpu/cpu43/topology/physical_package_id | 1 +
.../cpu/cpu43/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu44/online | 1 +
.../cpu/cpu44/topology/core_id | 1 +
.../cpu/cpu44/topology/physical_package_id | 1 +
.../cpu/cpu44/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu45/online | 1 +
.../cpu/cpu45/topology/core_id | 1 +
.../cpu/cpu45/topology/physical_package_id | 1 +
.../cpu/cpu45/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu46/online | 1 +
.../cpu/cpu46/topology/core_id | 1 +
.../cpu/cpu46/topology/physical_package_id | 1 +
.../cpu/cpu46/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu47/online | 1 +
.../cpu/cpu47/topology/core_id | 1 +
.../cpu/cpu47/topology/physical_package_id | 1 +
.../cpu/cpu47/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/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-3/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-3/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-3/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-3/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-3/node/node0/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node1/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node2/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node3/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node4/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node5/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node6/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node7/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/possible | 1 +
tests/nodeinfotest.c | 50 +-
221 files changed, 1906 insertions(+), 94 deletions(-)
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-x86.cpuinfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/thread_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/thread_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/possible
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-x86.cpuinfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/possible
--
1.7.7.6
12 years, 6 months
[libvirt] [PATCH 1/2] qemu: Set memory policy using cgroup if placement is auto
by Osier Yang
Like for 'static' placement, when the memory policy mode is
'strict', set the memory policy by writing the advisory nodeset
returned from numad to cgroup file cpuset.mems,
---
src/qemu/qemu_cgroup.c | 15 +++++++++--
src/qemu/qemu_cgroup.h | 3 +-
src/qemu/qemu_process.c | 62 +++++++++++++++++++++++++----------------------
3 files changed, 47 insertions(+), 33 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index a07b6cd..f8f375f 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -194,7 +194,8 @@ int qemuSetupHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
}
int qemuSetupCgroup(struct qemud_driver *driver,
- virDomainObjPtr vm)
+ virDomainObjPtr vm,
+ char *nodemask)
{
virCgroupPtr cgroup = NULL;
int rc;
@@ -391,10 +392,18 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
}
- if (vm->def->numatune.memory.nodemask &&
+ if ((vm->def->numatune.memory.nodemask ||
+ (vm->def->numatune.memory.placement_mode ==
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)) &&
vm->def->numatune.memory.mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT &&
qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) {
- char *mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask, VIR_DOMAIN_CPUMASK_LEN);
+ char *mask = NULL;
+ if (vm->def->numatune.memory.placement_mode ==
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)
+ mask = virDomainCpuSetFormat(nodemask, VIR_DOMAIN_CPUMASK_LEN);
+ else
+ mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask,
+ VIR_DOMAIN_CPUMASK_LEN);
if (!mask) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to convert memory nodemask"));
diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h
index 17164d9..c1023b3 100644
--- a/src/qemu/qemu_cgroup.h
+++ b/src/qemu/qemu_cgroup.h
@@ -48,7 +48,8 @@ int qemuSetupHostUsbDeviceCgroup(usbDevice *dev,
const char *path,
void *opaque);
int qemuSetupCgroup(struct qemud_driver *driver,
- virDomainObjPtr vm);
+ virDomainObjPtr vm,
+ char *nodemask);
int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
unsigned long long period,
long long quota);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d226067..19bb22a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2544,6 +2544,7 @@ struct qemuProcessHookData {
virConnectPtr conn;
virDomainObjPtr vm;
struct qemud_driver *driver;
+ char *nodemask;
};
static int qemuProcessHook(void *data)
@@ -2551,8 +2552,6 @@ static int qemuProcessHook(void *data)
struct qemuProcessHookData *h = data;
int ret = -1;
int fd;
- char *nodeset = NULL;
- char *nodemask = NULL;
/* Some later calls want pid present */
h->vm->pid = getpid();
@@ -2582,37 +2581,16 @@ static int qemuProcessHook(void *data)
/* This must take place before exec(), so that all QEMU
* memory allocation is on the correct NUMA node
*/
- VIR_DEBUG("Moving procss to cgroup");
+ VIR_DEBUG("Moving process to cgroup");
if (qemuAddToCgroup(h->driver, h->vm->def) < 0)
goto cleanup;
- if ((h->vm->def->placement_mode ==
- VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) ||
- (h->vm->def->numatune.memory.placement_mode ==
- VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)) {
- nodeset = qemuGetNumadAdvice(h->vm->def);
- if (!nodeset)
- goto cleanup;
-
- VIR_DEBUG("Nodeset returned from numad: %s", nodeset);
-
- if (VIR_ALLOC_N(nodemask, VIR_DOMAIN_CPUMASK_LEN) < 0) {
- virReportOOMError();
- goto cleanup;
- }
-
- if (virDomainCpuSetParse(nodeset, 0, nodemask,
- VIR_DOMAIN_CPUMASK_LEN) < 0)
- goto cleanup;
- }
-
/* This must be done after cgroup placement to avoid resetting CPU
* affinity */
- VIR_DEBUG("Setup CPU affinity");
- if (qemuProcessInitCpuAffinity(h->driver, h->vm, nodemask) < 0)
+ if (qemuProcessInitCpuAffinity(h->driver, h->vm, h->nodemask) < 0)
goto cleanup;
- if (qemuProcessInitNumaMemoryPolicy(h->vm, nodemask) < 0)
+ if (qemuProcessInitNumaMemoryPolicy(h->vm, h->nodemask) < 0)
goto cleanup;
VIR_DEBUG("Setting up security labelling");
@@ -2623,8 +2601,6 @@ static int qemuProcessHook(void *data)
cleanup:
VIR_DEBUG("Hook complete ret=%d", ret);
- VIR_FREE(nodeset);
- VIR_FREE(nodemask);
return ret;
}
@@ -3300,6 +3276,8 @@ int qemuProcessStart(virConnectPtr conn,
struct qemuProcessHookData hookData;
unsigned long cur_balloon;
int i;
+ char *nodeset = NULL;
+ char *nodemask = NULL;
/* Okay, these are just internal flags,
* but doesn't hurt to check */
@@ -3455,8 +3433,32 @@ int qemuProcessStart(virConnectPtr conn,
flags & VIR_QEMU_PROCESS_START_COLD) < 0)
goto cleanup;
+ /* Get the advisory nodeset from numad if 'placement' of
+ * either <vcpu> or <numatune> is 'auto'.
+ */
+ if ((vm->def->placement_mode ==
+ VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) ||
+ (vm->def->numatune.memory.placement_mode ==
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)) {
+ nodeset = qemuGetNumadAdvice(vm->def);
+ if (!nodeset)
+ goto cleanup;
+
+ VIR_DEBUG("Nodeset returned from numad: %s", nodeset);
+
+ if (VIR_ALLOC_N(nodemask, VIR_DOMAIN_CPUMASK_LEN) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ if (virDomainCpuSetParse(nodeset, 0, nodemask,
+ VIR_DOMAIN_CPUMASK_LEN) < 0)
+ goto cleanup;
+ }
+ hookData.nodemask = nodemask;
+
VIR_DEBUG("Setting up domain cgroup (if required)");
- if (qemuSetupCgroup(driver, vm) < 0)
+ if (qemuSetupCgroup(driver, vm, nodemask) < 0)
goto cleanup;
if (VIR_ALLOC(priv->monConfig) < 0) {
@@ -3761,6 +3763,8 @@ cleanup:
/* We jump here if we failed to start the VM for any reason, or
* if we failed to initialize the now running VM. kill it off and
* pretend we never started it */
+ VIR_FREE(nodeset);
+ VIR_FREE(nodemask);
virCommandFree(cmd);
VIR_FORCE_CLOSE(logfile);
qemuProcessStop(driver, vm, 0, VIR_DOMAIN_SHUTOFF_FAILED);
--
1.7.7.3
12 years, 6 months
[libvirt] [PATCH] qemu: Use the CPU index in capabilities to map NUMA node to cpu list.
by Osier Yang
On some of the NUMA platforms, the CPU index in each NUMA node
grows sequentially. While on other platforms, it can be inconsecutive,
E.g.
% numactl --hardware
available: 4 nodes (0-3)
node 0 cpus: 0 4 8 12 16 20 24 28
node 0 size: 131058 MB
node 0 free: 86531 MB
node 1 cpus: 1 5 9 13 17 21 25 29
node 1 size: 131072 MB
node 1 free: 127070 MB
node 2 cpus: 2 6 10 14 18 22 26 30
node 2 size: 131072 MB
node 2 free: 127758 MB
node 3 cpus: 3 7 11 15 19 23 27 31
node 3 size: 131072 MB
node 3 free: 127226 MB
node distances:
node 0 1 2 3
0: 10 20 20 20
1: 20 10 20 20
2: 20 20 10 20
3: 20 20 20 10
This patch is to fix the problem by using the CPU index in
caps->host.numaCell[i]->cpus[i] to set the bitmask instead of
assuming the CPU index of the NUMA nodes are always sequential.
---
src/qemu/qemu_process.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 19bb22a..58ba5bf 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1825,20 +1825,13 @@ qemuProcessInitCpuAffinity(struct qemud_driver *driver,
if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
VIR_DEBUG("Set CPU affinity with advisory nodeset from numad");
/* numad returns the NUMA node list, convert it to cpumap */
- int prev_total_ncpus = 0;
for (i = 0; i < driver->caps->host.nnumaCell; i++) {
int j;
int cur_ncpus = driver->caps->host.numaCell[i]->ncpus;
if (nodemask[i]) {
- for (j = prev_total_ncpus;
- j < cur_ncpus + prev_total_ncpus &&
- j < maxcpu &&
- j < VIR_DOMAIN_CPUMASK_LEN;
- j++) {
- VIR_USE_CPU(cpumap, j);
- }
+ for (j = 0; j < cur_ncpus; j++)
+ VIR_USE_CPU(cpumap, driver->caps->host.numaCell[i]->cpus[j]);
}
- prev_total_ncpus += cur_ncpus;
}
} else {
VIR_DEBUG("Set CPU affinity with specified cpuset");
--
1.7.7.3
12 years, 6 months
[libvirt] [PATCH V3] nwfilter: Add support for ipset
by Stefan Berger
This patch adds support for the recent ipset iptables extension
to libvirt's nwfilter subsystem. Ipset allows to maintain 'sets'
of IP addresses, ports and other packet parameters and allows for
faster lookup (in the order of O(1) vs. O(n)) and rule evaluation
to achieve higher throughput than what can be achieved with
individual iptables rules.
On the command line iptables supports ipset using
iptables ... -m set --match-set <ipset name> <flags> -j ...
where 'ipset name' is the name of a previously created ipset and
flags is a comma-separated list of up to 6 flags. Flags use 'src' and 'dst'
for selecting IP addresses, ports etc. from the source or
destination part of a packet. So a concrete example may look like this:
iptables -A INPUT -m set --match-set test src,src -j ACCEPT
Since ipset management is quite complex, the idea was to leave ipset
management outside of libvirt but still allow users to reference an ipset.
The user would have to make sure the ipset is available once the VM is
started so that the iptables rule(s) referencing the ipset can be created.
Using XML to describe an ipset in an nwfilter rule would then look as
follows:
<rule action='accept' direction='in'>
<all ipset='test' ipsetflags='src,src'/>
</rule>
The two parameters on the command line are also the two distinct XML attributes
'ipset' and 'ipsetflags'.
FYI: Here is the man page for ipset:
https://ipset.netfilter.org/ipset.man.html
Regards,
Stefan
---
v3:
- use DATATYPE_IPSETNAME for the name of the ipset
- adapted documentation for 0.9.12
v2:
- split ipset description into ipset and ipsetflags attribute
- improved on documentation
---
docs/formatnwfilter.html.in | 64 ++++++++++++++
docs/schemas/nwfilter.rng | 23 +++++
src/conf/nwfilter_conf.c | 136 +++++++++++++++++++++++++++++-
src/conf/nwfilter_conf.h | 13 ++
src/nwfilter/nwfilter_ebiptables_driver.c | 75 +++++++++++++++-
tests/nwfilterxml2xmlin/ipset-test.xml | 24 +++++
tests/nwfilterxml2xmlout/ipset-test.xml | 24 +++++
tests/nwfilterxml2xmltest.c | 2
8 files changed, 356 insertions(+), 5 deletions(-)
Index: libvirt-acl/src/conf/nwfilter_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.c
+++ libvirt-acl/src/conf/nwfilter_conf.c
@@ -183,6 +183,8 @@ static const char dstportstart_str[] = "
static const char dstportend_str[] = "dstportend";
static const char dscp_str[] = "dscp";
static const char state_str[] = "state";
+static const char ipset_str[] = "ipset";
+static const char ipsetflags_str[] = "ipsetflags";
#define SRCMACADDR srcmacaddr_str
#define SRCMACMASK srcmacmask_str
@@ -206,6 +208,8 @@ static const char state_str[] = "
#define DSTPORTEND dstportend_str
#define DSCP dscp_str
#define STATE state_str
+#define IPSET ipset_str
+#define IPSETFLAGS ipsetflags_str
/**
@@ -980,6 +984,97 @@ tcpFlagsFormatter(virBufferPtr buf,
return true;
}
+static bool
+ipsetValidator(enum attrDatatype datatype ATTRIBUTE_UNUSED, union data *val,
+ virNWFilterRuleDefPtr nwf ATTRIBUTE_UNUSED,
+ nwItemDesc *item)
+{
+ const char *errmsg = NULL;
+
+ if (virStrcpy(item->u.ipset.setname, val->c,
+ sizeof(item->u.ipset.setname)) == NULL) {
+ errmsg = _("ipset name is too long");
+ goto arg_err_exit;
+ }
+
+ if (item->u.ipset.setname[strspn(item->u.ipset.setname,
+ VALID_IPSETNAME)] != 0) {
+ errmsg = _("ipset name contains invalid characters");
+ goto arg_err_exit;
+ }
+
+ return true;
+
+arg_err_exit:
+ virNWFilterReportError(VIR_ERR_INVALID_ARG,
+ "%s", errmsg);
+ return false;
+}
+
+static bool
+ipsetFormatter(virBufferPtr buf,
+ virNWFilterRuleDefPtr nwf ATTRIBUTE_UNUSED,
+ nwItemDesc *item)
+{
+ virBufferAdd(buf, item->u.ipset.setname, -1);
+
+ return true;
+}
+
+static bool
+ipsetFlagsValidator(enum attrDatatype datatype ATTRIBUTE_UNUSED, union data *val,
+ virNWFilterRuleDefPtr nwf ATTRIBUTE_UNUSED, nwItemDesc *item)
+{
+ const char *errmsg = NULL;
+ size_t idx = 0;
+
+ item->u.ipset.numFlags = 0;
+ item->u.ipset.flags = 0;
+
+ errmsg = _("malformed ipset flags");
+
+ while (item->u.ipset.numFlags < 6) {
+ if (STRCASEEQLEN(&val->c[idx], "src", 3)) {
+ item->u.ipset.flags |= (1 << item->u.ipset.numFlags);
+ } else if (!STRCASEEQLEN(&val->c[idx], "dst", 3)) {
+ goto arg_err_exit;
+ }
+ item->u.ipset.numFlags++;
+ idx += 3;
+ if (val->c[idx] != ',')
+ break;
+ idx++;
+ }
+
+ if (val->c[idx] != '\0')
+ goto arg_err_exit;
+
+ return true;
+
+arg_err_exit:
+ virNWFilterReportError(VIR_ERR_INVALID_ARG,
+ "%s", errmsg);
+ return false;
+}
+
+static bool
+ipsetFlagsFormatter(virBufferPtr buf,
+ virNWFilterRuleDefPtr nwf ATTRIBUTE_UNUSED,
+ nwItemDesc *item)
+{
+ uint8_t ctr;
+
+ for (ctr = 0; ctr < item->u.ipset.numFlags; ctr++) {
+ if (ctr != 0)
+ virBufferAddLit(buf, ",");
+ if ((item->u.ipset.flags & (1 << ctr)))
+ virBufferAddLit(buf, "src");
+ else
+ virBufferAddLit(buf, "dst");
+ }
+
+ return true;
+}
#define COMMON_MAC_PROPS(STRUCT) \
{\
@@ -1411,6 +1506,20 @@ static const virXMLAttr2Struct ipv6Attri
.dataIdx = offsetof(virNWFilterRuleDef, p.STRUCT.ipHdr.dataState),\
.validator = stateValidator,\
.formatter = stateFormatter,\
+ },\
+ {\
+ .name = IPSET,\
+ .datatype = DATATYPE_IPSETNAME,\
+ .dataIdx = offsetof(virNWFilterRuleDef, p.STRUCT.ipHdr.dataIPSet),\
+ .validator = ipsetValidator,\
+ .formatter = ipsetFormatter,\
+ },\
+ {\
+ .name = IPSETFLAGS,\
+ .datatype = DATATYPE_IPSETFLAGS,\
+ .dataIdx = offsetof(virNWFilterRuleDef, p.STRUCT.ipHdr.dataIPSetFlags),\
+ .validator = ipsetFlagsValidator,\
+ .formatter = ipsetFlagsFormatter,\
}
#define COMMON_PORT_PROPS(STRUCT) \
@@ -1853,6 +1962,8 @@ virNWFilterRuleDetailsParse(xmlNodePtr n
break;
case DATATYPE_STRING:
+ case DATATYPE_IPSETFLAGS:
+ case DATATYPE_IPSETNAME:
if (!validator) {
/* not supported */
rc = -1;
@@ -1964,6 +2075,19 @@ err_exit:
goto cleanup;
}
+static void
+virNWFilterRuleDefFixupIPSet(ipHdrDataDefPtr ipHdr)
+{
+ if (HAS_ENTRY_ITEM(&ipHdr->dataIPSet) &&
+ !HAS_ENTRY_ITEM(&ipHdr->dataIPSetFlags)) {
+ ipHdr->dataIPSetFlags.flags = NWFILTER_ENTRY_ITEM_FLAG_EXISTS;
+ ipHdr->dataIPSetFlags.u.ipset.numFlags = 1;
+ ipHdr->dataIPSetFlags.u.ipset.flags = 1;
+ } else {
+ ipHdr->dataIPSet.flags = 0;
+ ipHdr->dataIPSetFlags.flags = 0;
+ }
+}
static void
virNWFilterRuleDefFixup(virNWFilterRuleDefPtr rule)
@@ -2017,6 +2141,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.ipHdrFilter.ipHdr.dataSrcIPAddr);
COPY_NEG_SIGN(rule->p.ipHdrFilter.ipHdr.dataDstIPMask,
rule->p.ipHdrFilter.ipHdr.dataDstIPAddr);
+ virNWFilterRuleDefFixupIPSet(&rule->p.ipHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_IPV6:
@@ -2024,6 +2149,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.ipv6HdrFilter.ipHdr.dataSrcIPAddr);
COPY_NEG_SIGN(rule->p.ipv6HdrFilter.ipHdr.dataDstIPMask,
rule->p.ipv6HdrFilter.ipHdr.dataDstIPAddr);
+ virNWFilterRuleDefFixupIPSet(&rule->p.ipv6HdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_ARP:
@@ -2047,6 +2173,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.tcpHdrFilter.portData.dataSrcPortStart);
COPY_NEG_SIGN(rule->p.tcpHdrFilter.portData.dataDstPortEnd,
rule->p.tcpHdrFilter.portData.dataSrcPortStart);
+ virNWFilterRuleDefFixupIPSet(&rule->p.tcpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_UDP:
@@ -2065,6 +2192,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.udpHdrFilter.portData.dataSrcPortStart);
COPY_NEG_SIGN(rule->p.udpHdrFilter.portData.dataDstPortEnd,
rule->p.udpHdrFilter.portData.dataSrcPortStart);
+ virNWFilterRuleDefFixupIPSet(&rule->p.udpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_UDPLITE:
@@ -2077,6 +2205,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.udpliteHdrFilter.ipHdr.dataSrcIPFrom);
COPY_NEG_SIGN(rule->p.udpliteHdrFilter.ipHdr.dataDstIPTo,
rule->p.udpliteHdrFilter.ipHdr.dataDstIPFrom);
+ virNWFilterRuleDefFixupIPSet(&rule->p.udpliteHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_ESP:
@@ -2089,6 +2218,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.espHdrFilter.ipHdr.dataSrcIPFrom);
COPY_NEG_SIGN(rule->p.espHdrFilter.ipHdr.dataDstIPTo,
rule->p.espHdrFilter.ipHdr.dataDstIPFrom);
+ virNWFilterRuleDefFixupIPSet(&rule->p.espHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_AH:
@@ -2101,6 +2231,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.ahHdrFilter.ipHdr.dataSrcIPFrom);
COPY_NEG_SIGN(rule->p.ahHdrFilter.ipHdr.dataDstIPTo,
rule->p.ahHdrFilter.ipHdr.dataDstIPFrom);
+ virNWFilterRuleDefFixupIPSet(&rule->p.ahHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_SCTP:
@@ -2119,6 +2250,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.sctpHdrFilter.portData.dataSrcPortStart);
COPY_NEG_SIGN(rule->p.sctpHdrFilter.portData.dataDstPortEnd,
rule->p.sctpHdrFilter.portData.dataSrcPortStart);
+ virNWFilterRuleDefFixupIPSet(&rule->p.sctpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_ICMP:
@@ -2133,6 +2265,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.icmpHdrFilter.ipHdr.dataDstIPFrom);
COPY_NEG_SIGN(rule->p.icmpHdrFilter.dataICMPCode,
rule->p.icmpHdrFilter.dataICMPType);
+ virNWFilterRuleDefFixupIPSet(&rule->p.icmpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_ALL:
@@ -2156,6 +2289,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleD
rule->p.igmpHdrFilter.ipHdr.dataSrcIPFrom);
COPY_NEG_SIGN(rule->p.igmpHdrFilter.ipHdr.dataDstIPTo,
rule->p.igmpHdrFilter.ipHdr.dataDstIPFrom);
+ virNWFilterRuleDefFixupIPSet(&rule->p.igmpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_LAST:
@@ -3120,7 +3254,7 @@ virNWFilterRuleDefDetailsFormat(virBuffe
virBufferAsprintf(buf, " %s='",
att[i].name);
- if (att[i].formatter) {
+ if (att[i].formatter && !(flags & NWFILTER_ENTRY_ITEM_FLAG_HAS_VAR)) {
if (!att[i].formatter(buf, def, item)) {
virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
_("formatter for %s %s reported error"),
Index: libvirt-acl/src/conf/nwfilter_conf.h
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.h
+++ libvirt-acl/src/conf/nwfilter_conf.h
@@ -103,8 +103,10 @@ enum attrDatatype {
DATATYPE_BOOLEAN = (1 << 12),
DATATYPE_UINT32 = (1 << 13),
DATATYPE_UINT32_HEX = (1 << 14),
+ DATATYPE_IPSETNAME = (1 << 15),
+ DATATYPE_IPSETFLAGS = (1 << 16),
- DATATYPE_LAST = (1 << 15),
+ DATATYPE_LAST = (1 << 17),
};
# define NWFILTER_MAC_BGA "01:80:c2:00:00:00"
@@ -136,9 +138,16 @@ struct _nwItemDesc {
uint8_t mask;
uint8_t flags;
} tcpFlags;
+ struct {
+ char setname[32];
+ uint8_t numFlags;
+ uint8_t flags;
+ } ipset;
} u;
};
+# define VALID_IPSETNAME \
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:-+ "
typedef struct _ethHdrDataDef ethHdrDataDef;
typedef ethHdrDataDef *ethHdrDataDefPtr;
@@ -232,6 +241,8 @@ struct _ipHdrDataDef {
nwItemDesc dataState;
nwItemDesc dataConnlimitAbove;
nwItemDesc dataComment;
+ nwItemDesc dataIPSet;
+ nwItemDesc dataIPSetFlags;
};
Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -256,10 +256,13 @@ static int
_printDataType(virNWFilterVarCombIterPtr vars,
char *buf, int bufsize,
nwItemDescPtr item,
- bool asHex)
+ bool asHex, bool directionIn)
{
int done;
char *data;
+ uint8_t ctr;
+ virBuffer vb = VIR_BUFFER_INITIALIZER;
+ char *flags;
if (printVar(vars, buf, bufsize, item, &done) < 0)
return -1;
@@ -346,6 +349,44 @@ _printDataType(virNWFilterVarCombIterPtr
}
break;
+ case DATATYPE_IPSETNAME:
+ snprintf(buf, bufsize, "%s", item->u.ipset.setname);
+ break;
+
+ case DATATYPE_IPSETFLAGS:
+ for (ctr = 0; ctr < item->u.ipset.numFlags; ctr++) {
+ if (ctr != 0)
+ virBufferAddLit(&vb, ",");
+ if ((item->u.ipset.flags & (1 << ctr))) {
+ if (directionIn)
+ virBufferAddLit(&vb, "dst");
+ else
+ virBufferAddLit(&vb, "src");
+ } else {
+ if (directionIn)
+ virBufferAddLit(&vb, "src");
+ else
+ virBufferAddLit(&vb, "dst");
+ }
+ }
+
+ if (virBufferError(&vb)) {
+ virReportOOMError();
+ virBufferFreeAndReset(&vb);
+ return -1;
+ }
+
+ flags = virBufferContentAndReset(&vb);
+
+ if (snprintf(buf, bufsize, "%s", flags) >= bufsize) {
+ virNWFilterReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Buffer too small for IPSETFLAGS type"));
+ VIR_FREE(flags);
+ return -1;
+ }
+ VIR_FREE(flags);
+ break;
+
default:
virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
_("Unhandled datatype %x"), item->datatype);
@@ -362,16 +403,23 @@ printDataType(virNWFilterVarCombIterPtr
char *buf, int bufsize,
nwItemDescPtr item)
{
- return _printDataType(vars, buf, bufsize, item, 0);
+ return _printDataType(vars, buf, bufsize, item, 0, 0);
}
+static int
+printDataTypeDirection(virNWFilterVarCombIterPtr vars,
+ char *buf, int bufsize,
+ nwItemDescPtr item, bool directionIn)
+{
+ return _printDataType(vars, buf, bufsize, item, 0, directionIn);
+}
static int
printDataTypeAsHex(virNWFilterVarCombIterPtr vars,
char *buf, int bufsize,
nwItemDescPtr item)
{
- return _printDataType(vars, buf, bufsize, item, 1);
+ return _printDataType(vars, buf, bufsize, item, 1, 0);
}
@@ -927,6 +975,7 @@ iptablesHandleIpHdr(virBufferPtr buf,
char ipaddr[INET6_ADDRSTRLEN],
number[MAX(INT_BUFSIZE_BOUND(uint32_t),
INT_BUFSIZE_BOUND(int))];
+ char str[200];
const char *src = "--source";
const char *dst = "--destination";
const char *srcrange = "--src-range";
@@ -938,6 +987,26 @@ iptablesHandleIpHdr(virBufferPtr buf,
dstrange = "--src-range";
}
+ if (HAS_ENTRY_ITEM(&ipHdr->dataIPSet) &&
+ HAS_ENTRY_ITEM(&ipHdr->dataIPSetFlags)) {
+
+ if (printDataType(vars,
+ str, sizeof(str),
+ &ipHdr->dataIPSet) < 0)
+ goto err_exit;
+
+ virBufferAsprintf(afterStateMatch,
+ " -m set --match-set \"%s\" ",
+ str);
+
+ if (printDataTypeDirection(vars,
+ str, sizeof(str),
+ &ipHdr->dataIPSetFlags, directionIn) < 0)
+ goto err_exit;
+
+ virBufferAdd(afterStateMatch, str, -1);
+ }
+
if (HAS_ENTRY_ITEM(&ipHdr->dataSrcIPAddr)) {
if (printDataType(vars,
Index: libvirt-acl/docs/schemas/nwfilter.rng
===================================================================
--- libvirt-acl.orig/docs/schemas/nwfilter.rng
+++ libvirt-acl/docs/schemas/nwfilter.rng
@@ -485,6 +485,14 @@
<ref name="stateflags-type"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="ipset">
+ <ref name="ipset-type"/>
+ </attribute>
+ <attribute name="ipsetflags">
+ <ref name="ipsetflags-type"/>
+ </attribute>
+ </optional>
</interleave>
</define>
@@ -1060,4 +1068,19 @@
<param name="pattern">((SYN|ACK|URG|PSH|FIN|RST)(,(SYN|ACK|URG|PSH|FIN|RST))*|ALL|NONE)/((SYN|ACK|URG|PSH|FIN|RST)(,(SYN|ACK|URG|PSH|FIN|RST))*|ALL|NONE)</param>
</data>
</define>
+
+ <define name='ipset-type'>
+ <choice>
+ <ref name="variable-name-type"/>
+ <data type="string">
+ <param name="pattern">[a-zA-Z0-9_\.:\-\+]{1,31}</param>
+ </data>
+ </choice>
+ </define>
+
+ <define name='ipsetflags-type'>
+ <data type="string">
+ <param name="pattern">(src|dst)(,(src|dst)){0,5}</param>
+ </data>
+ </define>
</grammar>
Index: libvirt-acl/tests/nwfilterxml2xmlin/ipset-test.xml
===================================================================
--- /dev/null
+++ libvirt-acl/tests/nwfilterxml2xmlin/ipset-test.xml
@@ -0,0 +1,24 @@
+<filter name='testcase' chain='root'>
+ <uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
+ <rule action='accept' direction='out'>
+ <all ipset='test' ipsetflags='src,dst' />
+ </rule>
+ <rule action='accept' direction='in'>
+ <all state='NONE' ipset='test' ipsetflags='src,dst' comment='in+NONE'/>
+ </rule>
+ <rule action='accept' direction='out'>
+ <all state='NONE' ipset='test' ipsetflags='src,dst' comment='out+NONE'/>
+ </rule>
+ <rule action='accept' direction='in'>
+ <all ipset='test' ipsetflags='SRC,DST,SRC' />
+ </rule>
+ <rule action='accept' direction='in'>
+ <all ipset='test:_.-+' ipsetflags='SRC,dSt,SRC' />
+ </rule>
+ <rule action='accept' direction='in'>
+ <all ipset='$IPSETNAME' ipsetflags='src,dst' />
+ </rule>
+ <rule action='accept' direction='inout'>
+ <all ipset='$IPSETNAME' ipsetflags='src,dst' comment='inout'/>
+ </rule>
+</filter>
Index: libvirt-acl/tests/nwfilterxml2xmlout/ipset-test.xml
===================================================================
--- /dev/null
+++ libvirt-acl/tests/nwfilterxml2xmlout/ipset-test.xml
@@ -0,0 +1,24 @@
+<filter name='testcase' chain='root'>
+ <uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
+ <rule action='accept' direction='out' priority='500'>
+ <all ipset='test' ipsetflags='src,dst'/>
+ </rule>
+ <rule action='accept' direction='in' priority='500'>
+ <all state='NONE' ipset='test' ipsetflags='src,dst' comment='in+NONE'/>
+ </rule>
+ <rule action='accept' direction='out' priority='500'>
+ <all state='NONE' ipset='test' ipsetflags='src,dst' comment='out+NONE'/>
+ </rule>
+ <rule action='accept' direction='in' priority='500'>
+ <all ipset='test' ipsetflags='src,dst,src'/>
+ </rule>
+ <rule action='accept' direction='in' priority='500'>
+ <all ipset='test:_.-+' ipsetflags='src,dst,src'/>
+ </rule>
+ <rule action='accept' direction='in' priority='500'>
+ <all ipset='$IPSETNAME' ipsetflags='src,dst'/>
+ </rule>
+ <rule action='accept' direction='inout' priority='500'>
+ <all ipset='$IPSETNAME' ipsetflags='src,dst' comment='inout'/>
+ </rule>
+</filter>
Index: libvirt-acl/tests/nwfilterxml2xmltest.c
===================================================================
--- libvirt-acl.orig/tests/nwfilterxml2xmltest.c
+++ libvirt-acl/tests/nwfilterxml2xmltest.c
@@ -157,6 +157,8 @@ mymain(void)
DO_TEST("iter-test2", false);
DO_TEST("iter-test3", false);
+ DO_TEST("ipset-test", false);
+
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
Index: libvirt-acl/docs/formatnwfilter.html.in
===================================================================
--- libvirt-acl.orig/docs/formatnwfilter.html.in
+++ libvirt-acl/docs/formatnwfilter.html.in
@@ -528,6 +528,10 @@
<li>IPV6_MASK: IPv6 mask in numbers format (FFFF:FFFF:FC00::) or CIDR mask (0-128)</li>
<li>STRING: A string</li>
<li>BOOLEAN: 'true', 'yes', '1' or 'false', 'no', '0'</li>
+ <li>IPSETFLAGS: The source and destination flags of the ipset described
+ by up to 6 'src' or 'dst' elements selecting features from either
+ the source or destination part of the packet header; example:
+ src,src,dst</li>
</ul>
<p>
<br/><br/>
@@ -1169,6 +1173,16 @@
<td>STRING</td>
<td>TCP-only: format of mask/flags with mask and flags each being a comma separated list of SYN,ACK,URG,PSH,FIN,RST or NONE or ALL</td>
</tr>
+ <tr>
+ <td>ipset <span class="since">(Since 0.9.12)</span></td>
+ <td>STRING</td>
+ <td>The name of an IPSet managed outside of libvirt</td>
+ </tr>
+ <tr>
+ <td>ipsetflags <span class="since">(Since 0.9.12)</span></td>
+ <td>IPSETFLAGS</td>
+ <td>flags for the IPSet; requires ipset attributed</td>
+ </tr>
</table>
<p>
<br/><br/>
@@ -1269,6 +1283,16 @@
<td>STRING</td>
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
</tr>
+ <tr>
+ <td>ipset <span class="since">(Since 0.9.12)</span></td>
+ <td>STRING</td>
+ <td>The name of an IPSet managed outside of libvirt</td>
+ </tr>
+ <tr>
+ <td>ipsetflags <span class="since">(Since 0.9.12)</span></td>
+ <td>IPSETFLAGS</td>
+ <td>flags for the IPSet; requires ipset attributed</td>
+ </tr>
</table>
<p>
<br/><br/>
@@ -1358,6 +1382,16 @@
<td>STRING</td>
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
</tr>
+ <tr>
+ <td>ipset <span class="since">(Since 0.9.12)</span></td>
+ <td>STRING</td>
+ <td>The name of an IPSet managed outside of libvirt</td>
+ </tr>
+ <tr>
+ <td>ipsetflags <span class="since">(Since 0.9.12)</span></td>
+ <td>IPSETFLAGS</td>
+ <td>flags for the IPSet; requires ipset attributed</td>
+ </tr>
</table>
<p>
<br/><br/>
@@ -1459,6 +1493,16 @@
<td>STRING</td>
<td>TCP-only: format of mask/flags with mask and flags each being a comma separated list of SYN,ACK,URG,PSH,FIN,RST or NONE or ALL</td>
</tr>
+ <tr>
+ <td>ipset <span class="since">(Since 0.9.12)</span></td>
+ <td>STRING</td>
+ <td>The name of an IPSet managed outside of libvirt</td>
+ </tr>
+ <tr>
+ <td>ipsetflags <span class="since">(Since 0.9.12)</span></td>
+ <td>IPSETFLAGS</td>
+ <td>flags for the IPSet; requires ipset attributed</td>
+ </tr>
</table>
<p>
<br/><br/>
@@ -1545,6 +1589,16 @@
<td>STRING</td>
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
</tr>
+ <tr>
+ <td>ipset <span class="since">(Since 0.9.12)</span></td>
+ <td>STRING</td>
+ <td>The name of an IPSet managed outside of libvirt</td>
+ </tr>
+ <tr>
+ <td>ipsetflags <span class="since">(Since 0.9.12)</span></td>
+ <td>IPSETFLAGS</td>
+ <td>flags for the IPSet; requires ipset attributed</td>
+ </tr>
</table>
<p>
<br/><br/>
@@ -1619,6 +1673,16 @@
<td>STRING</td>
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
</tr>
+ <tr>
+ <td>ipset <span class="since">(Since 0.9.12)</span></td>
+ <td>STRING</td>
+ <td>The name of an IPSet managed outside of libvirt</td>
+ </tr>
+ <tr>
+ <td>ipsetflags <span class="since">(Since 0.9.12)</span></td>
+ <td>IPSETFLAGS</td>
+ <td>flags for the IPSet; requires ipset attributed</td>
+ </tr>
</table>
<p>
<br/><br/>
12 years, 6 months
[libvirt] [PATCHv3 1/1] Assign spapr-vio bus address to ibmvscsi controller
by Li Zhang
For pseries guest, the default controller model is
ibmvscsi controller, this controller only can work
on spapr-vio address.
This patch is to assign spapr-vio address type to
ibmvscsi controller and correct vscsi test case.
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
src/qemu/qemu_command.c | 17 +++++++++++++----
.../qemuxml2argv-disk-scsi-vscsi.args | 4 ++--
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 117542f..0a85d19 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -779,6 +779,7 @@ qemuAssignSpaprVIOAddress(virDomainDefPtr def, virDomainDeviceInfoPtr info,
int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def)
{
int i, rc;
+ int model;
/* Default values match QEMU. See spapr_(llan|vscsi|vty).c */
@@ -790,10 +791,18 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def)
}
for (i = 0 ; i < def->ncontrollers; i++) {
- rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info,
- 0x2000ul);
- if (rc)
- return rc;
+ model = def->controllers[i]->model;
+ if (model == -1 &&
+ def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI)
+ model = qemuDefaultScsiControllerModel(def);
+ if (model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI &&
+ def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
+ def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
+ rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info,
+ 0x2000ul);
+ if (rc)
+ return rc;
+ }
}
for (i = 0 ; i < def->nserials; i++) {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args
index 4261a84..d57159f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args
@@ -1,8 +1,8 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -monitor \
unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -device spapr-vscsi,id=scsi0,\
-bus=pci.0,addr=0x3 -drive file=/dev/HostVG/QEMUGuest1,if=none,\
+reg=0x2000 -drive file=/dev/HostVG/QEMUGuest1,if=none,\
id=drive-ide0-0-0 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file=/tmp/scsidisk.img,if=none,id=drive-scsi0-0-3-0 \
-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=3,lun=0,drive=drive-scsi0-0-3-0,id=scsi0-0-3-0 \
--usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
+-usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
--
1.7.9.5
12 years, 6 months
[libvirt] Re-4: [Patch] Libvirt - Fix locking for readonly devices
by David Weber
> On Mon, May 14, 2012 at 08:32:01AM +0000, David Weber wrote:
> > > This isn't good - the lock manager implementation must be the
> > > one to decide what todo with readonly & shared disks. The sanlock
> > > plugin, however, does not currently support readonly/shared leases
> > > hence why it rejects them. We could probably add a config param
> > > to allow readonly/shared leases to be skipped by the sanlock plugin.
> >
> > Thanks for clarification. I've attached an updated patch which
> > adds such a config param. It works but I can't test
> > live-migration at the moment. But as far as I understood it
> > shouldn't be a problem.
>
> Thanks, your patch looks good but needs two further small additions
> to the libvirt_sanlock.aug and test_libvirt_sanlock.aug files to
> take account of the new config parameter.
Oops, Updated patch attached (tested with augparse)
David
----------------------------------------
commit 33678a8b2d294bebf327106d586d41c9b157174f
Author: David Weber <wb(a)munzinger.de>
Date: Mon May 14 09:43:27 2012 +0200
Add ignore param for readonly and shared disk in sanlock
diff --git a/src/locking/libvirt_sanlock.aug b/src/locking/libvirt_sanlock.aug
index 5f5f8a1..d65b002 100644
--- a/src/locking/libvirt_sanlock.aug
+++ b/src/locking/libvirt_sanlock.aug
module Libvirt_sanlock =
| bool_entry "auto_disk_leases"
| int_entry "host_id"
| bool_entry "require_lease_for_disks"
+ | bool_entry "ignore_readonly_and_shared_disks"
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
let empty = [ label "#empty" . eol ]
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index d344d6a..57b688a 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
struct _virLockManagerSanlockDriver {
bool requireLeaseForDisks;
int hostID;
bool autoDiskLease;
+ bool ignoreReadonlyShared;
char *autoDiskLeasePath;
};
static int virLockManagerSanlockLoadConfig(const char *configFile)
CHECK_TYPE("auto_disk_leases", VIR_CONF_LONG);
if (p) driver->autoDiskLease = p->l;
+ p = virConfGetValue(conf, "ignore_readonly_and_shared_disks");
+ CHECK_TYPE("ignore_readonly_and_shared_disks", VIR_CONF_LONG);
+ if (p) driver->ignoreReadonlyShared = p->l;
+
p = virConfGetValue(conf, "disk_lease_dir");
CHECK_TYPE("disk_lease_dir", VIR_CONF_STRING);
if (p && p->str) {
static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
SANLK_MAX_RESOURCES);
return -1;
}
+
+ if (((flags & VIR_LOCK_MANAGER_RESOURCE_READONLY) ||
+ (flags &VIR_LOCK_MANAGER_RESOURCE_SHARED)) &&
+ (driver->ignoreReadonlyShared)) {
+ return 0;
+ }
if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY) {
virLockError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
diff --git a/src/locking/sanlock.conf b/src/locking/sanlock.conf
index efc35ee..5429522 100644
--- a/src/locking/sanlock.conf
+++ b/src/locking/sanlock.conf
# to enabled, otherwise it defaults to disabled.
#
#require_lease_for_disks = 1
+
+#
+# Ignore readonly and shared disks as they aren't supportet yet
+#
+#ignore_readonly_and_shared_disks = 1
diff --git a/src/locking/test_libvirt_sanlock.aug b/src/locking/test_libvirt_sanlock.aug
index b5169e1..90ab59f 100644
--- a/src/locking/test_libvirt_sanlock.aug
+++ b/src/locking/test_libvirt_sanlock.aug
module Test_libvirt_sanlock =
disk_lease_dir = \"/var/lib/libvirt/sanlock\"
host_id = 1
require_lease_for_disks = 1
+ignore_readonly_and_shared_disks = 1
"
test Libvirt_sanlock.lns get conf =
require_lease_for_disks = 1
{ "disk_lease_dir" = "/var/lib/libvirt/sanlock" }
{ "host_id" = "1" }
{ "require_lease_for_disks" = "1" }
+{ "ignore_readonly_and_shared_disks" = "1" }
To: berrange(a)redhat.com
Cc: libvir-list(a)redhat.com
sanlock-devel(a)lists.fedorahosted.org
12 years, 6 months
[libvirt] [PATCH 0/2] Rework RPC message buffer
by Michal Privoznik
This patch set tries to fix corner cases where libvirt runs on huge
system, e.g. 4K CPU monster. In these cases, capabilities XML is
enormously big, as we are transferring info about each singe CPU core
(to which NUMA node it belongs, etc.). This XML is bigger than our
RPC limit, therefore users cannot get it as it is dropped on server,
leaving them with inability to connect. Therefore we need to increase
those limits (whole RPC message and RPC string). However, simple
lifting up will work, but increase mem usage.
Therefore I've reworked RPC buffer handling: changed it from
'statically' to dynamically allocated.
So in most cases - when small messages are sent - this will even
decrease our memory consumption. Leaving us flexible for corner cases
described above.
On the other hand, I realize we've had our history with RPC breakage.
So I think I'll require more than 1 ACK before pushing.
What's your opinion?
Michal Privoznik (2):
rpc: Switch to dynamically allocated message buffer
rpc: Size up RPC limits
src/remote/remote_protocol.x | 2 +-
src/rpc/virnetclient.c | 16 ++-
src/rpc/virnetmessage.c | 12 ++-
src/rpc/virnetmessage.h | 6 +-
src/rpc/virnetprotocol.x | 6 +-
src/rpc/virnetserverclient.c | 20 ++-
tests/virnetmessagetest.c | 393 +++++++++++++++++++++++-------------------
7 files changed, 268 insertions(+), 187 deletions(-)
--
1.7.8.5
12 years, 6 months
[libvirt] Release of libvirt-0.9.12
by Daniel Veillard
So I made the release, it is now available on the FTP server (the rpms
are slowly being uploaded too):
ftp://libvirt.org/libvirt/
This is mainly a stabilization release, with a lot of bugs fixes, and
portability cleanups. There is still many improvements but relatively
few new features as such (the new parallels driver being postponed to
the actual release of the hypervisor).
I would like to raise the attention to Dan patch set to implement ACL
support to the API, a very needed feature which would bring us very
close to what I would hope for a 1.0.0 release:
https://www.redhat.com/archives/libvir-list/2012-May/msg00090.html
Let's try to bring this in for the next release !
Features:
- qemu: allow snapshotting of sheepdog and rbd disks (Josh Durgin)
- blockjob: add new APIs (Eric Blake)
Documentation:
- mention migration issue of which credentials are used (Eric Blake)
- Add 'maintenance releases' link in 'News' sidebar (Cole Robinson)
- Added Snooze cloud manager to the IaaS section (Eugen Feller)
- python: Fix doc directory name for stable releases (Cole Robinson)
- virsh: Fix and clarify the --title flag for the list command in man page (Peter Krempa)
- Improve the schema for fs device (Osier Yang)
- openvz: Correct the comments for new node APIs (Osier Yang)
- fix 'omitted' typo in <cputune> doc (Christophe Fergeau)
- add missing </span> in <vcpu placement> doc (Christophe Fergeau)
- fix path to openvz network configuration file (Guido Günther)
- Fix comment about GNUTLS initialization/cleanup (Daniel P. Berrange)
- fix typo in previous patch (Eric Blake)
- news.html.in: Fix </br> void tag (Michal Privoznik)
Portability:
- qemu: fix build when !HAVE_NUMACTL (Eric Blake)
- netlink: Fix build with libnl-3 (Jiri Denemark)
- build: avoid link failure on Windows (Eric Blake)
- qemu: avoid 32-bit compiler warning (Eric Blake)
- build: fix build on cygwin (Eric Blake)
- storage: fix build with iscsi (Eric Blake)
- build: fix bootstrap on RHEL (Eric Blake)
- win32: Properly handle TlsGetValue returning NULL (Matthias Bolte)
- build: avoid type-punning in vbox (Eric Blake)
- build: fix fresh checkout on RHEL5 (Eric Blake)
- fix dependencies on DBus (Daniel P. Berrange)
- tests: Fix libvirtdconftest in VPATH build (Jiri Denemark)
- build: avoid s390 compiler warnings (Eric Blake)
- Fix compilation error on 32bit (Stefan Berger)
- test: fix build errors with gcc 4.7.0 and -O0 (Laine Stump)
- Pull in GNULIB regex module for benefit of test suite on Win32 (Daniel P. Berrange)
- Fix format specifiers in test cases on Win32 (Daniel P. Berrange)
Bug Fixes:
- esx: Fix memory leaks in error paths related to transferred ownership (Matthias Bolte)
- qemu: Don't skip detection of virtual cpu's on non KVM targets (Peter Krempa)
- qemu: Re-detect virtual cpu threads after cpu hot (un)plug. (Peter Krempa)
- build: fix stamp file name (Eric Blake)
- usb: fix crash when failing to attach a second usb device (Guannan Ren)
- build: Fix the typo in configure.ac (Osier Yang)
- conf: Fix memory leaks in virStoragePoolDefParseSource (Alex Jia)
- Report error when parsing character device target type (Jim Fehlig)
- snapshot: allow block devices past cgroup (Eric Blake)
- domain_conf: add "default" to list of valid spice channels (Alon Levy)
- domain_conf: add "usbredir" to list of valid spice channels (Alon Levy)
- virsh: avoid heap corruption leading to virsh abort (Jim Meyering)
- util: fix libvirtd startup failure due to netlink error (Laine Stump)
- qemu: call usb search function for hostdev initialization and hotplug (Guannan Ren)
- qemu: Emit compatible XML when migrating a domain (Jiri Denemark)
- qemu: don't modify domain on failed blockiotune (Eric Blake)
- node_device: fix possible non-terminated string (Stefan Berger)
- uuid: fix possible non-terminated string (Stefan Berger)
- tests: fix resource leak (Stefan Berger)
- qemu: fix resource leak (Stefan Berger)
- vmx: fix resource leak (Stefan Berger)
- Coverity: Fix resource leak in virnetlink.c (Osier Yang)
- Coverity: Fix resource leak in nodeinfo.c (Osier Yang)
- Coverity: Fix resource leak in test driver (Osier Yang)
- Coverity: Fix resource leak in xen driver (Osier Yang)
- Coverity: Fix resource leaks in phyp driver (Osier Yang)
- Coverity: Fix the forward_null error in Python binding codes (Osier Yang)
- Correct indent errors in the function qemuDomainNetsRestart (Li Zhang)
- Make lxcContainerSetStdio the last thing to be called in container startup (Daniel P. Berrange)
- maint: avoid false positives on unmarked diagnostics (Eric Blake)
- util: Avoid libvirtd crash in virNetDevTapCreate (Alex Jia)
- storage: Break out the loop if duplicate pool is found (Osier Yang)
- qemu: Make sure qemu can access its directory in hugetlbfs (Jiri Denemark)
- More coverity findings addressed (Stefan Berger)
- blockjob: fix block-stream bandwidth race (Eric Blake)
- lxc: Fix coverity findings (Stefan Berger)
- Serialize running apibuild.py (Cole Robinson)
- macvtap: fix a typo (Stefan Berger)
- nwfilter: address more coverity findings (Stefan Berger)
- nwfilter: address coverity findings (Stefan Berger)
- util: fix error messages in virNetlinkEventServiceStart (Laine Stump)
- qemu: Avoid bogus error at the end of tunnelled migration (Jiri Denemark)
- qemu: Fix detection of failed migration (Jiri Denemark)
- rpc: Discard non-blocking calls only when necessary (Jiri Denemark)
- qemu: Preserve original error during migration (Jiri Denemark)
- util: fix crash when starting macvtap interfaces (Laine Stump)
- fix memleak in linuxParseCPUmap (Hu Tao)
- vbox: Fix passing an empty IMedium* array to IMachine::Delete (Matthias Bolte)
- esx: Fix segfault in esxConnectToHost (Ryan Woodsmall)
- virnetserver: handle sigaction correctly (Eric Blake)
- virsh: avoid uninitialized memory usage (Eric Blake)
- nwfilter: Fix support for trusted DHCP servers (Stefan Berger)
- Fix a memory leak (Stefan Berger)
- Do not enforce source type of console[0] (Jan Kiszka)
- storage: lvm: use correct lv* command parameters (Cole Robinson)
- Fix macvtap detection by also checking for IFLA_VF_MAX (Guido Günther)
- conf: Avoid double assignment in virDomainDiskRemove (Michal Privoznik)
- qemu: Fix mem leak in qemuProcessInitCpuAffinity (Michal Privoznik)
- qemu,util: fix netlink callback registration for migration (D. Herrendoerfer)
- qemuOpenFile: Don't force chown on NFS (Michal Privoznik)
- daemon: Plug memory leaks (Alex Jia)
- blockjob: allow for fast-finishing job (Eric Blake)
- qemu: Fix deadlock when qemuDomainOpenConsole cleans up a connection (Peter Krempa)
- snapshot: fix memory leak on error (Eric Blake)
- qemu_ga: Don't overwrite errors on FSThaw (Michal Privoznik)
- xen config: No vfb in HVM guest configuration (Stefan Bader)
- virURIParse: don't forget to copy the user part (Guido Günther)
- test: fix segfault in networkxml2argvtest (Laine Stump)
- conf: Plug memory leaks on virDomainDiskDefParseXML (Alex Jia)
- Fix parallel build in docs/ directory (Daniel P. Berrange)
- qemu: Don't leak temporary list of USB devices (Michal Privoznik)
Improvements:
- qemu: Refactor qemuDomainSetVcpusFlags (Peter Krempa)
- numad: Update comments in libvirt.spec.in (Osier Yang)
- numad: Check numactl-devel if compiled with numad support (Osier Yang)
- numad: Divide cur_balloon by 1024 before passing it to numad (Osier Yang)
- numad: Always output 'placement' of <vcpu> (Osier Yang)
- numad: Copy 'placement' of <numatune> to <vcpu> by default (Osier Yang)
- numad: Set memory policy from numad advisory nodeset (Osier Yang)
- tests: add some self-documentation to tests (Alon Levy)
- util: set src_pid for virNetlinkCommand when appropriate (Laine Stump)
- util: function to get local nl_pid used by netlink event socket (Laine Stump)
- util: allow specifying both src and dst pid in virNetlinkCommand (Laine Stump)
- openvz: simplify openvzDomainDefineCmd by using virCommandPtr (Guido Günther)
- usb: create functions to search usb device accurately (Guannan Ren)
- rpm: Handle different source URLs for maint releases (Cole Robinson)
- qemu: Don't use virDomainDefFormat* directly (Jiri Denemark)
- qemu: reject blockiotune if qemu too old (Eric Blake)
- util: remove error log from stubs of virNetlinkEventServiceStart|Stop (Laine Stump)
- openvz: read vmguarpages/privvmpages to set memory tunables (Guido Günther)
- build: support libnl-3 (Serge Hallyn)
- util: add functions for interating over json object (Dmitry Guryanov)
- build: update pid_t type static check (Marc-André Lureau)
- build: fix output of pid values (Marc-André Lureau)
- virsh: output scaled values with correct units (Eric Blake)
- virsh: make -h always give help (Eric Blake)
- build: make ATTRIBUTE_NONNULL() a NOP unless STATIC_ANALYSIS is on (Laine Stump)
- Ensure logging is initialized early in libvirt_lxc (Daniel P. Berrange)
- Ensure LXC security driver is set unconditonally (Daniel P. Berrange)
- Ensure libvirt_lxc process loads the live XML config (Daniel P. Berrange)
- qemu: change rbd auth_supported separation character to ; (Josh Durgin)
- storage: Allow multiple hosts for a storage pool (Wido den Hollander)
- qemu_agent: Report error class at least (Michal Privoznik)
- configure: Use ustar format for dist tarball (Cole Robinson)
- qemu: Use common helper when probing qemu capabilities (Jiri Denemark)
- qemu: improve errors related to offline domains (Eric Blake)
- keepalive: Add ability to disable keepalive messages (Peter Krempa)
- Add new functions to virSocketAddr (Stefan Berger)
- macvtap: use embedded buffers (Stefan Berger)
- Improve on virAtomic implementation (Stefan Berger)
- build: Fix version of gettext macros (Peter Krempa)
- openvz: add network interface stats (Guido Günther)
- blockjob: enhance xml to track mirrors across libvirtd restart (Eric Blake)
- blockjob: add 'blockcopy' to virsh (Eric Blake)
- cpu: Improve error reporting on incompatible CPUs (Peter Krempa)
- openvz: wire up getHostname (Guido Günther)
- build: avoid strtol and strtod (Eric Blake)
- conf: tighten up XML integer parsing (Eric Blake)
- virsh: avoid strtol (Eric Blake)
- Support for atomic operations on integers (Stefan Berger)
- Implement virHashRemoveAll function (Stefan Berger)
- util: only register callbacks for CREATE operations in virnetdevmacvlan.c (D. Herrendoerfer)
- blockjob: add virsh blockpull --wait (Eric Blake)
- qemu: use consistent error when qemu binary is too old (Eric Blake)
- vbox: avoid provoking assertions in VBoxSVC (Jean-Baptiste Rouault)
- conf: Do not parse cpuset only if the placement is auto (Osier Yang)
- tests: Update read-bufsiz to delete the UUID of vm XML (Osier Yang)
- test: Set the fixed uuid for the default XMLs (Osier Yang)
- qemu: Split ide-drive into ide-cd and ide-hd (Osier Yang)
- qemu: Split scsi-disk into into scsi-hd and scsi-cd (Osier Yang)
- xen: do not use ioemu type for any emulated NIC (Stefan Bader)
- qemuProcessStart: Switch to flags instead of bunch booleans (Michal Privoznik)
- qemu: Avoid the memory allocation and freeing (Osier Yang)
- numad: Ignore cpuset if placement is auto (Osier Yang)
- numad: Convert node list to cpumap before setting affinity (Osier Yang)
- openvz: wire up more node information functions (Guido Günther)
- virnetdev: Check for defined IFLA_VF_* (Philipp Hahn)
- Web placeholder for pending patches on the web site (Daniel Veillard)
- xend_internal: Use domain/status for shutdown check (Stefan Bader)
- blockjob: wire up qemu async virDomainBlockJobAbort (Eric Blake)
- blockjob: optimize JSON event handler lookup (Eric Blake)
- blockjob: add API for async virDomainBlockJobAbort (Adam Litke)
- blockjob: add qemu capabilities related to block pull jobs (Eric Blake)
- qemu: Warn on possibly incorrect usage of EnterMonitor* (Jiri Denemark)
- qemu: Track job owner for better debugging (Jiri Denemark)
- qemu: Avoid excessive calls to qemuDomainObjSaveJob() (Jiri Denemark)
- daemon: Add libvirtd-config.c to the list of files to translate (Jiri Denemark)
- Wire up <loader> to set the QEMU BIOS path (Daniel P. Berrange)
- virsh: Clean up usage of boolean flag variables (Peter Krempa)
- virsh: Clarify use of the --managed-save flag for the list command (Peter Krempa)
- Replace daemon-conf test script with a proper test case (Daniel P. Berrange)
- Switch libvirtd config loading code to use error APIs (Daniel P. Berrange)
- Add API for loading daemon config from in-memory blob (Daniel P. Berrange)
- Split libvirtd config file loading out into separate files (Daniel P. Berrange)
- UML: fix iteration over consoles (MATSUDA, Daiki)
- tests: avoid compiler warnings (Eric Blake)
- openvz: support vzctl 3.1 (Ilja Livenson)
- Don't install sysctl file on non-Linux hosts (Daniel P. Berrange)
- Add linuxNodeInfoCPUPopulate to src/libvirt_linux.syms (Daniel P. Berrange)
- qemu: Build activeUsbHostdevs list on process reconnect (Michal Privoznik)
- qemu: Delete USB devices used by domain on stop (Michal Privoznik)
- Fix initial hypervisor conditionals (Daniel P. Berrange)
- Remove bogus xen-devel dep from libvirt-devel RPM (Daniel P. Berrange)
- Introduce per-hypervisor virtual RPMs (Daniel P. Berrange)
- Split config files & daemon off from main daemon RPM (Daniel P. Berrange)
- Remove API XML files from libvirt RPM (Daniel P. Berrange)
- Move all documentation into a -docs sub-RPM (Daniel P. Berrange)
- virsh: Clarify escape sequence (Michal Privoznik)
Cleanups:
- building: remove libvirt_dbus.syms from EXTRA_DIST (Wen Congyang)
- conf: remove redundant () (Eric Blake)
- util: remove dead casts (Eric Blake)
- virsh: minor syntactic cleanups (Eric Blake)
- gitignore: Reorder alphabetically (Michal Privoznik)
Thanks everybody for helping with the release, be it with suggestion,
reports, documentation, patches or reviews !
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, 6 months
[libvirt] [PATCH] build: really silence the 32-bit warning
by Eric Blake
Commit cdce2f42d tried to silence a compiler warning on 32-bit builds,
but the gcc shipped with RHEL 5 is old enough that the type conversion
via multiplication by 1 was insufficient for the task.
* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Previous attempt
didn't get past all gcc versions.
---
Pushing under the build-breaker rule.
src/qemu/qemu_monitor.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 0d4319d..7d69c67 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2785,13 +2785,14 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
modern);
/* Convert bandwidth MiB to bytes */
- if (bandwidth * 1ULL > ULLONG_MAX / 1024 / 1024) {
+ speed = bandwidth;
+ if (speed > ULLONG_MAX / 1024 / 1024) {
qemuReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
ULLONG_MAX / 1024 / 1024);
return -1;
}
- speed = bandwidth * 1024ULL * 1024ULL;
+ speed <<= 20;
if (mon->json)
ret = qemuMonitorJSONBlockJob(mon, device, base, speed, info, mode,
--
1.7.7.6
12 years, 6 months