Re: libvirtd: failed to connect to socket after installation

2022-09-08 Thread Peter Krempa
On Thu, Sep 08, 2022 at 11:07:30 -0500, Carlos Bilbao wrote: > Hello, made some progress and I think I see what the issue may be now... > and it looks like virt-install's fault. > > > > Regardless of all that, the client is trying to connect to virtqemud > > > but you seem to have the monolithic

Re: [PATCH 6/6] remote: Don't attempt remote connection from libvirtd

2022-09-08 Thread Daniel P . Berrangé
On Thu, Sep 08, 2022 at 05:53:05PM +0200, Peter Krempa wrote: > On Thu, Sep 08, 2022 at 16:25:39 +0100, Daniel P. Berrangé wrote: > > On Thu, Sep 08, 2022 at 05:16:00PM +0200, Peter Krempa wrote: > > [...] > > > > +#ifdef LIBVIRTD > > > +/* When libvirtd is in use we need to avoid any

Re: [PATCH 6/6] remote: Don't attempt remote connection from libvirtd

2022-09-08 Thread Peter Krempa
On Thu, Sep 08, 2022 at 16:25:39 +0100, Daniel P. Berrangé wrote: > On Thu, Sep 08, 2022 at 05:16:00PM +0200, Peter Krempa wrote: [...] > > +#ifdef LIBVIRTD > > +/* When libvirtd is in use we need to avoid any further delegation of > > the > > + * connection, which can be attempted in

Re: [PATCH 6/6] remote: Don't attempt remote connection from libvirtd

2022-09-08 Thread Daniel P . Berrangé
On Thu, Sep 08, 2022 at 05:16:00PM +0200, Peter Krempa wrote: > When a hypervisor driver is not compiled in and a user enables the > monolithic libvirtd, they get the following misleading error: > > $ virsh -c qemu:///system > error: failed to connect to the hypervisor > error: Failed to

[PATCH 1/6] virConnectOpenInternal: Avoid double free() when alias is an invalid URI

2022-09-08 Thread Peter Krempa
Configuring an URI alias such as uri_aliases = [ "blah=qemu://invaliduri@@@", ] Results in a double free when the alias is used: $ virsh -c blah free(): double free detected in tcache 2 Aborted (core dumped) This happens as the 'alias' variable is first assigned to 'uristr'

[PATCH 5/6] Introduce VIR_CONNECT_NO_REMOTE

2022-09-08 Thread Peter Krempa
Introduce a new virConnectFlags flag that will allow to avoid the use of the 'remote' driver. While this flag itself is not useful for users, in case when monolithic libvirtd is in use we want to avoid further delegation of connection, which can happen if libvirtd is not compiled with the

[PATCH 2/6] virConnectOpenInternal: Switch to automatic memory cleanup

2022-09-08 Thread Peter Krempa
Use automatic cleanup for 'ret' and 'uristr'. Signed-off-by: Peter Krempa --- src/libvirt.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 7e7c0fc8e3..fca38dba40 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -882,9 +882,9

[PATCH 0/6] Fix double free in URI alias lookup and fix misleading error with libvirtd

2022-09-08 Thread Peter Krempa
When libvirtd is built without a driver we report a terrible error message which doesn't really point to what's happening. Peter Krempa (6): virConnectOpenInternal: Avoid double free() when alias is an invalid URI virConnectOpenInternal: Switch to automatic memory cleanup

[PATCH 6/6] remote: Don't attempt remote connection from libvirtd

2022-09-08 Thread Peter Krempa
When a hypervisor driver is not compiled in and a user enables the monolithic libvirtd, they get the following misleading error: $ virsh -c qemu:///system error: failed to connect to the hypervisor error: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or

[PATCH 4/6] remote: remoteOpenConn: Use virConnectOpenAuth instead of virConnectOpen(ReadOnly)

