[libvirt] [PATCH 1/1] tests/virsh-checkpoint/snapshot: changing 'sed' out filtering
by Daniel Henrique Barboza
There is a chance that the current sed filtering used in
these new tests might fail in some machines due to the
repetition of the 'virsh #' prompt at the same line,
together with valid output that shouldn't be filtered.
This is output of virsh-snapshot test in my T480 dev box:
./virsh-snapshot
--- exp 2019-07-31 18:42:31.107399428 -0300
+++ out.cooked 2019-07-31 18:42:31.108399437 -0300
@@ -1,8 +1,3 @@
-
-
-Domain snapshot s3 created from 's3.xml'
-Domain snapshot s2 created from 's2.xml'
-Name: s2
Domain: test
Current: yes
State: running
There are 3 valid lines missing. This is the unfiltered output:
=== out ===
Welcome to lt-virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # virsh #
virsh #
virsh # virsh # Domain snapshot s3 created from 's3.xml'
virsh # Domain snapshot s2 created from 's2.xml'
virsh # Name: s2
Domain: test
Current: yes
State: running
Location: internal
Parent: s3
Children: 0
Descendants: 0
Metadata: yes
virsh #
============
We can see that the 3 lines being erased are being followed
by the 'virsh #' prompt and the filtering is erasing those.
A similar situation happens with virsh-checkpoint as well.
This patch makes the 'sed' filtering less elegant and more crude
than the current version, but more reliable to these outputs
that may vary from each dev machine. We're also removing
the blank lines in the expected output to make it less
prone to errors as well.
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
Eric, feel free to accept this patch, tweak it, discard it and
try something else or whatever. I was going to send the
commit msg as a reply to your query in the ML, then realized
that I might as well propose a fix for it.
tests/virsh-checkpoint | 6 +-----
tests/virsh-snapshot | 6 ++----
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/tests/virsh-checkpoint b/tests/virsh-checkpoint
index 75bdc293be..a3cad74f74 100755
--- a/tests/virsh-checkpoint
+++ b/tests/virsh-checkpoint
@@ -152,20 +152,16 @@ $abs_top_builddir/tools/virsh -c test:///default >out 2>err <<EOF || fail=1
EOF
cat <<\EOF > exp || fail=1
-
-
Domain checkpoint c3 created from 'c3.xml'
Domain checkpoint c2 created from 'c2.xml'
c2
-
Name: c2
Domain: test
Parent: c3
Children: 0
Descendants: 0
-
EOF
-sed '1,/^virsh #/d; /virsh #/d' < out > out.cooked || fail=1
+sed '1,/^virsh #/d; s/virsh #\s//g; /^$/d' < out > out.cooked || fail=1
compare exp out.cooked || fail=1
cat <<EOF > exp || fail=1
diff --git a/tests/virsh-snapshot b/tests/virsh-snapshot
index 20ff966a51..874093ea3c 100755
--- a/tests/virsh-snapshot
+++ b/tests/virsh-snapshot
@@ -201,9 +201,8 @@ $abs_top_builddir/tools/virsh -c test:///default >out 2>err <<EOF || fail=1
snapshot-info test --current
EOF
-cat <<\EOF > exp || fail=1
-
+cat <<\EOF > exp || fail=1
Domain snapshot s3 created from 's3.xml'
Domain snapshot s2 created from 's2.xml'
Name: s2
@@ -215,9 +214,8 @@ Parent: s3
Children: 0
Descendants: 0
Metadata: yes
-
EOF
-sed '1,/^virsh #/d; /virsh #/d' < out > out.cooked || fail=1
+sed '1,/^virsh #/d; s/virsh #\s//g; /^$/d' < out > out.cooked || fail=1
compare exp out.cooked || fail=1
cat <<EOF > exp || fail=1
--
2.21.0
5 years, 9 months
[libvirt] [PATCH] RFC: security: Make sure to decrease ref count label value
by Stefan Berger
I noticed that if a domain fails to restore, the ref count in the xattr
'trusted.libvirt.security.ref_selinux' keeps on increasing indefinitely
and the VM will never restore even if the root cause for the restore
failure has been removed. The reason seems to be that the code to decrease
the ref count never gets called because the block above it fails due
to virSecuritySELinuxTransactionAppend() failing. The simple solution
seems to be to revert the order in which things are done.
Signed-off-by: Stefan Berger <stefanb(a)linux.ibm.com>
---
src/security/security_selinux.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index ea20373a90..9fd29e9bca 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1499,14 +1499,9 @@ virSecuritySELinuxRestoreFileLabel(virSecurityManagerPtr mgr,
goto cleanup;
}
- if ((rc = virSecuritySELinuxTransactionAppend(path, NULL,
- false, recall, true)) < 0) {
- goto cleanup;
- } else if (rc > 0) {
- ret = 0;
- goto cleanup;
- }
-
+ /* Recall the label so the ref count label decreases its counter
+ * even if transaction append below fails.
+ */
if (recall) {
rc = virSecuritySELinuxRecallLabel(newpath, &fcon);
if (rc == -2) {
@@ -1519,6 +1514,14 @@ virSecuritySELinuxRestoreFileLabel(virSecurityManagerPtr mgr,
}
}
+ if ((rc = virSecuritySELinuxTransactionAppend(path, NULL,
+ false, recall, true)) < 0) {
+ goto cleanup;
+ } else if (rc > 0) {
+ ret = 0;
+ goto cleanup;
+ }
+
if (!recall || rc == -2) {
if (stat(newpath, &buf) != 0) {
VIR_WARN("cannot stat %s: %s", newpath,
--
2.20.1
5 years, 9 months
[libvirt] [PATCH] news: add entry for new max_threads_per_process option in qemu.conf
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
docs/news.xml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 82a4ec9c84..3a20f95a0d 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -74,6 +74,17 @@
which portions of a disk have changed since a point in time.
</description>
</change>
+ <change>
+ <summary>
+ qemu: Add support for overriding max threads per process limit
+ </summary>
+ <description>
+ systemd-based systems impose a limit on the number of threads a
+ process can spawn, which in some cases can be exceeded by qemu
+ processes running VMs. Add a <code>max_threads_per_process</code>
+ option to qemu.conf to override the system default.
+ </description>
+ </change>
</section>
<section title="Removed features">
<change>
--
2.22.0
5 years, 9 months
[libvirt] [jenkins-ci PATCH 0/6] Update libosinfo (& friends) dependencies
by Fabiano Fidêncio
libsoup & mingw-libsoup are new dependencies for both libosinfo &
osinfo-db-tools since v1.6.0 release
libcurl & mingw-curl are no longer a dependency for libosinfo since
v1.5.0 release
Fabiano Fidêncio (6):
mappings: Add mingw*-libsoup
mingw*-libosinfo: Add mingw*-libsoup as dependency
mingw*-osinfo-db-tools: Add mingw*-libsoup as dependency
osinfo-db-tools: Add libsoup as dependency
mingw*-libosinfo: Remove mingw*-curl dependency
ibosinfo: Remove libcurl dependency
guests/vars/mappings.yml | 6 ++++++
guests/vars/projects/libosinfo+mingw32.yml | 2 +-
guests/vars/projects/libosinfo+mingw64.yml | 2 +-
guests/vars/projects/libosinfo.yml | 1 -
guests/vars/projects/osinfo-db-tools+mingw32.yml | 1 +
guests/vars/projects/osinfo-db-tools+mingw64.yml | 1 +
guests/vars/projects/osinfo-db-tools.yml | 1 +
7 files changed, 11 insertions(+), 3 deletions(-)
--
2.21.0
5 years, 9 months
[libvirt] [PATCH v2 0/3] misc virhostdevs cleanups
by Daniel Henrique Barboza
changes in v2:
- changed the parameter order in the function calls
- gave up on moving virPCIDeviceSetX(pci, true) calls to
virPCIDeviceReattach(). The attributes being set changes
the behavior of virPCIDeviceReattach() in a more complex
way than I expected. I still believe a simplification
can be done there, but it became out of scope for a more
simplistic cleanup such as this one.
These are cleanups that I made together with an attempt to
enable parcial PCI Multifunction assignment with managed=true.
That work will be scrapped after discussions with Laine in
[1], but these cleanups kind of make sense on their own, so
here they are.
[1] https://www.redhat.com/archives/libvir-list/2019-July/msg01175.html
*** BLURB HERE ***
Daniel Henrique Barboza (3):
virhostdev: introduce virHostdevResetAllPCIDevices
virhostdev: remove virHostdevReattachPCIDevice
virhostdev: introduce virHostdevReattachAllPCIDevices
src/util/virhostdev.c | 148 +++++++++++++++++-------------------------
src/util/virpci.c | 14 ++++
2 files changed, 75 insertions(+), 87 deletions(-)
--
2.21.0
5 years, 9 months
[libvirt] [PATCH] backup: Add news entry for checkpoints
by Eric Blake
Checkpoints are definitely a news-worthy addition, even if the
virDomainBackup API is not going to make it until a later release.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
docs/news.xml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 1134309ec2..c7ac960523 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -63,6 +63,17 @@
<code>bochs-display</code> device that was added in qemu version 3.0.
</description>
</change>
+ <change>
+ <summary>
+ api: new virDomainCheckpoint APIs
+ </summary>
+ <description>
+ Introduce several new APIs for creating and managing
+ checkpoints in the test and qemu drivers (the latter
+ requires qcow2 images). Checkpoints serve as a way to tell
+ which portions of a disk have changed since a point in time.
+ </description>
+ </change>
</section>
<section title="Removed features">
<change>
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/6] Relax PCI domain limitation
by Michal Privoznik
As reported here [1], a PCI domain can be just any number. Well, not in
case of traditional 32-bit PCI, bit in case of PCI-X (64-bit PCI; not to
be confused with PCI Express), the PCI domain number can really be just
anything. I wanted to download the specification from PCI SIG web but
it's paid (why on earth would somebody create a standard and then make
it not widely available is beyond me).
1: https://www.redhat.com/archives/libvir-list/2019-July/msg01732.html
Michal Prívozník (6):
qemuBuildPCIHostdevDevStr: Always format PCI domain onto cmd line
virPCIDeviceNew: Prefer VIR_RETURN_PTR
virPCIDevice: Make @name dynamically allocated
lib: Unify PCI address formatting
lib: Format PCI address differently
virpci: Allow greater PCI domain value in virPCIDeviceAddressIsValid
docs/schemas/basictypes.rng | 2 +-
src/conf/device_conf.c | 4 +-
src/conf/domain_addr.c | 10 ++--
src/conf/domain_audit.c | 3 +-
src/conf/domain_conf.c | 12 ++---
src/conf/node_device_conf.c | 12 ++---
src/libxl/libxl_driver.c | 14 +++--
src/qemu/qemu_command.c | 9 ++--
src/qemu/qemu_hotplug.c | 5 +-
src/util/virpci.c | 52 +++++++++----------
src/util/virpci.h | 2 +
.../hostdev-pci-address-device.args | 2 +-
.../qemuxml2argvdata/hostdev-pci-address.args | 2 +-
.../hostdev-vfio-zpci-autogenerate.args | 2 +-
.../hostdev-vfio-zpci-boundaries.args | 2 +-
tests/qemuxml2argvdata/hostdev-vfio-zpci.args | 2 +-
tests/qemuxml2argvdata/hostdev-vfio.args | 2 +-
.../net-hostdev-bootorder.args | 3 +-
tests/qemuxml2argvdata/net-hostdev-vfio.args | 2 +-
tests/qemuxml2argvdata/net-hostdev.args | 2 +-
tests/qemuxml2argvdata/pci-domain-invalid.xml | 2 +-
tests/qemuxml2argvdata/pci-rom.args | 4 +-
tools/virsh-domain.c | 4 +-
23 files changed, 81 insertions(+), 73 deletions(-)
--
2.21.0
5 years, 9 months
[libvirt] PCI domain space need be enlarge to support domain great than FFFF
by Changlimin
For some servers, PCI domain is great than FFFF
# lspci
10000:00:00.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port A (rev 04)
10000:00:01.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port B (rev 04)
10000:00:02.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port C (rev 04)
10000:00:03.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port D (rev 04)
10000:01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961
10000:02:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961
So some code need to match the larger domain.
#define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */
snprintf(dev->name, sizeof(dev->name), "%.4x:%.2x:%.2x.%.1x",
domain, bus, slot, function)
if (addr->domain > 0xFFFF) {
5 years, 9 months