Re: [PULL 00/13] misc patches removing deprecated features

2021-03-17 Thread Peter Maydell
On Tue, 16 Mar 2021 at 16:55, Daniel P. Berrangé wrote: > > The following changes since commit 6e31b3a5c34c6e5be7ef60773e607f189eaa15f3: > > Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into > staging (2021-03-16 10:53:47 +) > > are available in the Git repository

Re: [libvirt PATCH v2 4/6] ci: Introduce a util module

2021-03-17 Thread Erik Skultety
On Wed, Mar 17, 2021 at 06:11:32PM +0100, Andrea Bolognani wrote: > On Wed, 2021-03-17 at 18:05 +0100, Erik Skultety wrote: > > On Wed, Mar 17, 2021 at 05:06:33PM +0100, Andrea Bolognani wrote: > > > I don't know how to express that in terms of Python types > > > (List[Dict[str, Any]]?), and I'm

Re: [libvirt PATCH v2 6/6] ci: util: Add a registry checker for stale images

2021-03-17 Thread Erik Skultety
On Wed, Mar 17, 2021 at 04:57:01PM +0100, Andrea Bolognani wrote: > On Tue, 2021-03-16 at 18:33 +0100, Erik Skultety wrote: > > +++ b/ci/helper > > +def _list_stale_images(self): > > So far we have not used "_" as the prefix for any method name. Do we > want to start doing that? What would be

Re: [libvirt PATCH v2 4/6] ci: Introduce a util module

2021-03-17 Thread Andrea Bolognani
On Wed, 2021-03-17 at 18:05 +0100, Erik Skultety wrote: > On Wed, Mar 17, 2021 at 05:06:33PM +0100, Andrea Bolognani wrote: > > I don't know how to express that in terms of Python types > > (List[Dict[str, Any]]?), and I'm concerned by the fact that changing > > the return type to something

Re: [libvirt PATCH v2 4/6] ci: Introduce a util module

2021-03-17 Thread Erik Skultety
On Wed, Mar 17, 2021 at 05:06:33PM +0100, Andrea Bolognani wrote: > On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > > +++ b/ci/util.py > > +def get_registry_images(uri: str) -> Dict[str, str]: > > On closer inspection, the return type is not correct: we return a > list of JSON objects,

[PATCH] virxml: Fix possible memory leak in virXMLNodeContentString()

2021-03-17 Thread Kristina Hanicova
Previously, if xml node passed to the virXMLNodeContentString() was not of type XML_ELEMENT_NODE, @ret could have caused a memory leak because xmlNodeGetContent() works for other types of nodes as well. Signed-off-by: Kristina Hanicova --- src/util/virxml.c | 4 +++- 1 file changed, 3

Re: [libvirt PATCH v2 4/6] ci: Introduce a util module

2021-03-17 Thread Andrea Bolognani
On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > +++ b/ci/util.py > +def get_registry_images(uri: str) -> Dict[str, str]: On closer inspection, the return type is not correct: we return a list of JSON objects, not a mapping from strings to strings. I don't know how to express that in

Re: [libvirt PATCH v2 6/6] ci: util: Add a registry checker for stale images

2021-03-17 Thread Andrea Bolognani
On Tue, 2021-03-16 at 18:33 +0100, Erik Skultety wrote: > +++ b/ci/helper > +def _list_stale_images(self): So far we have not used "_" as the prefix for any method name. Do we want to start doing that? What would be the criteria? > +# check for stale images in GitLab registry > +

Re: [PULL 00/11] Ui 20210316 patches

2021-03-17 Thread Peter Maydell
On Tue, 16 Mar 2021 at 05:38, Gerd Hoffmann wrote: > > The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14: > > Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-= > request' into staging (2021-03-14 17:47:49 +) > > are available in the Git

Re: [libvirt PATCH v2 2/3] docs: html.in: Convert auth to rst

2021-03-17 Thread Erik Skultety
On Mon, Mar 15, 2021 at 06:39:45PM +0100, Erik Skultety wrote: > There was one external reference to this page's section which was fixed > manually. > > Signed-off-by: Erik Skultety > --- ... > index fece9df80e..bd85c2e36e 100644 > --- a/docs/kbase/locking-sanlock.rst > +++

Re: [libvirt PATCH v2 3/6] ci: helper: Introduce --quiet

2021-03-17 Thread Erik Skultety
On Wed, Mar 17, 2021 at 11:54:40AM +0100, Andrea Bolognani wrote: > On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > > +++ b/ci/helper > > @@ -68,6 +68,12 @@ class Parser: > > > > # Main parser > > self.parser = argparse.ArgumentParser() > > +

Re: [PATCH v2] target/mips: Deprecate Trap-and-Emul KVM support