2022-09-08 Thread Peter Krempa
virConnectOpenAuth provides an unified interface with using 'flags' to select the proper mode. Signed-off-by: Peter Krempa --- src/remote/remote_daemon_dispatch.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c

[PATCH 3/6] virConnectOpenInternal: Remove 'failed' label

2022-09-08 Thread Peter Krempa
Jumping to the label would just return NULL. Signed-off-by: Peter Krempa --- src/libvirt.c | 41 +++-- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index fca38dba40..d5ae68d16f 100644 --- a/src/libvirt.c +++

Re: [PATCH 0/5] Various cleanups to decrease amount of stack allocated buffers

2022-09-08 Thread Ján Tomko
On a Thursday in 2022, Peter Krempa wrote: The common theme is the attempt to decrease the use of stack allocated buffers. In few cases it's coupled with outher cleanups too. Most patches are standalone and can be individually applied. The last patch is also optional but can be applied only if

Re: [PATCH 0/8] qemu: Fix regression with non-shared storage migration and clean out more dead code

2022-09-08 Thread Ján Tomko
On a Thursday in 2022, Peter Krempa wrote: Patch 1 fixes regression caused by improper refactor from the pre-blockdev removal series. The rest are cleanups noticed while investigating the code. Peter Krempa (8): qemu: migration: Fix setup of non-shared storage migration in

[PATCH 5/5] build: Decrease maximum stack frame size to 2048

2022-09-08 Thread Peter Krempa
After recent cleanups we can now restrict the maximum stack frame size to 2k. Signed-off-by: Peter Krempa --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ed9f4b3f70..9d3703a321 100644 --- a/meson.build +++ b/meson.build @@

[PATCH 3/5] util: netdev: Dynamically allocate 'struct nlattr' in virNetDevSwitchdevFeature

2022-09-08 Thread Peter Krempa
At time of writing DEVLINK_ATTR_MAX equals to 176, thus the stack'd size of the pointer array is almost 1.4kiB. Allocate it dynamically. Signed-off-by: Peter Krempa --- src/util/virnetdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdev.c

[PATCH 1/5] lxc: virLXCProcessReadLogOutput: Automatically close FD

2022-09-08 Thread Peter Krempa
Switch to 'VIR_AUTOCLOSE' to simplify cleanup. Signed-off-by: Peter Krempa --- src/lxc/lxc_process.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index fe5cab3df6..39dcf53c67 100644 --- a/src/lxc/lxc_process.c

[PATCH 2/5] lxc: process: Rework reading errors from the log file

2022-09-08 Thread Peter Krempa
Introduce 'virLXCProcessReportStartupLogError' which simplifies the error handling on startup of the LXC process when reading of the error log is needed. This function has unusual return value semantics but it helps to make the callers simpler. This patch also removes 2 1k stack'd buffers from

[PATCH 4/5] remote: dispatch: Allocate 'virDomainDef' in ACL helpers dynamically

2022-09-08 Thread Peter Krempa
At time of this patch struct 'virDomainDef' has 1736 bytes. Allocate it dynamically to keep the stack frame size in reasonable values. This patch also fixes remoteRelayDomainQemuMonitorEventCheckACL, where we didn't clear the stack'd variable prior to use. Fortunately for now the code didn't look

[PATCH 0/5] Various cleanups to decrease amount of stack allocated buffers

2022-09-08 Thread Peter Krempa
The common theme is the attempt to decrease the use of stack allocated buffers. In few cases it's coupled with outher cleanups too. Most patches are standalone and can be individually applied. The last patch is also optional but can be applied only if the fixes before that are applied too. Peter

[PATCH 8/8] qemu: monitor: Renumber QEMU_MONITOR_MIGRATE_RESUME

2022-09-08 Thread Peter Krempa
Now that all preceding flags were deleted we can fix the enum value. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index c256e0f5ba..4d770486be 100644 ---

[PATCH 7/8] qemu: migration: Remove QEMU_MONITOR_MIGRATE_BACKGROUND

