[libvirt] [PATCH 0/4] tests: Tweaks and updates to *-headless and *-graphics
by Andrea Bolognani
*** BLURBY MCBLURBFACE ***
Andrea Bolognani (4):
tests: Normalize quotes for *-graphics
tests: Update *-headless and *-graphics
tests: Add riscv64-virt-graphics
tests: Enable *-headless and *-graphics in qemuxml2xml
.../aarch64-virt-graphics.aarch64-latest.args | 6 +-
.../aarch64-virt-graphics.xml | 52 ++++----
.../aarch64-virt-headless.aarch64-latest.args | 21 +--
.../aarch64-virt-headless.xml | 22 +++-
.../ppc64-pseries-graphics.xml | 49 +++----
.../ppc64-pseries-headless.ppc64-latest.args | 8 +-
.../ppc64-pseries-headless.xml | 18 ++-
...riscv64-virt-graphics.riscv64-latest.args} | 18 ++-
.../riscv64-virt-graphics.xml | 45 +++++++
.../riscv64-virt-headless.riscv64-latest.args | 16 ++-
.../riscv64-virt-headless.xml | 18 ++-
.../s390x-ccw-graphics.s390x-latest.args | 6 +-
tests/qemuxml2argvdata/s390x-ccw-graphics.xml | 49 +++----
.../s390x-ccw-headless.s390x-latest.args | 12 +-
tests/qemuxml2argvdata/s390x-ccw-headless.xml | 21 ++-
tests/qemuxml2argvdata/x86_64-pc-graphics.xml | 57 +++++----
.../x86_64-pc-headless.x86_64-latest.args | 23 ++--
tests/qemuxml2argvdata/x86_64-pc-headless.xml | 30 ++++-
.../qemuxml2argvdata/x86_64-q35-graphics.xml | 57 +++++----
.../x86_64-q35-headless.x86_64-latest.args | 15 ++-
.../qemuxml2argvdata/x86_64-q35-headless.xml | 30 ++++-
tests/qemuxml2argvtest.c | 1 +
.../aarch64-virt-graphics.aarch64-latest.xml | 115 +++++++++++++++++
.../aarch64-virt-headless.aarch64-latest.xml | 101 +++++++++++++++
.../ppc64-pseries-graphics.ppc64-latest.xml | 75 +++++++++++
.../ppc64-pseries-headless.ppc64-latest.xml | 66 ++++++++++
.../riscv64-virt-graphics.riscv64-latest.xml | 109 ++++++++++++++++
.../riscv64-virt-headless.riscv64-latest.xml | 95 ++++++++++++++
.../s390x-ccw-graphics.s390x-latest.xml | 66 ++++++++++
.../s390x-ccw-headless.s390x-latest.xml | 53 ++++++++
.../x86_64-pc-graphics.x86_64-latest.xml | 82 ++++++++++++
.../x86_64-pc-headless.x86_64-latest.xml | 74 +++++++++++
.../x86_64-q35-graphics.x86_64-latest.xml | 120 ++++++++++++++++++
.../x86_64-q35-headless.x86_64-latest.xml | 112 ++++++++++++++++
tests/qemuxml2xmltest.c | 16 +++
35 files changed, 1448 insertions(+), 210 deletions(-)
copy tests/qemuxml2argvdata/{aarch64-virt-graphics.aarch64-latest.args => riscv64-virt-graphics.riscv64-latest.args} (79%)
create mode 100644 tests/qemuxml2argvdata/riscv64-virt-graphics.xml
create mode 100644 tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/ppc64-pseries-graphics.ppc64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/ppc64-pseries-headless.ppc64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/riscv64-virt-graphics.riscv64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/riscv64-virt-headless.riscv64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390x-ccw-graphics.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390x-ccw-headless.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/x86_64-pc-graphics.x86_64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/x86_64-pc-headless.x86_64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/x86_64-q35-graphics.x86_64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/x86_64-q35-headless.x86_64-latest.xml
--
2.21.0
5 years, 5 months
[libvirt] [PATCH libvirt-python] Fix regression in lxcOpenNamespace
by Sergei Turchanov
This fixes regression caused by the 1d39dbaf637db03f6e597ed56b96aa065710b4a1
fdlist[i] erroneously was replaced by fdlist[1] which caused
lxcOpenNamespace to return a list with identical elements.
Signed-off-by: Sergei Turchanov <turchanov(a)farpost.com>
---
libvirt-lxc-override.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-lxc-override.c b/libvirt-lxc-override.c
index 60c2e48..d7af154 100644
--- a/libvirt-lxc-override.c
+++ b/libvirt-lxc-override.c
@@ -83,7 +83,7 @@ libvirt_lxc_virDomainLxcOpenNamespace(PyObject *self ATTRIBUTE_UNUSED,
goto error;
for (i = 0; i < c_retval; i++)
- VIR_PY_LIST_APPEND_GOTO(py_retval, libvirt_intWrap(fdlist[1]), error);
+ VIR_PY_LIST_APPEND_GOTO(py_retval, libvirt_intWrap(fdlist[i]), error);
cleanup:
VIR_FREE(fdlist);
--
2.17.1
5 years, 5 months
[libvirt] [PATCH v2] deprecate -mem-path fallback to anonymous RAM
by Igor Mammedov
Fallback might affect guest or worse whole host performance
or functionality if backing file were used to share guest RAM
with another process.
Patch deprecates fallback so that we could remove it in future
and ensure that QEMU will provide expected behavior and fail if
it can't use user provided backing file.
Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
---
v2:
* improve text language
(Markus Armbruster <armbru(a)redhat.com>)
numa.c | 6 ++++--
qemu-deprecated.texi | 9 +++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/numa.c b/numa.c
index 91a29138a2..c15e53e92d 100644
--- a/numa.c
+++ b/numa.c
@@ -494,8 +494,10 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
if (mem_prealloc) {
exit(1);
}
- error_report("falling back to regular RAM allocation.");
-
+ warn_report("falling back to regular RAM allocation");
+ error_printf("This is deprecated. Make sure that -mem-path "
+ " specified path has sufficient resources to allocate"
+ " -m specified RAM amount or QEMU will fail to start");
/* Legacy behavior: if allocation failed, fall back to
* regular RAM allocation.
*/
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 2fe9b72121..1b7f3b10dc 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -112,6 +112,15 @@ QEMU using implicit generic or board specific splitting rule.
Use @option{memdev} with @var{memory-backend-ram} backend or @option{mem} (if
it's supported by used machine type) to define mapping explictly instead.
+@subsection -mem-path fallback to RAM (since 4.1)
+Currently if guest RAM allocation from file pointed by @option{mem-path}
+fails, QEMU falls back to allocating from RAM, which might result
+in unpredictable behavior since the backing file specified by the user
+is ignored. In the future, users will be responsible for making sure
+the backing storage specified with @option{-mem-path} can actually provide
+the guest RAM configured with @option{-m} and fail to start up if RAM allocation
+is unsuccessful.
+
@section QEMU Machine Protocol (QMP) commands
@subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)
--
2.18.1
5 years, 5 months
[libvirt] [PATCH libvirt-python] Fix regression in lxcOpenNamespace
by Sergei Turchanov
This fixes regression caused by the 1d39dbaf637db03f6e597ed56b96aa065710b4a1
fdlist[i] erroneously was replaced by fdlist[1] which caused
lxcOpenNamespace to return a list with identical elements.
---
libvirt-lxc-override.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-lxc-override.c b/libvirt-lxc-override.c
index 60c2e48..d7af154 100644
--- a/libvirt-lxc-override.c
+++ b/libvirt-lxc-override.c
@@ -83,7 +83,7 @@ libvirt_lxc_virDomainLxcOpenNamespace(PyObject *self ATTRIBUTE_UNUSED,
goto error;
for (i = 0; i < c_retval; i++)
- VIR_PY_LIST_APPEND_GOTO(py_retval, libvirt_intWrap(fdlist[1]), error);
+ VIR_PY_LIST_APPEND_GOTO(py_retval, libvirt_intWrap(fdlist[i]), error);
cleanup:
VIR_FREE(fdlist);
--
2.17.1
5 years, 5 months
[libvirt] [PATCH 00/10] qemu: Refactor disk hotplug code for better reuse with blockdev (blockdev-add saga)
by Peter Krempa
Move around few of the helpers which deal with disk addition and
removal and fix a potential bug in the blockdev media change routine.
The refactors will allow simplify a corner case of using blockdev such
as if the disk frontend is unplugged the backends can be unplugged only
after blockjobs terminate.
This will allow simpler handling of the backing chain data in
conjunction with blockjobs.
To test the blockdev part you can use the new XML namespace element for
qemu:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
[...]
<qemu:capabilities>
<qemu:add capability='blockdev'/>
</qemu:capabilities>
if you have a recent enough qemu.
Peter Krempa (10):
qemu: block: Move and rename qemuHotplugRemoveStorageSourcePrepareData
qemu: hotplug: Handle copy-on-read filter separate from rest of
backing chain
qemu: Introduce new set of helpers for attaching and detaching storage
chains
qemu: command: Use storage chain helpers in commandline generator
qemu: command: Use VIR_AUTO infrastructure in
qemuBuildDiskSourceCommandLine
qemu: command: get rid of 'cleanup' in qemuBuildDiskSourceCommandLine
qemu: hotplug: Use storage chain helpers in
qemuDomainAttachDiskGeneric
qemu: hotplug: Use storage chain helpers in qemuDomainRemoveDiskDevice
qemu: hotplug: qemu: hotplug: Use storage chain helpers in
qemuDomainChangeMediaBlockdev
qemu: hotplug: Remove rest of source backend if hotplug fails
src/qemu/qemu_block.c | 174 +++++++++++++++++++++
src/qemu/qemu_block.h | 33 ++++
src/qemu/qemu_command.c | 132 ++++++++++------
src/qemu/qemu_command.h | 11 ++
src/qemu/qemu_hotplug.c | 332 +++++++---------------------------------
5 files changed, 361 insertions(+), 321 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH] conf: storage: also sanitize source dir
by Ján Tomko
Commit a7fb2258 added sanitization of storage pool target paths,
however source dir paths were left unsanitized.
A netfs pool with:
<source>
<host name='10.20.30.40'/>
<dir path='/nfs/'/>
</source>
will not be correctly detected as mounted by
virStorageBackendFileSystemIsMounted, because it shows up in the
mount list without the trailing slash.
Sanitize the source dir as well.
https://bugzilla.redhat.com/show_bug.cgi?id=1723247
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/storage_conf.c | 5 ++++-
.../storagepoolxml2xmlin/pool-netfs-slash.xml | 20 +++++++++++++++++++
.../pool-netfs-slash.xml | 20 +++++++++++++++++++
tests/storagepoolxml2xmltest.c | 1 +
4 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 tests/storagepoolxml2xmlin/pool-netfs-slash.xml
create mode 100644 tests/storagepoolxml2xmlout/pool-netfs-slash.xml
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 29988c36c4..397bd66870 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -533,6 +533,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
VIR_AUTOFREE(char *) port = NULL;
VIR_AUTOFREE(char *) ver = NULL;
VIR_AUTOFREE(xmlNodePtr *) nodeset = NULL;
+ VIR_AUTOFREE(char *) sourcedir = NULL;
relnode = ctxt->node;
ctxt->node = node;
@@ -630,7 +631,9 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
}
- source->dir = virXPathString("string(./dir/@path)", ctxt);
+ sourcedir = virXPathString("string(./dir/@path)", ctxt);
+ if (sourcedir)
+ source->dir = virFileSanitizePath(sourcedir);
/* In gluster, a missing dir defaults to "/" */
if (!source->dir && pool_type == VIR_STORAGE_POOL_GLUSTER &&
VIR_STRDUP(source->dir, "/") < 0)
diff --git a/tests/storagepoolxml2xmlin/pool-netfs-slash.xml b/tests/storagepoolxml2xmlin/pool-netfs-slash.xml
new file mode 100644
index 0000000000..63f5d401ba
--- /dev/null
+++ b/tests/storagepoolxml2xmlin/pool-netfs-slash.xml
@@ -0,0 +1,20 @@
+<pool type='netfs'>
+ <name>nfsimages</name>
+ <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
+ <capacity>0</capacity>
+ <allocation>0</allocation>
+ <available>0</available>
+ <source>
+ <host name='localhost'/>
+ <dir path='/var/lib/libvirt/images/'/>
+ <format type='nfs'/>
+ </source>
+ <target>
+ <path>/mnt</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>0</owner>
+ <group>0</group>
+ </permissions>
+ </target>
+</pool>
diff --git a/tests/storagepoolxml2xmlout/pool-netfs-slash.xml b/tests/storagepoolxml2xmlout/pool-netfs-slash.xml
new file mode 100644
index 0000000000..8a5f272137
--- /dev/null
+++ b/tests/storagepoolxml2xmlout/pool-netfs-slash.xml
@@ -0,0 +1,20 @@
+<pool type='netfs'>
+ <name>nfsimages</name>
+ <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
+ <capacity unit='bytes'>0</capacity>
+ <allocation unit='bytes'>0</allocation>
+ <available unit='bytes'>0</available>
+ <source>
+ <host name='localhost'/>
+ <dir path='/var/lib/libvirt/images'/>
+ <format type='nfs'/>
+ </source>
+ <target>
+ <path>/mnt</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>0</owner>
+ <group>0</group>
+ </permissions>
+ </target>
+</pool>
diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c
index b6f4cb4226..96dd04faec 100644
--- a/tests/storagepoolxml2xmltest.c
+++ b/tests/storagepoolxml2xmltest.c
@@ -73,6 +73,7 @@ mymain(void)
DO_TEST("pool-iscsi");
DO_TEST("pool-iscsi-auth");
DO_TEST("pool-netfs");
+ DO_TEST("pool-netfs-slash");
DO_TEST("pool-netfs-auto");
DO_TEST("pool-netfs-protocol-ver");
DO_TEST("pool-netfs-gluster");
--
2.20.1
5 years, 5 months
[libvirt] [PATCH 0/3] error: Introdude and use VIR_ERR_DEPRECATED error code
by Peter Krempa
Peter Krempa (3):
error: Add VIR_ERR_DEPRECATED error code
qemu: Use VIR_ERR_DEPRECATED in QemuAttach and DomainXMLFromNative
stubs
news: Mention VIR_ERR_DEPRECATED in improvements
docs/news.xml | 10 ++++++++++
include/libvirt/virterror.h | 1 +
src/qemu/qemu_driver.c | 4 ++--
src/util/virerror.c | 4 ++++
4 files changed, 17 insertions(+), 2 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH 0/3] qemu: Fix handling of 'dir' volumes with disk type='volume'
by Peter Krempa
Peter Krempa (3):
util: storage: Fix virStorageSourceGetActualType if volume was not
translated
qemu: domain: Allow 'VIR_STORAGE_TYPE_VOLUME' disks with 'fat' format
qemu: Supply correct default type for 'dir' based
VIR_STORAGE_TYPE_VOLUME
src/qemu/qemu_domain.c | 13 ++++++++++---
src/util/virstoragefile.c | 12 +++++++++++-
tests/qemuxml2argvdata/disk-source-pool.args | 8 ++++++++
tests/qemuxml2argvdata/disk-source-pool.xml | 16 +++++++++++++++-
tests/qemuxml2xmloutdata/disk-source-pool.xml | 14 ++++++++++++++
5 files changed, 58 insertions(+), 5 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH] qemu: distinguish pr disk before qemuHotplugRemoveManagedPR
by Jie Wang
when a disk without PR perform attach or detach operation,
need not call qemuHotplugRemoveManagedPR, otherwise, it will
print err log about PR, let us fix it.
Signed-off-by: Jie Wang <wangjie88(a)huawei.com>
---
src/qemu/qemu_hotplug.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index efda539..7ef92d0 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -928,7 +928,9 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -2;
- if (qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
+
+ if (virStorageSourceChainHasManagedPR(disk->src) &&
+ qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
ret = -2;
virDomainAuditDisk(vm, NULL, disk->src, "attach", false);
@@ -4481,7 +4483,8 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
dev.data.disk = disk;
ignore_value(qemuRemoveSharedDevice(driver, &dev, vm->def->name));
- if (qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
+ if (virStorageSourceChainHasManagedPR(disk->src) &&
+ qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
goto cleanup;
ret = 0;
--
1.8.3.1
5 years, 5 months