2021-03-17 Thread Philippe Mathieu-Daudé
On 3/17/21 2:12 AM, Jiaxun Yang wrote: > Upstream kernel had removed both host[1] and guest[2] support. > > [1]: > https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=45c7e8af4a5e3f0bea4ac209eea34118dd57ac64 > [2]: >

[PATCH v3 11/15] qemu: Account for both memballoon and virtio-mem

2021-03-17 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 v3 15/15] kbase: Document virtio-mem

2021-03-17 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 v3 13/15] virsh: Introduce update-memory-device command

2021-03-17 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 v3 12/15] qemuDomainSetMemoryFlags: Take virtio-mem into consideration

2021-03-17 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 v3 14/15] news: document recent virtio memory addition

2021-03-17 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index bd40373a80..a58b04edb0 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -13,6 +13,13 @@ v7.2.0 (unreleased) * **New features** + * Introduce virtio-mem model + +

[PATCH v3 09/15] Introduce MEMORY_DEVICE_SIZE_CHANGE event

2021-03-17 Thread Michal Privoznik
New event is introduced that is emitted whenever guest acknowledges allocation change request of a virtio-mem. The aim is to let applications know when that happens, because changes in allocation are not synchronous with issuing the request. Under the hood, the event is emitted whenever QEMU emits

[PATCH v3 06/15] qemu: Build command line for virtio-mem

2021-03-17 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 v3 08/15] qemu: Wire up MEMORY_DEVICE_SIZE_CHANGE event

2021-03-17 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 v3 02/15] qemu_process: Deduplicate code in qemuProcessNeedHugepagesPath()

2021-03-17 Thread Michal Privoznik
The aim of qemuProcessNeedHugepagesPath() is to return whether guest needs private path inside HugeTLBFS mounts (deducted from domain definition @def) or whether the memory device that user is hotplugging in needs the private path (deducted from the @mem argument). The actual creation of the path

[PATCH v3 10/15] qemu: Refresh the actual size of virtio-mem on monitor reconnect

2021-03-17 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 --- src/qemu/qemu_domain.c |

[PATCH v3 07/15] qemu: Wire up live update

2021-03-17 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 v3 05/15] conf: Introduce virtio-mem model

2021-03-17 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 v3 04/15] qemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI

2021-03-17 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 --- src/qemu/qemu_capabilities.c

[PATCH v3 03/15] qemu_process: Drop needless check in qemuProcessNeedMemoryBackingPath()

2021-03-17 Thread Michal Privoznik
The aim of this function is to return whether domain definition and/or memory device that user intents to hotplug needs a private path inside cfg->memoryBackingDir. The rule for the memory device that's being hotplug includes checking whether corresponding guest NUMA node needs memoryBackingDir.

[PATCH v3 01/15] virhostmem: Introduce virHostMemGetTHPSize()

2021-03-17 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 v3 00/15] Introduce virtio-mem model

2021-03-17 Thread Michal Privoznik
v3 of: https://listman.redhat.com/archives/libvir-list/2021-February/msg00961.html diff to v2: - Dropped code that forbade use of virtio-mem and memballoon at the same time; - This meant that I had to adjust memory accounting, qemuDomainSetMemoryFlags() - see patches 11/15 and 12/15 which

Re: [libvirt PATCH v2 4/6] ci: Introduce a util module

2021-03-17 Thread Erik Skultety
On Wed, Mar 17, 2021 at 12:02:31PM +0100, Andrea Bolognani wrote: > On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > > +import urllib.request as urllibrequest > > +import urllib.parse as urllibparse > > The aliasing doesn't look like it serves a real purpose here, as it > only saves a

Re: [libvirt PATCH v2 4/6] ci: Introduce a util module

2021-03-17 Thread Andrea Bolognani
On Wed, 2021-03-17 at 12:02 +0100, Andrea Bolognani wrote: > On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > > +apistr = str(api_version) > > +project_uri = f"{gitlab_uri}/api/v{apistr}/projects/{namespace_urlenc}" > > Can't you use api_version without explicitly

Re: [libvirt PATCH v2 2/6] ci: helper: Use the ArgumentDefaultsHelpFormatter help formatter

2021-03-17 Thread Erik Skultety
On Wed, Mar 17, 2021 at 11:52:22AM +0100, Andrea Bolognani wrote: > On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > > This help formatter class reports the defaults we use for options > > taking an argument. > > > > Signed-off-by: Erik Skultety > > --- > > ci/helper | 5 + > > 1

Re: [libvirt PATCH v2 5/6] ci: helper: Rewrite image listing to Python