2022-09-08 Thread Peter Krempa
'qemuMonitorJSONMigrate' is called from: - qemuMonitorMigrateToHost - qemuMonitorMigrateToSocket Both of the above function are called only from qemuMigrationSrcStart. - qemuMonitorMigrateToFd - called from: - qemuMigrationSrcToFile Both instances here pass

[PATCH 4/8] qemu: capabilities: Retire QEMU_CAPS_NBD_SERVER

2022-09-08 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 3 +-- src/qemu/qemu_capabilities.h | 2 +- tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 -

[PATCH 6/8] qemu: monitor: Drop support for old-style non-shared storage migration

2022-09-08 Thread Peter Krempa
Remove the support for enabling the 'blk' and 'inc' parameters of the 'migrate' command as there are no users any more. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.h | 2 -- src/qemu/qemu_monitor_json.c | 4 tests/qemumonitorjsontest.c | 4 +--- 3 files changed, 1

[PATCH 2/8] NEWS: Mention that non-shared storage migration was broken in libvirt-8.7

2022-09-08 Thread Peter Krempa
Signed-off-by: Peter Krempa --- NEWS.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 73d3c0054a..69c5b70c2f 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -27,6 +27,12 @@ v8.8.0 (unreleased) * **Bug fixes** + * qemu: Fix non-shared storage migration setup + +

[PATCH 5/8] qemu: migration: Don't attempt to fall back to old-style storage migration

2022-09-08 Thread Peter Krempa
QEMU supported the NBD server required for the new-style migration for a long time already and when coupled with -blockdev the old style migration doesn't even work, thus remove support for it. This patch modifies the code to check that the destination returned data for the NBD migration and

[PATCH 1/8] qemu: migration: Fix setup of non-shared storage migration in qemuMigrationSrcBeginPhase

2022-09-08 Thread Peter Krempa
In commit 6111b2352242e9 removing pre-blockdev code paths I've improperly refactored the setup of non-shared storage migration. Specifically the code checking that there are disks and setting up the NBD data in the migration cookie was originally outside of the loop checking the user provided

[PATCH 3/8] qemu: migration: Always assume support for QEMU_CAPS_NBD_SERVER

2022-09-08 Thread Peter Krempa
The NBD server (detected via 'nbd-server-start' qmp command) was added to qemu in v1.3 and can't be compiled out. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_migration.c

[PATCH 0/8] qemu: Fix regression with non-shared storage migration and clean out more dead code

2022-09-08 Thread Peter Krempa
Patch 1 fixes regression caused by improper refactor from the pre-blockdev removal series. The rest are cleanups noticed while investigating the code. Peter Krempa (8): qemu: migration: Fix setup of non-shared storage migration in qemuMigrationSrcBeginPhase NEWS: Mention that non-shared

Internal disk-only snapshots in qemu domain

2022-09-08 Thread Or Ozeri
Hi, We are considering the following use-case of libvirt's domain snapshot (and revert) feature: 1. Domain is qemu 2. Snapshot type is disk-only (VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) 3. Snapshot location is internal (VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL) 4. All of the VM disks

kvm ram in live migratiom

2022-09-08 Thread Ignazio Cassano
Hello, I am using openstack rdo with kvm libvirt. Live migration is very slow when the vm is using ram intensively. If I migrate a vm that has been running on a host for a few days, it takes several minutes to migrate the memory. After the first migration, I immediately try another one on the

Re: [PATCH 0/3] domain capabilites improvements

2022-09-08 Thread Peter Krempa
On Wed, Sep 07, 2022 at 15:20:44 -0600, Jim Fehlig wrote: > On 9/6/22 14:42, Jim Fehlig wrote: > > The first two patches add USB redirect and channel devices to > > domcapabilities. Patch3 fixes reporting of spice support. > > > > Patch1 was sent previously, before I noticed the others were