Re: [PATCH v4 14/14] kbase: Document virtio-mem

2021-06-23 Thread Jim Fehlig
On 6/23/21 4:12 AM, Michal Privoznik wrote: This commit adds new memorydevices.rst page which should serve all models of memory devices. Yet, I'm documenting virtio-mem quirks only. Signed-off-by: Michal Privoznik --- docs/kbase/index.rst | 4 + docs/kbase/memorydevices.rst | 150

Re: [PATCH V2 0/4] Apparmor: Add profiles for hypervisor daemons

2021-06-23 Thread Christian Boltz
Hello, [I'm not subscribed to libvir-list - please CC me in replies] Am Mittwoch, 23. Juni 2021, 01:27:43 CEST schrieb Jim Fehlig: > and other improvements. V2 of > https://listman.redhat.com/archives/libvir-list/2021-June/msg00456.htm > > Changes since V1: > Removed many unneeded capabilities.

Re: [libvirt PATCH 6/7] nodedev: Implement virNodeDeviceIsPersistent()/IsActive()

2021-06-23 Thread Jonathon Jongsma
On Wed, Jun 16, 2021 at 8:30 AM Boris Fiuczynski wrote: > > On 6/14/21 10:46 PM, Jonathon Jongsma wrote: > > On Mon, Jun 14, 2021 at 12:27 PM Boris Fiuczynski > > wrote: > >> > >> On 6/3/21 10:11 PM, Jonathon Jongsma wrote: > >>> Implement these new API functions in the nodedev driver. > >>> >

[PATCH v2 3/4] conf: introduce dirty_ring_size in struct "_virDomainDef"

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) introduce dirty_ring_size to hold the ring size configured by user, and pass dirty_ring_size when building qemu commandline if dirty ring feature enabled. Signed-off-by: Hyman Huang(黄勇) --- src/conf/domain_conf.c | 78 +

[PATCH v2 4/4] qemu: support dirty ring feature

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) QEMU has introduced a dirty ring feature, this patch add corresponding feature named 'dirty-ring', which enable dirty ring feature when starting vm. to enable the feature, libvirt add "-accel dirty-ring-size=xxx" to QEMU command line, the following XML needs to be added to

[PATCH v2 2/4] qemu_command: switch accelerator option to new style

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) QEMU greater than 2.9.0 support '-accel' option, change the way of assembling commandline from "accel=kvm" to "-accel kvm" when specifying accelerator. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_command.c| 31 +-

[PATCH v2 1/4] qemu_capabilities: introduce QEMU_CAPS_ACCEL

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) since the "-machine" option for accelerators is legacy, "-accel" option may be a better mechanism. following are details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ this patch introduce QEMU_CAPS_ACCEL capability to tell if we're

[PATCH v2 0/4] Ring support (Libvirt)

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) v2 - split patchset into 4 patches - leave out the tcg case when building commandline. - handle the VIR_DOMAIN_KVM_DIRTY_RING case independently in , virDomainFeatureDefParse and virDomainDefFeaturesCheckABIStability, do not integrate it with other cases... - add

Re: [PATCH] build: fix logic for enabling libssh/libssh2 checks

2021-06-23 Thread Pavel Hrdina
On Wed, Jun 23, 2021 at 12:33:55PM +0100, Daniel P. Berrangé wrote: > When 'driver_remote' is 'auto', the 'enabled()' method does not > evaluate to true, causing the libssh/libssh2 checks to be skipped. > > Signed-off-by: Daniel P. Berrangé > --- > meson.build | 4 ++-- > 1 file changed, 2

Re: [PATCH] rpc: prefer SHA256 host key fingerprint with new libssh

2021-06-23 Thread Pavel Hrdina
On Wed, Jun 23, 2021 at 12:31:37PM +0100, Daniel P. Berrangé wrote: > The host key fingerprint for SSH servers is used in a scenario where > cryptographic strength is important. We should thus be defaulting to > use of SHA256 where available. We only need SHA1 for Ubuntu 18.04 > which does not