2021-03-17 Thread Andrea Bolognani
On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > +ci-list-images: help I'd just drop the target altogether. The entire Makefile is hopefully going to disappear soon enough anyway, so I'd really rather not put any additional work into it. > +print("Available x86 container

Re: [libvirt PATCH v2 4/6] ci: Introduce a util module

2021-03-17 Thread Andrea Bolognani
On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > +import urllib.request as urllibrequest > +import urllib.parse as urllibparse The aliasing doesn't look like it serves a real purpose here, as it only saves a single character... I'd import, and use, urrlib.request and urllib.parse

[PATCH v1 01/12] libxl: add API wrapper for libxl_domain_create_restore

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_create_restore, which got a new parameter "send_back_fd" in Xen 4.7. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 44

[PATCH v1 09/12] libxl: add API wrapper for libxl_set_vcpuonline

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_set_vcpuonline, which got a new parameter "ao_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 14 ++

[PATCH v1 10/12] libxl: add API wrapper for libxl_send_trigger

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_send_trigger, which got a new parameter "ao_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 17 +

[PATCH v1 11/12] libxl: add API wrapper for libxl_set_memory_target

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_set_memory_target, which changed the storage size of parameter "target_memkb" in Xen 4.8. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 29 +

[PATCH v1 06/12] libxl: add API wrapper for libxl_domain_unpause

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_unpause, which got a new parameter "ao_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h | 14 ++

[PATCH v1 12/12] libxl: use API 4.13 to support domUs with more than 4TB

2021-03-17 Thread Olaf Hering
To support domUs with more than 4TB memory it is required to use LIBXL_API_VERSION >= 0x040800, which uses uint64_t for certained guest memory related quantities. Unfortunately this change is not straight forward. While most of the code in libxl.h handles the various LIBXL_API_VERSION variants

[PATCH v1 05/12] libxl: add API wrapper for libxl_domain_pause

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_pause, which got a new parameter "ao_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 14 ++

[PATCH v1 03/12] libxl: add API wrapper for libxl_domain_shutdown

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_shutdown, which got a new parameter "ao_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 14 ++

[PATCH v1 02/12] libxl: add API wrapper for libxl_retrieve_domain_configuration

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_retrieve_domain_configuration, which got a new parameter "libxl_asyncop_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h|

[PATCH v1 04/12] libxl: add API wrapper for libxl_domain_reboot

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_reboot, which got a new parameter "ao_how" in Xen 4.12. libvirt does not use this parameter. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 14 ++

[PATCH v1 07/12] libxl: add API wrapper for libxl_domain_need_memory

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_domain_need_memory, which changed the storage size of "need_memkb" in Xen 4.8. With Xen 4.12 the libxl_domain_config parameter was changed No functional change intended. Signed-off-by: Olaf Hering ---

[PATCH v1 00/12] libxl: bump LIBXL_API_VERSION

2021-03-17 Thread Olaf Hering
Various changes to handle libxl API variants. Olaf Olaf Hering (12): libxl: add API wrapper for libxl_domain_create_restore libxl: add API wrapper for libxl_retrieve_domain_configuration libxl: add API wrapper for libxl_domain_shutdown libxl: add API wrapper for libxl_domain_reboot

[PATCH v1 08/12] libxl: add API wrapper for libxl_get_free_memory

2021-03-17 Thread Olaf Hering
Upcoming changes will use different LIBXL_API_VERSION variants. Prepare libxl_get_free_memory, which changed storage size of parameter "memkb" in Xen 4.8. No functional change intended. Signed-off-by: Olaf Hering --- src/libxl/libxl_api.h| 19 +++ src/libxl/libxl_conf.c

Re: [libvirt PATCH v2 3/6] ci: helper: Introduce --quiet

2021-03-17 Thread Andrea Bolognani
On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > +++ b/ci/helper > @@ -68,6 +68,12 @@ class Parser: > > # Main parser > self.parser = argparse.ArgumentParser() > +self.parser.add_argument( > +"--quiet", > +action="store_true", > +

Re: [libvirt PATCH v2 2/6] ci: helper: Use the ArgumentDefaultsHelpFormatter help formatter

2021-03-17 Thread Andrea Bolognani
On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > This help formatter class reports the defaults we use for options > taking an argument. > > Signed-off-by: Erik Skultety > --- > ci/helper | 5 + > 1 file changed, 5 insertions(+) It's a shame that we have to repeat this for every

Re: [libvirt PATCH v2 1/6] ci: Makefile: Specify a help target to replace ci-help

2021-03-17 Thread Andrea Bolognani
On Tue, 2021-03-16 at 18:32 +0100, Erik Skultety wrote: > It's quite pointless to have a 'ci-help' target in the Makefile when > one needs to actually open the Makefile to go through the list of > targets to know what functionality the Makefile actually provides. It's > much more intuitive to run