[libvirt] [tck PATCH] Fix typo/bug in get_network_ip
by Laine Stump
Signed-off-by: Laine Stump <laine(a)laine.org>
---
lib/Sys/Virt/TCK.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
index 78d3774..67eb5f0 100644
--- a/lib/Sys/Virt/TCK.pm
+++ b/lib/Sys/Virt/TCK.pm
@@ -1259,7 +1259,7 @@ sub get_network_ip {
if ($net_mask) {
$ip = NetAddr::IP->new($net_ip, $net_mask);
} elsif ($net_prefix) {
- $ip = NetAddr::IP->new("$net_ip/$net_mask");
+ $ip = NetAddr::IP->new("$net_ip/$net_prefix");
} else {
$ip = NetAddr::IP->new("$net_ip");
}
--
2.14.4
6 years, 6 months
[libvirt] [tck PATCH v2 00/15] Misc fixes to the TCK
by Daniel P. Berrangé
Some final misc fixes before doing a new release
Daniel P. Berrangé (15):
rpm: use standard perl variables
rpm: add some missing dependencies
rpm: remove obsolete clean section
rpm: remove obsolete build root setting
rpm: remove obsolete group setting
rpm: cleanup docs file list
rpm: delete redundant changelog
build: misc updates the Module::Build config
conf: update URLs for Fedora 28 images
build: ignore more auto generated files
scripts: disable known hosts file
lib: use Test::More directly instead of Test::Builder
lib: merge NetworkHelpers module into main TCK module
license: only refer to the GPL not Artistic
lib: fix array value accessor to use preferred style
.gitignore | 3 +
Build.PL | 12 +-
LICENSE | 159 ----------------------
MANIFEST | 2 -
conf/default.cfg | 12 +-
lib/Sys/Virt/TCK.pm | 91 +++++++++++--
lib/Sys/Virt/TCK/NetworkHelpers.pm | 72 ----------
perl-Sys-Virt-TCK.spec.PL | 41 +++---
scripts/domain/180-interface-parameters.t | 1 -
scripts/nwfilter/100-ping-still-working.t | 1 -
scripts/nwfilter/210-no-mac-spoofing.t | 4 +-
scripts/nwfilter/220-no-ip-spoofing.t | 4 +-
scripts/nwfilter/230-no-mac-broadcast.t | 4 +-
scripts/nwfilter/240-no-arp-spoofing.t | 4 +-
scripts/nwfilter/300-vsitype.t | 1 -
15 files changed, 119 insertions(+), 292 deletions(-)
delete mode 100644 lib/Sys/Virt/TCK/NetworkHelpers.pm
--
2.17.0
6 years, 6 months
[libvirt] [tck PATCH 00/12] Misc fixes to the TCK
by Daniel P. Berrangé
Some final misc fixes before doing a new release
Daniel P. Berrangé (12):
rpm: use standard perl variables
rpm: fix license tag to include option of Artistic license
rpm: add some missing dependencies
rpm: remove obsolete clean section
rpm: remove obsolete build root setting
rpm: remove obsolete group setting
rpm: cleanup docs file list
rpm: delete redundant changelog
build: misc updates the Module::Build config
conf: update URLs for Fedora 28 images
build: ignore more auto generated files
Disable known hosts file
.gitignore | 3 ++
Build.PL | 12 ++++---
MANIFEST | 1 -
conf/default.cfg | 12 +++----
perl-Sys-Virt-TCK.spec.PL | 43 ++++++++++---------------
scripts/nwfilter/210-no-mac-spoofing.t | 3 +-
scripts/nwfilter/220-no-ip-spoofing.t | 3 +-
scripts/nwfilter/230-no-mac-broadcast.t | 3 +-
scripts/nwfilter/240-no-arp-spoofing.t | 3 +-
9 files changed, 41 insertions(+), 42 deletions(-)
--
2.17.0
6 years, 6 months
[libvirt] [dbus PATCH 0/8] NWFilter APIs
by Katerina Koukiou
Katerina Koukiou (8):
Introduce NWFilter Interface
Implement ListNWFilters method for Connect Interface
Implement NWFilterDefineXML method for Connect Interface
Implement Name property for NWFilter Interface
Implement UUID property for NWFilter Interface
Implement GetXMLDesc method for NWFilter Interface
Implement NWFilterLookupByName method for Connect Interface
Implement NWFilterLookupByUUID method for Connect Interface
data/Makefile.am | 1 +
data/org.libvirt.Connect.xml | 24 +++++++
data/org.libvirt.NWFilter.xml | 23 +++++++
src/Makefile.am | 1 +
src/connect.c | 131 +++++++++++++++++++++++++++++++++++
src/connect.h | 1 +
src/nwfilter.c | 157 ++++++++++++++++++++++++++++++++++++++++++
src/nwfilter.h | 9 +++
src/util.c | 32 +++++++++
src/util.h | 15 ++++
10 files changed, 394 insertions(+)
create mode 100644 data/org.libvirt.NWFilter.xml
create mode 100644 src/nwfilter.c
create mode 100644 src/nwfilter.h
--
2.15.0
6 years, 6 months
[libvirt] [tck PATCH] network tests: change network address to avoid commonly-used subnet
by Laine Stump
My own machine has a virtual network on 192.168.123.0/24, and I've
been told that it's a common selection for people who create a second
network after libvirt's default (and in the past was used as a manual
alternative for the default network itself when 192.168.122.0/24
casued a conflict). Changing to 192.168.97.0/24 also isn't foolproof,
but it's much less likely to encounter a conflict leading to a failed
test.
Signed-off-by: Laine Stump <laine(a)laine.org>
---
scripts/networks/networkxml2hostout/tck-testnet-3.dat | 4 ++--
scripts/networks/networkxml2hostout/tck-testnet-3.post.dat | 4 ++--
scripts/networks/networkxml2xmlin/tck-testnet-3.xml | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/networks/networkxml2hostout/tck-testnet-3.dat b/scripts/networks/networkxml2hostout/tck-testnet-3.dat
index 535a9c7..5c61690 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-3.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-3.dat
@@ -24,13 +24,13 @@ dhcp-range=2001:db8:ac10:fd01::1,ra-only
tck-testbr yes
#ip -o addr show dev tck-testbr | gawk '{print $4" "$6}' | grep -v link
10.1.2.1/24 10.1.2.255
-192.168.123.1/24 192.168.123.255
+192.168.97.1/24 192.168.97.255
172.28.255.241/28 172.28.255.255
2001:db8:ac10:fd01::1/64 global
2001:db8:ac10:fe01::1/64 global
#ip -o route show dev tck-testbr | gawk '{print $1" "$7}'
10.1.2.0/24 10.1.2.1
172.28.255.240/28 172.28.255.241
-192.168.123.0/24 192.168.123.1
+192.168.97.0/24 192.168.97.1
#virsh net-list | grep tck-testnet
tck-testnet active no no
diff --git a/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat b/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat
index 5a8906c..e525e72 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat
@@ -2,14 +2,14 @@
#iptables -n -L FORWARD | grep ' 10\.1\.2\.'
#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(listen-address 10\.1\.2\.1\).*|\1|p'
-#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(listen-address 192\.168\.123\.1\).*|\1|p'
+#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(listen-address 192\.168\.97\.1\).*|\1|p'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(listen-address 172\.28\.255\.241\).*|\1|p'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(dhcp-range 10\.1\.2\.2,10\.1\.2\.254\).*|\1|p'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(listen-address 2001\:db8\:ac10\:fe01\:\:1\).*|\1|p'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(listen-address 2001\:db8\:ac10\:fd01\:\:1\).*|\1|p'
#ps aux | sed -n '/radvd --.*tck-testnet-/ s|.*\(\/radvd\/tck-testnet-radvd.conf\).*|\1|p'
#route -n | grep '10\.1\.2\.'
-#route -n | grep '192\.168\.123\.'
+#route -n | grep '192\.168\.97\.'
#route -n | grep '172\.28\.255\.240'
#brctl show | grep tck-testbr
#ifconfig tck-testbr 2>/dev/null | grep ':10\.1\.2\.'
diff --git a/scripts/networks/networkxml2xmlin/tck-testnet-3.xml b/scripts/networks/networkxml2xmlin/tck-testnet-3.xml
index 9691241..043ae3b 100644
--- a/scripts/networks/networkxml2xmlin/tck-testnet-3.xml
+++ b/scripts/networks/networkxml2xmlin/tck-testnet-3.xml
@@ -10,7 +10,7 @@
<host mac="00:16:3e:3e:a9:1a" name="b.example.com" ip="10.1.2.11" />
</dhcp>
</ip>
- <ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0">
+ <ip family="ipv4" address="192.168.97.1" netmask="255.255.255.0">
</ip>
<ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64">
</ip>
--
2.14.4
6 years, 6 months
[libvirt] [tck PATCH] scripts: shorten netdev/domain name to prevent overflow
by Laine Stump
When new pids are more than 9 digits long
The nwfilter tests use tck-test${pid} as the auto-generated name for
their test domains (and therefore the tap devices created for those
test domains). When the pid is > 9 digits long, the total length of
the name is > 16, which is the maximum length for any network device
name (IFNAMSIZ), and this causes failure to create the tap device,
thus failure of the test:
/home/laine/devel/libvirt-tck/scripts/nwfilter/050-apply-verify-host.t ..
error: Failed to start domain tck-test10513851
error: Network interface name 'tck-test10513851' is too long:
Numerical result out of range
The solution is to just remove "test" from the name template, so pid
can be up to 12 digits long before the test fails.
Signed-off-by: Laine Stump <laine(a)laine.org>
---
scripts/nwfilter/nwfilter2vmtest.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/nwfilter/nwfilter2vmtest.sh b/scripts/nwfilter/nwfilter2vmtest.sh
index ae28b73..778013b 100644
--- a/scripts/nwfilter/nwfilter2vmtest.sh
+++ b/scripts/nwfilter/nwfilter2vmtest.sh
@@ -638,8 +638,8 @@ main() {
cd "${curdir}" || { echo "cd failed" >&2; exit 1; }
fi
- vm1="tck-test$$1"
- vm2="tck-test$$2"
+ vm1="tck-$$1"
+ vm2="tck-$$2"
createTestFilters "${flags}"
if [ $? -ne 0 ]; then
--
2.14.4
6 years, 6 months
[libvirt] [PATCH] news: Add the qemu VM reconnect segfault fix into bugfixes section
by Erik Skultety
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
This is IMHO worth mentioning in the news as it might be forgotten with our
monthly "late news" update right before the release.
docs/news.xml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index e0cf381f33..13001cee5b 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -73,6 +73,17 @@
</change>
</section>
<section title="Bug fixes">
+ <change>
+ <summary>
+ qemu: Fix a potential segmentation fault on VM reconnect
+ </summary>
+ <description>
+ Initialization of the driver worker pool needs to come before libvirtd
+ trying to reconnect to all machines, since one of the QEMU processes
+ migh have already emitted events which need to be handled prior to
+ us getting to the worker pool initialization.
+ </description>
+ </change>
</section>
</release>
<release version="v4.4.0" date="2018-06-04">
--
2.14.4
6 years, 6 months
[libvirt] [PATCH] qemu: Fix segmentation fault on reconnect
by Marc Hartmayer
On start up of libvirtd the worker pool of the QEMU driver must be
initialized before trying to reconnect to all the running QEMU
instances. Otherwise segmentation faults can occur if there are QEMU
monitor events emitted.
#0 __GI___pthread_mutex_lock (mutex=mutex@entry=0x40) at ../nptl/pthread_mutex_lock.c:67
#1 0x000003fffdba9e62 in virMutexLock (m=m@entry=0x40) at ../../src/util/virthread.c:89
#2 0x000003fffdbab2dc in virThreadPoolSendJob (pool=0x0, priority=priority@entry=0, jobData=0x1000b7210) at ../../src/util/virthreadpool.c:386
#3 0x000003ffd8343b70 in qemuProcessHandleSerialChanged (mon=<optimized out>, vm=0x3ff70074340, devAlias=<optimized out>, connected=<optimized out>, opaque=0x3ff70013f70) at ../../src/qemu/qemu_process.c:1480
#4 0x000003ffd836a776 in qemuMonitorEmitSerialChange (mon=mon@entry=0x3ff500013f0, devAlias=devAlias@entry=0x1000b6940 "channel0", connected=<optimized out>) at ../../src/qemu/qemu_monitor.c:1558
#5 0x000003ffd8378e52 in qemuMonitorJSONHandleSerialChange (mon=0x3ff500013f0, data=0x1000b79a0) at ../../src/qemu/qemu_monitor_json.c:1133
#6 0x000003ffd8378930 in qemuMonitorJSONIOProcessEvent (mon=<optimized out>, mon@entry=0x3ff500013f0, obj=obj@entry=0x1000b6780) at ../../src/qemu/qemu_monitor_json.c:182
#7 0x000003ffd837edee in qemuMonitorJSONIOProcessLine (mon=0x3ff500013f0, mon@entry=<error reading variable: value has been optimized out>, line=0x1000b8760 "{\"timestamp\": {\"seconds\": 1528444997, \"microseconds\": 125231}, \"event\": \"VSERPORT_CHANGE\", \"data\": {\"open\": false, \"id\": \"channel0\"}}", msg=0x3ff917f9850, msg@entry=<error reading variable: value has been optimized out>) at ../../src/qemu/qemu_monitor_json.c:211
#8 0x000003ffd837ef86 in qemuMonitorJSONIOProcess (mon=<optimized out>, mon@entry=0x3ff500013f0, data=0x10008c4c0 "{\"return\": [{\"arch\": \"other\", \"current\": true, \"props\": {\"core-id\": 0}, \"CPU\": 0, \"qom_path\": \"/machine/unattached/device[0]\", \"halted\": false, \"thread_id\": 131501}, {\"arch\": \"other\", \"current\": false"..., len=477, msg=<optimized out>, msg@entry=0x3ff917f9850) at ../../src/qemu/qemu_monitor_json.c:253
#9 0x000003ffd836757a in qemuMonitorIOProcess (mon=mon@entry=0x3ff500013f0) at ../../src/qemu/qemu_monitor.c:447
#10 0x000003ffd836863e in qemuMonitorIO (watch=<error reading variable: value has been optimized out>, fd=<optimized out>, events=0, events@entry=<error reading variable: value has been optimized out>, opaque=0x3ff500013f0, opaque@entry=<error reading variable: value has been optimized out>) at ../../src/qemu/qemu_monitor.c:702
#11 0x000003fffdb4033a in virEventPollDispatchHandles (nfds=<optimized out>, fds=0x1000b7160) at ../../src/util/vireventpoll.c:508
#12 0x000003fffdb4055e in virEventPollRunOnce () at ../../src/util/vireventpoll.c:657
#13 0x000003fffdb3e782 in virEventRunDefaultImpl () at ../../src/util/virevent.c:327
#14 0x000003fffdc89400 in virNetDaemonRun (dmn=0x1000b2510) at ../../src/rpc/virnetdaemon.c:850
#15 0x000000010002a816 in main (argc=<optimized out>, argv=<optimized out>) at ../../src/remote/remote_daemon.c:1460
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk(a)linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
src/qemu/qemu_driver.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 971cf3c2750a..28769878cc58 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -932,12 +932,15 @@ qemuStateInitialize(bool privileged,
qemuDomainManagedSaveLoad,
qemu_driver);
- qemuProcessReconnectAll(qemu_driver);
-
+ /* must be initialized before trying to reconnect to all the
+ * running domains since there might occur some QEMU monitor
+ * events that will be dispatched to the worker pool */
qemu_driver->workerPool = virThreadPoolNew(0, 1, 0, qemuProcessEventHandler, qemu_driver);
if (!qemu_driver->workerPool)
goto error;
+ qemuProcessReconnectAll(qemu_driver);
+
virNWFilterRegisterCallbackDriver(&qemuCallbackDriver);
return 0;
--
2.13.4
6 years, 6 months
[libvirt] [jenkins-ci PATCH] Add perl-generators package
by Daniel P. Berrangé
Modern Fedora packaging requires the perl-generators package for
RPM builds.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
guests/vars/mappings.yml | 4 ++++
guests/vars/projects/libvirt-perl.yml | 1 +
guests/vars/projects/libvirt-tck.yml | 1 +
3 files changed, 6 insertions(+)
diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index af026e1..db26c8f 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -520,6 +520,10 @@ mappings:
default: perl
FreeBSD: perl5
+ perl-generators:
+ default:
+ Fedora: perl-generators
+
perl-Archive-Tar:
deb: perl
pkg: perl5
diff --git a/guests/vars/projects/libvirt-perl.yml b/guests/vars/projects/libvirt-perl.yml
index 2eb14f2..d5aa498 100644
--- a/guests/vars/projects/libvirt-perl.yml
+++ b/guests/vars/projects/libvirt-perl.yml
@@ -1,5 +1,6 @@
---
packages:
+ - perl-generators
- perl-Archive-Tar
- perl-CPAN-Changes
- perl-Module-Build
diff --git a/guests/vars/projects/libvirt-tck.yml b/guests/vars/projects/libvirt-tck.yml
index dcccc0f..270e64b 100644
--- a/guests/vars/projects/libvirt-tck.yml
+++ b/guests/vars/projects/libvirt-tck.yml
@@ -1,5 +1,6 @@
---
packages:
+ - perl-generators
- perl-Archive-Tar
- perl-Config-Record
- perl-Digest
--
2.17.0
6 years, 6 months