Re: [PATCH v2] ci: Also perform package upgrades on macOS and FreeBSD

2021-06-23 Thread Andrea Bolognani
On Wed, Jun 23, 2021 at 02:29:59PM +0200, Martin Kletzander wrote: > The base OS image might include outdated contents, and we don't > want to get spurious failures caused by bugs that have already been > fixed in the respective packages. > > This is particularly important on macOS, because 'brew

Re: [libvirt PATCH v2 5/5] nodedev: improve error message when destroying an inactive device

2021-06-23 Thread Boris Fiuczynski
On 6/22/21 9:53 PM, Jonathon Jongsma wrote: When trying to destroy a node device that is not active, we end up with a confusing error message: # nodedev-destroy mdev_88a6b868_46bd_4015_8e5b_26107f82da38 error: Failed to destroy node device 'mdev_88a6b868_46bd_4015_8e5b_26107f82da38'

Re: [libvirt PATCH v2 4/5] nodedev: handle mdevctl errors consistently

2021-06-23 Thread Boris Fiuczynski
On 6/22/21 9:53 PM, Jonathon Jongsma wrote: Currently, we have three different types of mdevctl errors: 1. the command cannot be constructed ecause of unsatisfied preconditions 2. the command cannot be executed due to some error 3. the command is executed, but returns an error status

Re: [libvirt PATCH v2 3/5] nodedev: add macro to handle command errors

2021-06-23 Thread Boris Fiuczynski
On 6/22/21 9:53 PM, Jonathon Jongsma wrote: This macro will be utilized in the following patch. Since mdevctl commands can fail with or without an error message, this macro makes it easy to print a fallback error in the case that the error message is not set. Signed-off-by: Jonathon Jongsma

Re: [libvirt PATCH v2 2/5] nodedev: Handle NULL command variable

2021-06-23 Thread Boris Fiuczynski
On 6/22/21 9:53 PM, Jonathon Jongsma wrote: In commit 68580a51, I removed the checks for NULL cmd variables because virCommandRun() already handles the case where it is called with a NULL cmd. Unfortunately, it handles this case by raising a generic error which is both unhelpful and overwrites

Re: [libvirt PATCH v2 1/5] nodedev: Remove useless device name from error message

2021-06-23 Thread Boris Fiuczynski
On 6/22/21 9:53 PM, Jonathon Jongsma wrote: At the point where the error message is emitted, the field def->name is still set to "new device", so the error message becomes: Unable to start mediated device 'new device': ... Since the name doesn't contain anything useful, just omit it from

Re: [PATCH v2] ui: Make the DisplayType enum entries conditional

2021-06-23 Thread Gerd Hoffmann
On Tue, Jun 15, 2021 at 11:04:39AM +0200, Thomas Huth wrote: > Libvirt's "domcapabilities" command has a way to state whether certain > graphic frontends are available in QEMU or not. Originally, libvirt > looked at the "--help" output of the QEMU binary to determine whether > SDL was available or

[PATCH v2] ci: Also perform package upgrades on macOS and FreeBSD

2021-06-23 Thread Martin Kletzander
The base OS image might include outdated contents, and we don't want to get spurious failures caused by bugs that have already been fixed in the respective packages. This is particularly important on macOS, because 'brew install foo' will fail if 'foo' is already installed but outdated: upgrading

Re: [PATCH] ci: Also perform `brew upgrade` on MacOS

2021-06-23 Thread Andrea Bolognani
On Wed, Jun 23, 2021 at 12:38:00PM +0200, Martin Kletzander wrote: > On Wed, Jun 23, 2021 at 02:46:18AM -0700, Andrea Bolognani wrote: > > On Tue, Jun 22, 2021 at 12:50:33PM +0200, Martin Kletzander wrote: > > > Are you suggesting that I add the `pkg upgrade -y` to FreeBSDs as well > > > here? > >

Re: [libvirt PATCH 00/16] Refactor virDomainFeaturesDefParse

