[libvirt PATCH 0/2] rpc: Fix virt-ssh-helper detection
by Andrea Bolognani
See patch 1 for details.
Andrea Bolognani (2):
rpc: Fix virt-ssh-helper detection
news: Mention virt-ssh-helper detection fix
NEWS.rst | 6 ++++++
src/rpc/virnetclient.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
--
2.26.2
4 years
[PATCH v6 0/4] qemu: Support rbd namespace in rbd source name
by Han Han
Diffence from v5:
- conf: implement virStringSplit() to parse the src->path
- tests: Add the cases of path 'pool//image' to
disk-network-rbd-namespace test
- temporarily removed the patch of news
- tweak of version in docs
- rebase to the latest main branch
v5: https://www.redhat.com/archives/libvir-list/2020-September/msg00081.html
git repo: https://gitlab.com/hhan2/libvirt/-/commits/rbd-namespace-v6
Han Han (4):
qemu_capabilities: Add QEMU_CAPS_RBD_NAMESPACE
util: Add member ns to the storage source struct
conf: Support to parse rbd namespace from source name
qemu: Implement rbd namespace to the source name attribute
docs/formatdomain.rst | 16 ++++++
src/conf/domain_conf.c | 47 ++++++++++++++++--
src/qemu/qemu_block.c | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 8 +++
src/util/virstoragefile.c | 2 +
src/util/virstoragefile.h | 1 +
.../caps_5.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 +
.../caps_5.0.0.riscv64.xml | 1 +
.../caps_5.0.0.x86_64.xml | 1 +
.../caps_5.1.0.x86_64.xml | 1 +
.../caps_5.2.0.x86_64.xml | 1 +
...k-network-rbd-namespace.x86_64-latest.args | 48 ++++++++++++++++++
.../disk-network-rbd-namespace.xml | 40 +++++++++++++++
tests/qemuxml2argvtest.c | 1 +
...sk-network-rbd-namespace.x86_64-latest.xml | 49 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
19 files changed, 219 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-network-rbd-namespace.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86_64-latest.xml
--
2.26.2
4 years
[libvirt PATCH v2 00/10] remote: introduce a custom netcat impl for ssh tunnelling
by Daniel P. Berrangé
We have long had a problem with use of netcat for ssh tunnelling because
there's no guarantee the UNIX socket path the client builds will match
the UNIX socket path the remote host uses. We don't even allow session
mode SSH tunnelling for this reason. We also can't easily auto-spawn
libvirtd in session mode.
With the introduction of modular daemons we also have potential for two
completely different UNIX socket paths even for system mode, and the
client can't know which to use.
The solution to all these problems is to introduce a custom netcat impl.
Instead passing the UNIX socket path, we pass the libvirt driver URI.
The custom netcat then decides which socket path to use based on the
remote build host environment.
We still have to support netcat for interoperability with legacy libvirt
versions, but we can default to the new virt-nc.
Daniel P. Berrangé (10):
rpc: merge logic for generating remote SSH shell script
remote: push logic for default netcat binary into common helper
remote: split off enums into separate source file
remote: split out function for parsing URI scheme
remote: parse the remote transport string earlier
remote: split out function for constructing socket path
remote: extract logic for determining daemon to connect to
remote: introduce virt-ssh-helper binary
rpc: switch order of args in virNetClientNewSSH
rpc: use new virt-ssh-helper binary for remote tunnelling
build-aux/syntax-check.mk | 2 +-
docs/uri.html.in | 24 +-
libvirt.spec.in | 2 +
po/POTFILES.in | 2 +
src/libvirt_remote.syms | 1 +
src/remote/Makefile.inc.am | 33 +++
src/remote/remote_driver.c | 323 ++++---------------------
src/remote/remote_sockets.c | 277 +++++++++++++++++++++
src/remote/remote_sockets.h | 70 ++++++
src/remote/remote_ssh_helper.c | 425 +++++++++++++++++++++++++++++++++
src/rpc/virnetclient.c | 166 ++++++++-----
src/rpc/virnetclient.h | 29 ++-
src/rpc/virnetsocket.c | 37 +--
src/rpc/virnetsocket.h | 4 +-
tests/virnetsockettest.c | 12 +-
15 files changed, 1035 insertions(+), 372 deletions(-)
create mode 100644 src/remote/remote_sockets.c
create mode 100644 src/remote/remote_sockets.h
create mode 100644 src/remote/remote_ssh_helper.c
--
2.26.2
4 years
[PATCH 0/6] qemu: Fix cdrom as SCSI hostdev via -blockdev
by Peter Krempa
-drive detects whether a device is a cdrom automatically but we need to
use 'host_cdrom' when using blockdev explicitly. Fix the hostdev code
which was recently converted to -blockdev.
Warning:
I _don't_ have a box with a CDROM handy so this code is not tested in action!
Peter Krempa (6):
qemuProcessCreatePretendCmd: Split up preparation and command building
qemu: hostdev: Prepare definition bits in qemuDomainPrepareHostdev
qemu: Prepare hostdev data which depends on the host state separately
qemuxml2argvmock: Remove mocking of 'virSCSIDeviceGetSgName'
qemu: Detect whether a SCSI hostdev is a cdrom
qemu: Add test cases for 'host_cdrom' blockdev backend via <disk>
src/qemu/qemu_command.c | 33 +-----
src/qemu/qemu_domain.c | 5 +
src/qemu/qemu_driver.c | 65 ++++++++++-
src/qemu/qemu_hotplug.c | 3 +
src/qemu/qemu_process.c | 103 +++++++++++++++---
src/qemu/qemu_process.h | 21 ++--
tests/qemuxml2argvdata/disk-cdrom.args | 4 +-
.../disk-cdrom.x86_64-2.12.0.args | 4 +-
.../disk-cdrom.x86_64-latest.args | 6 +-
tests/qemuxml2argvdata/disk-cdrom.xml | 5 +-
...hostdev-scsi-virtio-scsi.x86_64-2.8.0.args | 3 +
...hostdev-scsi-virtio-scsi.x86_64-4.1.0.args | 3 +
...ostdev-scsi-virtio-scsi.x86_64-latest.args | 4 +
.../hostdev-scsi-virtio-scsi.xml | 8 ++
tests/qemuxml2argvmock.c | 13 ---
tests/qemuxml2argvtest.c | 45 +++++++-
tests/qemuxml2xmloutdata/disk-cdrom.xml | 5 +-
.../hostdev-scsi-virtio-scsi.xml | 8 ++
18 files changed, 252 insertions(+), 86 deletions(-)
--
2.26.2
4 years
[PATCH] qemuMonitorJSONCheckReply: Use g_autofree
by Yi Li
Eliminate cleanup code by using g_autofree.
Signed-off-by: Yi Li <yili(a)winhong.com>
---
src/qemu/qemu_monitor_json.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 26ac499fc5..f76b369191 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -392,10 +392,11 @@ qemuMonitorJSONCheckErrorFull(virJSONValuePtr cmd,
virJSONValuePtr reply,
bool report)
{
+ g_autofree char *cmdstr = virJSONValueToString(cmd, false);
+ g_autofree char *replystr = virJSONValueToString(reply, false);
+
if (virJSONValueObjectHasKey(reply, "error")) {
virJSONValuePtr error = virJSONValueObjectGet(reply, "error");
- g_autofree char *cmdstr = virJSONValueToString(cmd, false);
- g_autofree char *replystr = virJSONValueToString(reply, false);
/* Log the full JSON formatted command & error */
VIR_DEBUG("unable to execute QEMU command %s: %s",
@@ -417,8 +418,6 @@ qemuMonitorJSONCheckErrorFull(virJSONValuePtr cmd,
return -1;
} else if (!virJSONValueObjectHasKey(reply, "return")) {
- g_autofree char *cmdstr = virJSONValueToString(cmd, false);
- g_autofree char *replystr = virJSONValueToString(reply, false);
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
NULLSTR(cmdstr), NULLSTR(replystr));
@@ -455,8 +454,8 @@ qemuMonitorJSONCheckReply(virJSONValuePtr cmd,
data = virJSONValueObjectGet(reply, "return");
if (virJSONValueGetType(data) != type) {
- char *cmdstr = virJSONValueToString(cmd, false);
- char *retstr = virJSONValueToString(data, false);
+ g_autofree char *cmdstr = virJSONValueToString(cmd, false);
+ g_autofree char *retstr = virJSONValueToString(data, false);
VIR_DEBUG("Unexpected return type %d (expecting %d) for command %s: %s",
virJSONValueGetType(data), type, cmdstr, retstr);
@@ -464,8 +463,6 @@ qemuMonitorJSONCheckReply(virJSONValuePtr cmd,
_("unexpected type returned by QEMU command '%s'"),
qemuMonitorJSONCommandName(cmd));
- VIR_FREE(cmdstr);
- VIR_FREE(retstr);
return -1;
}
--
2.25.3
4 years
[PATCH] docs: page.xsl: Improve generation of paragraph anchor links
by Peter Krempa
Use the 'parent' axis to check whether the parent is a div with
class='section' rather than looking for 'toc-backref' anchor to see
whether to generate one of the headerlink alternatives. Both hare
docutils-specific thus apply to docs generated from RST documents.
This adds the links for pages generated from RST documents which don't
have a table of contents (and thus lack the 'toc-backref' anchors) and
thus fixes pages such as hacking.html and news.html to have reasonable
links which can be shared.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Note that whether or not to add table of contents to hacking.rst is out
of scope of this patch.
docs/page.xsl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/page.xsl b/docs/page.xsl
index 36168305fa..07bfc52a4c 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -196,7 +196,7 @@
<xsl:if test="./html:a/@id">
<a class="headerlink" href="#{html:a/@id}" title="Permalink to this headline">¶</a>
</xsl:if>
- <xsl:if test="./html:a[@class='toc-backref']">
+ <xsl:if test="parent::html:div[@class='section']">
<a class="headerlink" href="#{../@id}" title="Permalink to this headline">¶</a>
</xsl:if>
</xsl:element>
--
2.26.2
4 years
[PATCH 0/9] several small cleanups in virpci.c et. al.
by Laine Stump
These started with a couple small cleanups to functions I was going to
change the API for, but then I decided not to change the API, and just
didn't want to waste the effort spent cleaning them up.
Laine Stump (9):
util: simplify virHostdevPCISysfsPath()
util: simplify virPCIFile() and its callers
util: simplify virPCIDriverDir() and its callers
util: simplify virPCIProbeStubDriver()
util: avoid manual VIR_FREE of a g_autofree pointer in virPCIGetName()
util: use more g_autofree in virpci.c
util: remove unneeded cleanup:/ret in virpci.c
util: don't use virPCIGetSysfsFile()
util: remove unused function virPCIGetSysfsFile()
src/hypervisor/virhostdev.c | 10 +--
src/libvirt_private.syms | 1 -
src/util/virnetdev.c | 6 +-
src/util/virpci.c | 146 ++++++++++++------------------------
src/util/virpci.h | 4 -
5 files changed, 53 insertions(+), 114 deletions(-)
--
2.26.2
4 years
[libvirt PATCH] meson: remove non-pkg-config fallback for devmapper
by Daniel P. Berrangé
The fallback for distros which lack pkg-config support for devmapper
references an undefined variable "tmp". It appears non of our supported
build platforms are triggering this bug and so the fallback code can be
removed entirely rather than fixed.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
meson.build | 7 -------
1 file changed, 7 deletions(-)
diff --git a/meson.build b/meson.build
index a17d759702..c3ba34bbe0 100644
--- a/meson.build
+++ b/meson.build
@@ -1020,13 +1020,6 @@ endif
devmapper_version = '1.0.0'
devmapper_dep = dependency('devmapper', version: '>=' + devmapper_version, required: false)
-if not devmapper_dep.found()
- # devmapper is missing pkg-config files in ubuntu, suse, etc
- devmapper_dep = cc.find_library('devmapper', required: false)
- if devmapper_dep.found() and not cc.has_function('dm_task_run', dependencies: tmp)
- devmapper_dep = dependency('', required: false)
- endif
-endif
if devmapper_dep.found()
conf.set('WITH_DEVMAPPER', 1)
endif
--
2.25.4
4 years
[PATCH] qemu: Add test cases for 'host_cdrom' blockdev backend via <disk>
by Peter Krempa
Simulate that the device is a cdrom when the path equals to /dev/cdrom
to provide testing for the 'host_cdrom' backend.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
I've already posted this before but I mistakenly identified is as wrong
and self-NACKed it, but we don't really have a test for a <disk
type=cdrom> backed by a host device, so this patch makes sense.
tests/qemuxml2argvdata/disk-cdrom.args | 4 ++--
tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args | 4 ++--
tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args | 6 +++---
tests/qemuxml2argvdata/disk-cdrom.xml | 5 +++--
tests/qemuxml2argvtest.c | 11 +++++++++++
tests/qemuxml2xmloutdata/disk-cdrom.xml | 5 +++--
6 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/tests/qemuxml2argvdata/disk-cdrom.args b/tests/qemuxml2argvdata/disk-cdrom.args
index cbac368129..e506a4befe 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.args
+++ b/tests/qemuxml2argvdata/disk-cdrom.args
@@ -25,8 +25,8 @@ server,nowait \
-no-shutdown \
-no-acpi \
-usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-0-0,readonly=on \
+-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file=/root/boot.iso,format=raw,if=none,id=drive-ide0-0-1,readonly=on \
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
-drive if=none,id=drive-ide0-1-0,readonly=on \
diff --git a/tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args b/tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args
index 2440acc78a..0621746a3b 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args
+++ b/tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args
@@ -27,8 +27,8 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-0-0,readonly=on \
+-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file=/root/boot.iso,format=raw,if=none,id=drive-ide0-0-1,readonly=on \
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
-drive if=none,id=drive-ide0-1-0,readonly=on \
diff --git a/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args b/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args
index 0d375ffd1c..beac75ec1d 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args
@@ -29,11 +29,11 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
--blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\
+-blockdev '{"driver":"host_cdrom","filename":"/dev/cdrom",\
"node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"raw",\
+-blockdev '{"node-name":"libvirt-4-format","read-only":true,"driver":"raw",\
"file":"libvirt-4-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-4-format,id=ide0-0-0,bootindex=1 \
+-device ide-cd,bus=ide.0,unit=0,drive=libvirt-4-format,id=ide0-0-0 \
-blockdev '{"driver":"file","filename":"/root/boot.iso",\
"node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw",\
diff --git a/tests/qemuxml2argvdata/disk-cdrom.xml b/tests/qemuxml2argvdata/disk-cdrom.xml
index b051b16642..54d2927ac3 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.xml
+++ b/tests/qemuxml2argvdata/disk-cdrom.xml
@@ -14,10 +14,11 @@
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-i386</emulator>
- <disk type='block' device='disk'>
+ <disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
- <source dev='/dev/HostVG/QEMUGuest1'/>
+ <source dev='/dev/cdrom'/>
<target dev='hda' bus='ide'/>
+ <readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c5a0095e0d..ef8a871a19 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -407,6 +407,17 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
VIR_QEMU_PROCESS_START_COLD) < 0)
return NULL;
+ for (i = 0; i < vm->def->ndisks; i++) {
+ virDomainDiskDefPtr disk = vm->def->disks[i];
+
+ /* host cdrom requires special treatment in qemu, mock it */
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
+ disk->src->format == VIR_STORAGE_FILE_RAW &&
+ virStorageSourceIsBlockLocal(disk->src) &&
+ STREQ(disk->src->path, "/dev/cdrom"))
+ disk->src->hostcdrom = true;
+ }
+
for (i = 0; i < vm->def->nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i];
diff --git a/tests/qemuxml2xmloutdata/disk-cdrom.xml b/tests/qemuxml2xmloutdata/disk-cdrom.xml
index 3e6475c276..3a8c34761d 100644
--- a/tests/qemuxml2xmloutdata/disk-cdrom.xml
+++ b/tests/qemuxml2xmloutdata/disk-cdrom.xml
@@ -14,10 +14,11 @@
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-i386</emulator>
- <disk type='block' device='disk'>
+ <disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
- <source dev='/dev/HostVG/QEMUGuest1'/>
+ <source dev='/dev/cdrom'/>
<target dev='hda' bus='ide'/>
+ <readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
--
2.26.2
4 years
[PATCH 0/1] virt-aa-helper: allow hard links for mounts
by Christian Schoenebeck
I'm suggesting to add the AppArmor permission "l" on libvirt export pathes
to allow guests creating hard links, which is currently a problem for 9pfs
mounts.
Since the suggested patch would affect virtiofs as well, I would ask David
and Stefan for feedback. If necessary I would change the patch to exclude
virtiofs from this change.
Christian Schoenebeck (1):
virt-aa-helper: allow hard links for mounts
src/security/virt-aa-helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.20.1
4 years