[PATCH] add the ability to disable transport authentication (like esxi et al)
by simonmartin76
Signed-off-by: Simon Martin <simonmartin76(a)protonmail.com>
---
src/hyperv/hyperv_driver.c | 5 +++++
src/hyperv/hyperv_util.c | 11 +++++++++++
src/hyperv/hyperv_util.h | 1 +
3 files changed, 17 insertions(+)
diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 17f5be1f0d..67e6e09f2d 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -1728,6 +1728,11 @@ hypervInitConnection(virConnectPtr conn, hypervPrivate *priv,
/* FIXME: Currently only basic authentication is supported */
wsman_transport_set_auth_method(priv->client, "basic");
+ if (priv->parsedUri->noVerify) {
+ wsman_transport_set_verify_peer(priv->client, 0);
+ wsman_transport_set_verify_host(priv->client, 0);
+ }
+
return 0;
}
diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c
index d8a6e6cf5c..40e1540dfe 100644
--- a/src/hyperv/hyperv_util.c
+++ b/src/hyperv/hyperv_util.c
@@ -38,6 +38,7 @@ int
hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri)
{
int result = -1;
+ int noVerify;
size_t i;
if (parsedUri == NULL || *parsedUri != NULL) {
@@ -63,6 +64,16 @@ hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri)
(*parsedUri)->transport);
goto cleanup;
}
+ } else if (STRCASEEQ(queryParam->name, "no_verify")) {
+ if (virStrToLong_i(queryParam->value, NULL, 10, &noVerify) < 0 ||
+ (noVerify != 0 && noVerify != 1)) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Query parameter 'no_verify' has unexpected value "
+ "'%s' (should be 0 or 1)"), queryParam->value);
+ goto cleanup;
+ }
+
+ (*parsedUri)->noVerify = noVerify != 0;
} else {
VIR_WARN("Ignoring unexpected query parameter '%s'",
queryParam->name);
diff --git a/src/hyperv/hyperv_util.h b/src/hyperv/hyperv_util.h
index 67d698450d..a0604d6830 100644
--- a/src/hyperv/hyperv_util.h
+++ b/src/hyperv/hyperv_util.h
@@ -28,6 +28,7 @@ typedef struct _hypervParsedUri hypervParsedUri;
struct _hypervParsedUri {
char *transport;
+ bool noVerify;
};
int hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri);
--
2.17.1
Sent with ProtonMail Secure Email.
3 years, 7 months
[libvirt PATCH] qemu_block: fix copy&paste typo in SSH protocol
by Pavel Hrdina
Fixes: caf71b64fe6989116316b966fda119cd3e47f485
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 6845e25176..a972e1e368 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -965,7 +965,7 @@ qemuBlockStorageSourceGetSshProps(virStorageSource *src)
if (src->nhosts != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("sheepdog protocol accepts only one host"));
+ _("ssh protocol accepts only one host"));
return NULL;
}
--
2.30.2
3 years, 7 months
[libvirt PATCH 0/2] introduce 'restrictive' mode in numatune
by Martin Kletzander
Resent patches with some fixes
v5: https://listman.redhat.com/archives/libvir-list/2021-April/msg00450.html
Luyao Zhong (2):
conf, docs, schema: Add support for 'restrictive' mode in numatune
qemu: Add support for 'restrictive' mode in numatune
docs/formatdomain.rst | 7 +++-
docs/schemas/domaincommon.rng | 2 +
include/libvirt/libvirt-domain.h | 1 +
src/conf/numa_conf.c | 9 ++++
src/qemu/qemu_command.c | 6 ++-
src/qemu/qemu_process.c | 32 +++++++++++++++
src/util/virnuma.c | 3 ++
.../numatune-memnode-invalid-mode.err | 1 +
.../numatune-memnode-invalid-mode.xml | 33 +++++++++++++++
...emnode-restrictive-mode.x86_64-latest.args | 38 +++++++++++++++++
.../numatune-memnode-restrictive-mode.xml | 41 +++++++++++++++++++
tests/qemuxml2argvtest.c | 2 +
...memnode-restrictive-mode.x86_64-latest.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
14 files changed, 174 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-invalid-mode.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-invalid-mode.xml
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml
create mode 120000 tests/qemuxml2xmloutdata/numatune-memnode-restrictive-mode.x86_64-latest.xml
--
2.31.1
3 years, 7 months
[PATCH] lxc: Format --handshakefd for controller cmd fully
by Michal Privoznik
The command line argument is called --hanshakefd (check out
lxc_controller.c:main()). But the command line builder puts only
--handshake. This works, because there is no other argument
sharing the prefix.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/lxc/lxc_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index b2a7f105a9..ac635efe7a 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1002,7 +1002,7 @@ virLXCProcessBuildControllerCmd(virLXCDriver *driver,
virCommandAddArgPair(cmd, "--security",
virSecurityManagerGetModel(driver->securityManager));
- virCommandAddArg(cmd, "--handshake");
+ virCommandAddArg(cmd, "--handshakefd");
virCommandAddArgFormat(cmd, "%d", handshakefd);
for (i = 0; veths && veths[i]; i++)
--
2.26.3
3 years, 7 months
[PATCH 00/25] conf: domain: Refactor virDomainDiskDefParseXML
by Peter Krempa
Split out all default setting and validation code into appropriate
functions and convert the XML parser to contemporary helpers.
Peter Krempa (25):
virXMLParseHelper: Add root XML node name validation capability
util: xml: Introduce virXMLParseStringCtxtRoot
conf: domain: Introduce virDomainDiskDefParseSource
qemu: driver: Use virDomainDiskDefParseSource in qemuDomainBlockCopy
conf: domain: Introduce an internal variant of virDomainDiskDefNew
conf: domain: Split out source validation part from
virDomainDiskDefParseValidate
conf: domain: Split out parsing of source data from <disk> XML parser
conf: domain: Remove VIR_DOMAIN_DEF_PARSE_DISK_SOURCE parser flag
virDomainDiskDefValidate: Consolidate conditions
conf: Move code from virDomainDiskDefParseValidate to
virDomainDiskDefValidate
conf: Move disk vendor and product pritability check to
domain_validate
conf: Move checks from virDomainDiskDefPostParse to
virDomainDiskDefValidate
conf: Move disk target 'ioemu:' stripping to virDomainDiskDefPostParse
conf: domain: Introduce VIR_DOMAIN_DISK_BUS_NONE
vmx: Mark CDROM disk elements as read-only
conf: domain: Move default setting from virDomainDiskDefParseXML to
virDomainDiskDefPostParse
conf: domain: Move checks from virDomainDiskDefParseXML to
virDomainDiskDefValidate
conf: domain: Convert virDomainDiskDef's 'removable' to
virTristateSwitch
conf: domain: Convert virDomainDiskDef's 'rawio' to virTristateBool
conf: domain: Convert virDomainDiskDef's 'sgio' to virDomainDeviceSGIO
conf: domain: Convert virDomainDiskDef's 'model' to virDomainDiskModel
conf: domain: Convert virDomainDiskDef's 'snapshot' to unsigned int
conf: domain: Convert virDomainDiskDef's 'bus' to virDomainDiskBus
conf: domain: Convert virDomainDiskDef's 'device' to
virDomainDiskDevice
conf: domain: Refactor virDomainDiskDefParseXML
src/bhyve/bhyve_command.c | 12 +
src/bhyve/bhyve_domain.c | 12 +
src/conf/domain_conf.c | 715 ++++++------------
src/conf/domain_conf.h | 32 +-
src/conf/domain_validate.c | 245 +++++-
src/conf/domain_validate.h | 2 +
src/conf/storage_conf.c | 16 +-
src/hyperv/hyperv_driver.c | 18 +
src/libvirt_private.syms | 1 +
src/libxl/libxl_driver.c | 11 +
src/qemu/qemu_alias.c | 1 +
src/qemu/qemu_command.c | 6 +
src/qemu/qemu_domain_address.c | 1 +
src/qemu/qemu_driver.c | 9 +-
src/qemu/qemu_hotplug.c | 2 +
src/qemu/qemu_validate.c | 3 +
src/util/virxml.c | 18 +-
src/util/virxml.h | 17 +-
src/vbox/vbox_common.c | 1 +
src/vmx/vmx.c | 4 +
src/vz/vz_sdk.c | 22 +-
src/vz/vz_utils.c | 8 +
.../vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 1 +
.../vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 1 +
.../vmx2xml-cdrom-ide-raw-auto-detect.xml | 1 +
.../vmx2xml-cdrom-ide-raw-device.xml | 1 +
.../vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 1 +
.../vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 1 +
.../vmx2xml-cdrom-scsi-passthru.xml | 1 +
.../vmx2xml-cdrom-scsi-raw-auto-detect.xml | 1 +
.../vmx2xml-cdrom-scsi-raw-device.xml | 1 +
.../vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml | 3 +
.../vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml | 1 +
.../vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml | 1 +
.../vmx2xmldata/vmx2xml-esx-in-the-wild-6.xml | 1 +
.../vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml | 1 +
.../vmx2xmldata/vmx2xml-esx-in-the-wild-8.xml | 1 +
.../vmx2xml-fusion-in-the-wild-1.xml | 1 +
.../vmx2xmldata/vmx2xml-ws-in-the-wild-1.xml | 1 +
.../vmx2xmldata/vmx2xml-ws-in-the-wild-2.xml | 1 +
43 files changed, 645 insertions(+), 534 deletions(-)
--
2.30.2
3 years, 7 months
[PATCH 0/3] vircgroup: Fix virCgroupKillRecursive() wrt nested controllers
by Michal Privoznik
See 3/3 for explanation.
Michal Prívozník (3):
vircgroup: Debug print all arguments of
virCgroupKillRecursiveInternal()
vircgroupbackend: Extend error messages in VIR_CGROUP_BACKEND_CALL()
vircgroup: Fix virCgroupKillRecursive() wrt nested controllers
src/util/vircgroup.c | 29 +++++++++++++++++++++++++----
src/util/vircgroupbackend.c | 1 -
src/util/vircgroupbackend.h | 8 ++++++--
src/util/vircgrouppriv.h | 1 -
src/util/vircgroupv1.c | 7 +------
src/util/vircgroupv2.c | 7 +------
6 files changed, 33 insertions(+), 20 deletions(-)
--
2.26.3
3 years, 7 months
[PATCH] cmdDomBlkError: Fix crash when initial call to virDomainGetDiskErrors fails
by Peter Krempa
virDomainGetDiskErrors uses the weird semantics where we make the
caller query for the number of elements and then pass pre-allocated
structure.
The cleanup section errorneously used the 'count' variable to free the
allocated elements for the API but 'count' can be '-1' in cases when the
API returns failure, thus attempting to free beyond the end of the
array.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/155
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tools/virsh-domain-monitor.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 0e49f5da8a..a2bf5c05fc 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -1220,7 +1220,7 @@ cmdDomBlkError(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
virDomainDiskErrorPtr disks = NULL;
- unsigned int ndisks;
+ unsigned int ndisks = 0;
size_t i;
int count;
bool ret = false;
@@ -1230,10 +1230,10 @@ cmdDomBlkError(vshControl *ctl, const vshCmd *cmd)
if ((count = virDomainGetDiskErrors(dom, NULL, 0, 0)) < 0)
goto cleanup;
- ndisks = count;
- if (ndisks) {
- disks = g_new0(virDomainDiskError, ndisks);
+ if (count > 0) {
+ disks = g_new0(virDomainDiskError, count);
+ ndisks = count;
if ((count = virDomainGetDiskErrors(dom, disks, ndisks, 0)) == -1)
goto cleanup;
@@ -1252,7 +1252,7 @@ cmdDomBlkError(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
- for (i = 0; i < count; i++)
+ for (i = 0; i < ndisks; i++)
VIR_FREE(disks[i].disk);
VIR_FREE(disks);
virshDomainFree(dom);
--
2.30.2
3 years, 7 months
Plans for the next release
by Jiri Denemark
We are getting close to the next release of libvirt. To aim for the
release on May 03 I suggest entering the freeze on Tuesday Apr 27 and
tagging RC2 on Thursday Apr 29 in the afternoon.
I hope this works for everyone.
Jirka
3 years, 7 months
[libvirt PATCH 0/3] Fix some memory leaks
by Tim Wiederhake
These memory leaks were found by llvm's address sanitizer asan.
Tim Wiederhake (3):
xenParseHypervisorFeatures: Fix memory leak
virDomainFeaturesDefParse: Fix memory leak
virQEMUCapsSetHostModel: Fix memory leak
src/conf/domain_conf.c | 2 +-
src/libxl/xen_common.c | 1 +
src/qemu/qemu_capabilities.c | 8 ++++++++
3 files changed, 10 insertions(+), 1 deletion(-)
--
2.26.2
3 years, 7 months
[libvirt PATCH] spec: Merge -bash-completion and -admin into -client
by Andrea Bolognani
The former is ridiculously tiny and doesn't have any use on
its own, so it hardly warrants the overhead of an additional
package; the latter is also very small and, just like virsh,
is something that you likely want to have available on any
virtualization host to help with management and debugging
tasks.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
libvirt.spec.in | 28 ++++------------------------
1 file changed, 4 insertions(+), 24 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index f9af330186..80a12a307a 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -901,7 +901,6 @@ Requires: %{name}-libs = %{version}-%{release}
Requires: gettext
# Needed by virt-pki-validate script.
Requires: gnutls-utils
-Requires: %{name}-bash-completion = %{version}-%{release}
%description client
The client binaries needed to access the virtualization
@@ -918,20 +917,6 @@ Requires: cyrus-sasl-gssapi
%description libs
Shared libraries for accessing the libvirt daemon.
-%package admin
-Summary: Set of tools to control libvirt daemon
-Requires: %{name}-libs = %{version}-%{release}
-Requires: %{name}-bash-completion = %{version}-%{release}
-
-%description admin
-The client side utilities to control the libvirt daemon.
-
-%package bash-completion
-Summary: Bash completion script
-
-%description bash-completion
-Bash completion script stub.
-
%if %{with_wireshark}
%package wireshark
Summary: Wireshark dissector plugin for libvirt RPC transactions
@@ -1872,10 +1857,12 @@ exit 0
%files client
%{_mandir}/man1/virsh.1*
+%{_mandir}/man1/virt-admin.1*
%{_mandir}/man1/virt-xml-validate.1*
%{_mandir}/man1/virt-pki-validate.1*
%{_mandir}/man1/virt-host-validate.1*
%{_bindir}/virsh
+%{_bindir}/virt-admin
%{_bindir}/virt-xml-validate
%{_bindir}/virt-pki-validate
%{_bindir}/virt-host-validate
@@ -1886,8 +1873,9 @@ exit 0
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
%endif
+%{_datadir}/bash-completion/completions/vsh
%{_datadir}/bash-completion/completions/virsh
-
+%{_datadir}/bash-completion/completions/virt-admin
%{_unitdir}/libvirt-guests.service
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
@@ -1911,14 +1899,6 @@ exit 0
%{_datadir}/libvirt/test-screenshot.png
-%files admin
-%{_mandir}/man1/virt-admin.1*
-%{_bindir}/virt-admin
-%{_datadir}/bash-completion/completions/virt-admin
-
-%files bash-completion
-%{_datadir}/bash-completion/completions/vsh
-
%if %{with_wireshark}
%files wireshark
%{wireshark_plugindir}/libvirt.so
--
2.26.3
3 years, 7 months