2021-06-23 Thread Michal Prívozník
On 6/22/21 2:22 PM, Tim Wiederhake wrote: > Some refactoring in preparation for adding support for qemu's > "hv-passthrough" and the yet-to-be-merged "hv-defaults". > > Tim Wiederhake (16): > virDomainFeaturesDefParse: Factor out HyperV parsing into separate > function >

[PATCH] build: fix logic for enabling libssh/libssh2 checks

2021-06-23 Thread Daniel P . Berrangé
When 'driver_remote' is 'auto', the 'enabled()' method does not evaluate to true, causing the libssh/libssh2 checks to be skipped. Signed-off-by: Daniel P. Berrangé --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index

[PATCH] rpc: prefer SHA256 host key fingerprint with new libssh

2021-06-23 Thread Daniel P . Berrangé
The host key fingerprint for SSH servers is used in a scenario where cryptographic strength is important. We should thus be defaulting to use of SHA256 where available. We only need SHA1 for Ubuntu 18.04 which does not have libssh >= 0.8.1 Signed-off-by: Daniel P. Berrangé ---

Re: [libvirt PATCH 2/3] qemu: wait more for virtiofsd to exit

2021-06-23 Thread Jano Tomko
On 6/21/21 4:53 AM, Masayoshi Mizuma wrote: > On Fri, Jun 18, 2021 at 01:45:18PM +0200, Ján Tomko wrote: >> In some cases, such as doing intense I/O on slow filesystems, >> it can take virtiofsd as long as 42 seconds to exit. >> >> Add a delay of extra 45 seconds before we forcefully kill it. >>

Re: [PATCH] ci: Also perform `brew upgrade` on MacOS

2021-06-23 Thread Martin Kletzander
On Wed, Jun 23, 2021 at 02:46:18AM -0700, Andrea Bolognani wrote: On Tue, Jun 22, 2021 at 12:50:33PM +0200, Martin Kletzander wrote: On Wed, Jun 16, 2021 at 06:21:00AM -0700, Andrea Bolognani wrote: > On Tue, Jun 15, 2021 at 12:43:39PM +0200, Martin Kletzander wrote: > > ci: Also perform `brew

[PATCH v4 12/14] virsh: Introduce update-memory-device command

2021-06-23 Thread Michal Privoznik
New 'update-memory-device' command is introduced which aims on making it user friendly to change device. So far I just need to change so I'm introducing --requested-size only; but the idea is that this is extensible for other cases too. For instance, want to change ? A new --my-element argument

[PATCH v4 11/14] qemuDomainSetMemoryFlags: Take virtio-mem into consideration

2021-06-23 Thread Michal Privoznik
The qemuDomainSetMemoryFlags() allows for memballoon () changes for both active and inactive guests. And just before doing any change, we have to make sure that the new size is not greater than the total memory (). However, the total memory includes not only the regular guest memory, but also sum

[PATCH v4 14/14] kbase: Document virtio-mem

2021-06-23 Thread Michal Privoznik
This commit adds new memorydevices.rst page which should serve all models of memory devices. Yet, I'm documenting virtio-mem quirks only. Signed-off-by: Michal Privoznik --- docs/kbase/index.rst | 4 + docs/kbase/memorydevices.rst | 150 +++

[PATCH v4 10/14] qemu: Account for both memballoon and virtio-mem

2021-06-23 Thread Michal Privoznik
Reporting how much memory is exposed to the guest happens under which is taken from def->mem.cur_balloon. The reported amount should account for both balloon size and the sum of @actualsize of all virtio-mems. For instance, if domain has 4GiB via balloon and additional 2GiB via virtio-mem, then

[PATCH v4 13/14] news: document recent virtio memory addition

2021-06-23 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 12 1 file changed, 12 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 2c7180cb95..3cb4289784 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -8,6 +8,18 @@ the changes introduced by each of them. For a more fine-grained view, use the

[PATCH v4 08/14] qemu: Wire up MEMORY_DEVICE_SIZE_CHANGE event

2021-06-23 Thread Michal Privoznik
As advertised in previous commit, this event is delivered to us when virtio-mem module changes the allocation inside the guest. It comes with one attribute - size - which holds the new size of the virtio-mem (well, allocated size), in bytes. Mind you, this is not necessarily the same number as

[PATCH v4 09/14] qemu: Refresh the actual size of virtio-mem on monitor reconnect

2021-06-23 Thread Michal Privoznik
If the QEMU driver restarts it loses the track of the actual size of virtio-mem (because it's runtime type of information and thus not stored in XML) and therefore, we have to refresh it when reconnecting to the domain monitor. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa ---

[PATCH v4 07/14] conf: Introduce virDomainMemoryFindByDeviceAlias()

2021-06-23 Thread Michal Privoznik
This function will be needed in the next commit where we will want to find virtio-mem given its alias by QEMU on the monitor. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 17 + src/conf/domain_conf.h | 5 + src/libvirt_private.syms | 1 + 3 files

[PATCH v4 06/14] Introduce property to virtio-mem

2021-06-23 Thread Michal Privoznik
The virtio-mem has another property that isn't exposed yet: actual size exposed to the guest. Please note, that this is different to because esp. on sizing the memory down guest may refuse to release some blocks. Therefore, let's have another size to report in the XML. But because of its nature,

[PATCH v4 04/14] qemu: Build command line for virtio-mem

2021-06-23 Thread Michal Privoznik
Nothing special is happening here. All important changes were done when for 'virtio-pmem' (adjusting the code to put virtio memory on PCI bus, generating alias using qemuDomainDeviceAliasIndex(). The only bit that might look suspicious is no prealloc for virtio-mem. But if you think about it, the

[PATCH v4 05/14] qemu: Wire up live update

2021-06-23 Thread Michal Privoznik
As advertised in one of previous commits, we want to be able to change 'requested-size' attribute of virtio-mem on the fly. This commit does exactly that. Changing anything else is checked for and forbidden. Once guest has changed the allocation, QEMU emits an event which we will use to track the

[PATCH v4 01/14] virhostmem: Introduce virHostMemGetTHPSize()

2021-06-23 Thread Michal Privoznik
New virHostMemGetTHPSize() is introduced which allows caller to obtain THP PMD (Page Middle Directory) size, which is equal to the minimal size that THP can use, taken from kernel doc (Documentation/admin-guide/mm/transhuge.rst): Some userspace (such as a test program, or an optimized memory

[PATCH v4 03/14] conf: Introduce virtio-mem model

2021-06-23 Thread Michal Privoznik
The virtio-mem is paravirtualized mechanism of adding/removing memory to/from a VM. A virtio-mem-pci device is split into blocks of equal size which are then exposed (all or only a requested portion of them) to the guest kernel to use as regular memory. Therefore, the device has two important

[PATCH v4 02/14] qemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI

2021-06-23 Thread Michal Privoznik
This commit introduces a new capability that reflects virtio-mem-pci device support in QEMU: QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI, /* -device virtio-mem-pci */ The virtio-mem-pci device was introduced in QEMU 5.1. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa ---

[PATCH v4 for v7.6.0 00/14] Introduce virtio-mem model

2021-06-23 Thread Michal Privoznik
v4 of: https://listman.redhat.com/archives/libvir-list/2021-April/msg01138.html diff to v3: - Rebased code on the top of master - Tried to work in all Peter's review suggestions - Fixed a bug where adjusting was viewed as hotplug of new by XML validator and thus if was close enough to

Re: [PATCH] ci: Also perform `brew upgrade` on MacOS

2021-06-23 Thread Andrea Bolognani
On Tue, Jun 22, 2021 at 12:50:33PM +0200, Martin Kletzander wrote: > On Wed, Jun 16, 2021 at 06:21:00AM -0700, Andrea Bolognani wrote: > > On Tue, Jun 15, 2021 at 12:43:39PM +0200, Martin Kletzander wrote: > > > ci: Also perform `brew upgrade` on MacOS > > > > s/MacOS/macOS/ > > > > But see below