Re: [PATCH 02/13] audio: Require AudioState in AUD_add_capture

2023-09-28 Thread Markus Armbruster
BALATON Zoltan writes: > On Sat, 23 Sep 2023, Paolo Bonzini wrote: >> From: Martin Kletzander >> >> Since all callers require a valid audiodev this function can now safely >> abort in case of missing AudioState. >> >> Signed-off-by: Martin Kletzander >> Message-ID: >> >> Signed-off-by: Paolo

[PATCH v2 16/53] migration/rdma: Fix or document problematic uses of errno

2023-09-28 Thread Markus Armbruster
We use errno after calling Libibverbs functions that are not documented to set errno (manual page does not mention errno), or where the documentation is unclear ("returns [...] the value of errno on failure"). While this could be read as "sets errno and returns it", a glance at the source code[*]

[PATCH v2 28/53] migration/rdma: Drop superfluous assignments to @ret

2023-09-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 35 ++- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index d92be4869a..2af9395696 100644 --- a/migration/rdma.c +++

[PATCH v2 29/53] migration/rdma: Check negative error values the same way everywhere

2023-09-28 Thread Markus Armbruster
When a function returns 0 on success, negative value on error, checking for non-zero suffices, but checking for negative is clearer. So do that. Signed-off-by: Markus Armbruster --- migration/rdma.c | 82 1 file changed, 41 insertions(+), 41

[PATCH v2 35/53] migration/rdma: Convert qemu_rdma_exchange_recv() to Error

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH] hyperv: add check for NULL for msg

2023-09-28 Thread Anastasia Belova
cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 76036a5fc7 ("hyperv: process POST_MESSAGE hypercall") Signed-off-by: Anastasia Belova ---

[PATCH v2 10/53] migration/rdma: Put @errp parameter last

2023-09-28 Thread Markus Armbruster
include/qapi/error.h demands: * - Functions that use Error to report errors have an Error **errp * parameter. It should be the last parameter, except for functions * taking variable arguments. qemu_rdma_connect() does not conform. Clean it up. Signed-off-by: Markus Armbruster

Re: [PATCH v3 0/6] python/machine: use socketpair() for console socket

2023-09-28 Thread John Snow
On Thu, Sep 28, 2023, 4:12 AM Daniel P. Berrangé wrote: > On Thu, Sep 28, 2023 at 12:49:37AM -0400, John Snow wrote: > > Like we did for the QMP socket, use socketpair() for the console socket > > so that hopefully there isn't a race condition during early boot where > > data might get dropped

[PATCH v2 15/53] migration/rdma: Use bool for two RDMAContext flags

2023-09-28 Thread Markus Armbruster
@error_reported and @received_error are flags. The latter is even assigned bool true. Change them from int to bool. Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Li Zhijian --- migration/rdma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v2 45/53] migration/rdma: Silence qemu_rdma_resolve_host()

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 22/53] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port

2023-09-28 Thread Markus Armbruster
qemu_rdma_data_init() neglects to set an Error when it fails because @host_port is null. Fortunately, no caller passes null, so this is merely a latent bug. Drop the flawed code handling null argument. Signed-off-by: Markus Armbruster --- migration/rdma.c | 29 + 1

[PATCH v2 00/53] migration/rdma: Error handling fixes

2023-09-28 Thread Markus Armbruster
Oh dear, where to start. There's so much wrong, and in pretty obvious ways. This code should never have passed review. I'm refraining from saying more; see the commit messages instead. Issues remaining after this series include: * Terrible error messages * Some error message cascades remain

Re: [PULL v2 00/21] tricore queue

2023-09-28 Thread Stefan Hajnoczi
commit 36e9aab3c569d4c9ad780473596e18479838d1aa: > > migration: Move return path cleanup to main migration thread (2023-09-27 > 13:58:02 -0400) > > are available in the Git repository at: > > https://github.com/bkoppelmann/qemu.git tags/pull-tricore-20230928 >

Re: confirming the patch is a solution

2023-09-28 Thread Cédric Le Goater
Hello Edmund, On 9/28/23 18:46, recallmenot wrote: Hi, I can confirm the patch fixes issue 1891 for GVT-g + DMABUF + GTK UI. I'd say having a display is -inf % better than a black screen. Haven't heard / seen anything from Gerd in a long while, hope he's doing well. Kind regards, Edmund

Re: [PATCH] hyperv: add check for NULL for msg

2023-09-28 Thread Alex Bennée
Anastasia Belova writes: > cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. > Add check for NULL to avoid NULL-dereference. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 76036a5fc7 ("hyperv: process POST_MESSAGE hypercall") >

[PATCH v2 16/16] tests: bios-tables-test: Add ACPI table binaries for smbios type4 thread count2 test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 5 and 6. Changes in the tables: FACP: +/* + * Intel ACPI Component Architecture + * AML/ASL+ Disassembler version 20200925 (64-bit version) + * Copyright (c) 2000 - 2020 Intel Corporation + * + *

[PATCH v2 15/16] tests: bios-tables-test: Add test for smbios type4 thread count2

2023-09-28 Thread Zhao Liu
From: Zhao Liu This tests the commit 7298fd7de5551 ("hw/smbios: Fix thread count in type4"). In smbios_build_type_4_table() (hw/smbios/smbios.c), if the number of threads in the socket is more than 255, then smbios type4 table encodes threads per socket into the thread count2 field. So for the

[PATCH v2 13/16] tests: bios-tables-test: Add ACPI table binaries for smbios type4 thread count test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 5 and 6. Changes in the tables: FACP: +/* + * Intel ACPI Component Architecture + * AML/ASL+ Disassembler version 20200925 (64-bit version) + * Copyright (c) 2000 - 2020 Intel Corporation + * + *

[PATCH v2 12/16] tests: bios-tables-test: Add test for smbios type4 thread count

2023-09-28 Thread Zhao Liu
From: Zhao Liu This tests the commit 7298fd7de5551 ("hw/smbios: Fix thread count in type4"). In smbios_build_type_4_table() (hw/smbios/smbios.c), if the number of threads in the socket is not more than 255, then smbios type4 table encodes threads per socket into the thread count field. So for

[PATCH v2 02/16] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 count test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 1 - 3. List the ACPI tables that will be added to test the type 4 count. Signed-off-by: Zhao Liu --- tests/data/acpi/q35/APIC.type4-count| 0 tests/data/acpi/q35/DSDT.type4-count| 0

[PATCH v2 10/16] tests: bios-tables-test: Update ACPI table binaries for smbios core count2 test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Change the core count2 from 275 to 260. Following the guidelines in tests/qtest/bios-tables-test.c, this is step 5 and 6. Changes in the tables: APIC: /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20200925 (64-bit version) * Copyright (c) 2000 -

[PATCH v2 07/16] tests: bios-tables-test: Add ACPI table binaries for smbios type4 core count test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 5 and 6. Changes in the tables: FACP: +/* + * Intel ACPI Component Architecture + * AML/ASL+ Disassembler version 20200925 (64-bit version) + * Copyright (c) 2000 - 2020 Intel Corporation + * + *

[PATCH v2 08/16] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 core count2 test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 1 - 3. List the ACPI tables that will be changed about the type 4 core count2 test case. Signed-off-by: Zhao Liu --- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ 1 file changed, 2 insertions(+)

[PATCH v2 09/16] tests: bios-tables-test: Extend smbios core count2 test to cover general topology

2023-09-28 Thread Zhao Liu
From: Zhao Liu The commit 196ea60a734c3 ("hw/smbios: Fix core count in type4") fixed the miscalculation of cores per socket. The original core count2 test (with the topology configured by "-smp 275") didn't recognize that topology-related but because it just created a special topology with only

[PATCH v2 01/16] tests: test-smp-parse: Add the test for cores/threads per socket helpers

2023-09-28 Thread Zhao Liu
From: Zhao Liu Use the different ways to calculate cores/threads per socket, so that the new CPU topology levels won't be missed in these 2 helpes: * machine_topo_get_cores_per_socket() * machine_topo_get_threads_per_socket() Test the commit a1d027be95bc3 ("machine: Add helpers to get cores/

[PATCH v2 14/16] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 thread count2 test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 1 - 3. List the ACPI tables that will be added to test the thread count2 field of smbios type4 table. Signed-off-by: Zhao Liu --- tests/data/acpi/q35/APIC.thread-count2 | 0

[PATCH v2 00/16] tests: Add CPU topology related smbios test cases

2023-09-28 Thread Zhao Liu
From: Zhao Liu Hi all, This patchset is the v2 which adds more description about the topology selection under Igor's comments. In this patchset, add these test cases: 1. Add the case to test 2 newly added topology helpers (patch 1): * machine_topo_get_cores_per_socket() *

[PATCH v2 05/53] migration/rdma: Consistently use uint64_t for work request IDs

2023-09-28 Thread Markus Armbruster
We use int instead of uint64_t in a few places. Change them to uint64_t. This cleans up a comparison of signed qemu_rdma_block_for_wrid() parameter @wrid_requested with unsigned @wr_id. Harmless, because the actual arguments are non-negative enumeration constants. Signed-off-by: Markus

[PATCH v2 44/53] migration/rdma: Convert qemu_rdma_alloc_pd_cq() to Error

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 50/53] migration/rdma: Silence qemu_rdma_register_and_get_keys()

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 43/53] migration/rdma: Convert qemu_rdma_post_recv_control() to Error

2023-09-28 Thread Markus Armbruster
Just for symmetry with qemu_rdma_post_send_control(). Error messages lose detail I consider of no use to users. Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git

[PATCH v2 52/53] migration/rdma: Use error_report() & friends instead of stderr

2023-09-28 Thread Markus Armbruster
error_report() obeys -msg, reports the current error location if any, and reports to the current monitor if any. Reporting to stderr directly with fprintf() or perror() is wrong, because it loses all this. Fix the offenders. Bonus: resolves a FIXME about problematic use of errno.

[PATCH v2 02/53] migration/rdma: Clean up qemu_rdma_data_init()'s return type

2023-09-28 Thread Markus Armbruster
qemu_rdma_data_init() return type is void *. It actually returns RDMAContext *, and all its callers assign the value to an RDMAContext *. Unclean. Return RDMAContext * instead. Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Li Zhijian --- migration/rdma.c | 2 +-

[PATCH] target/sh4: fix crashes on signal delivery

2023-09-28 Thread Mikulas Patocka
sh4 uses gUSA (general UserSpace Atomicity) to provide atomicity on CPUs that don't have atomic instructions. A gUSA region that adds 1 to an atomic variable stored in @R2 looks like this: 4004b6: 03 c7 mova4004c4 ,r0 4004b8: f3 61 mov r15,r1 4004ba:

[PATCH v2 03/16] tests: bios-tables-test: Add test for smbios type4 count

2023-09-28 Thread Zhao Liu
From: Zhao Liu This tests the commit d79a284a44bb7 ("hw/smbios: Fix smbios_smp_sockets calculation"). In smbios_get_tables() (hw/smbios/smbios.c), smbios type4 table is built for each socket, so the count of type4 tables should be equal to the number of sockets. Thus for the topology in this

[PATCH v2 11/16] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 thread count test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 1 - 3. List the ACPI tables that will be added to test the thread count field of smbios type4 table. Signed-off-by: Zhao Liu --- tests/data/acpi/q35/APIC.thread-count | 0

[PATCH v2 32/53] migration/rdma: Retire macro ERROR()

2023-09-28 Thread Markus Armbruster
ERROR() has become "error_setg() unless an error has been set already". Hiding the conditional in the macro is in the way of further work. Replace the macro uses by their expansion, and delete the macro. Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 168

[PATCH v2 24/53] migration/rdma: Fix rdma_getaddrinfo() error checking

2023-09-28 Thread Markus Armbruster
rdma_getaddrinfo() returns 0 on success. On error, it returns one of the EAI_ error codes like getaddrinfo() does, or -1 with errno set. This is broken by design: POSIX implicitly specifies the EAI_ error codes to be non-zero, no more. They could clash with -1. Nothing we can do about this

[PATCH v2 19/53] migration/rdma: Replace dangerous macro CHECK_ERROR_STATE()

2023-09-28 Thread Markus Armbruster
Hiding return statements in macros is a bad idea. Use a function instead, and open code the return part. Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Li Zhijian --- migration/rdma.c | 43 +++ 1 file changed, 27

[PATCH v2 09/53] migration/rdma: Fix qemu_rdma_accept() to return failure on errors

2023-09-28 Thread Markus Armbruster
qemu_rdma_accept() returns 0 in some cases even when it didn't complete its job due to errors. Impact is not obvious. I figure the caller will soon fail again with a misleading error message. Fix it to return -1 on any failure. Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas

[PATCH v2 26/53] migration/rdma: Dumb down remaining int error values to -1

2023-09-28 Thread Markus Armbruster
This is just to make the error value more obvious. Callers don't mind. Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 45 +++-- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/migration/rdma.c

[PATCH v2 06/53] migration/rdma: Fix unwanted integer truncation

2023-09-28 Thread Markus Armbruster
qio_channel_rdma_readv() assigns the size_t value of qemu_rdma_fill() to an int variable before it adds it to @done / subtracts it from @want, both size_t. Truncation when qemu_rdma_fill() copies more than INT_MAX bytes. Seems vanishingly unlikely, but needs fixing all the same. Fixes:

[PATCH v2 25/53] migration/rdma: Return -1 instead of negative errno code

2023-09-28 Thread Markus Armbruster
Several functions return negative errno codes on failure. Callers check for specific codes exactly never. For some of the functions, callers couldn't check even if they wanted to, because the functions also return negative values that aren't errno codes, leaving readers confused on what the

[PATCH v2 30/53] migration/rdma: Plug a memory leak and improve a message

2023-09-28 Thread Markus Armbruster
When migration capability @rdma-pin-all is true, but the server cannot honor it, qemu_rdma_connect() calls macro ERROR(), then returns success. ERROR() sets an error. Since qemu_rdma_connect() returns success, its caller rdma_start_outgoing_migration() duly assumes @errp is still clear. The

[PATCH v2 14/53] migration/rdma: Make qemu_rdma_buffer_mergeable() return bool

2023-09-28 Thread Markus Armbruster
qemu_rdma_buffer_mergeable() is semantically a predicate. It returns int 0 or 1. Return bool instead, and fix the function name's spelling. Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Li Zhijian --- migration/rdma.c | 20 ++-- 1 file changed, 10

[PATCH v2 41/53] migration/rdma: Convert qemu_rdma_write() to Error

2023-09-28 Thread Markus Armbruster
Just for consistency with qemu_rdma_write_one() and qemu_rdma_write_flush(), and for slightly simpler code. Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/migration/rdma.c

Re: [PATCH 1/5] migration: Store downtime timestamps in an array

2023-09-28 Thread Joao Martins
On 28/09/2023 02:55, Wang, Lei wrote: > On 9/27/2023 0:18, Joao Martins wrote: >> Right now downtime_start is stored in MigrationState. >> >> In preparation to having more downtime timestamps during >> switchover, move downtime_start to an array namely, @timestamp. >> >> Add a setter/getter

Re: [PATCH v24 17/21] tests/avocado: s390x cpu topology entitlement tests

2023-09-28 Thread Thomas Huth
On 26/09/2023 14.15, Nina Schoetterl-Glausch wrote: From: Pierre Morel Test changes in the entitlement from both a guest and a host point of view, depending on the polarization. Signed-off-by: Pierre Morel Reviewed-by: Nina Schoetterl-Glausch Co-developed-by: Nina Schoetterl-Glausch

Re: [PATCH v1 8/9] qapi: golang: Add CommandResult type to Go

2023-09-28 Thread Daniel P . Berrangé
On Wed, Sep 27, 2023 at 01:25:43PM +0200, Victor Toso wrote: > This patch adds a struct type in Go that will handle return values > for QAPI's command types. > > The return value of a Command is, encouraged to be, QAPI's complex > types or an Array of those. > > Every Command has a underlying

Re: [PATCH v7 2/2] tpm: add backend for mssim

2023-09-28 Thread James Bottomley
On Thu, 2023-09-28 at 07:29 +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Wed, Sep 27, 2023 at 12:49:08PM -0400, James Bottomley wrote: > > > From: James Bottomley > > > > > > The Microsoft Simulator (mssim) is the reference emulation > > > platform > > > for the TCG

Re: [PATCH] hyperv: add check for NULL for msg

2023-09-28 Thread Maciej S. Szmigiero
On 28.09.2023 18:56, Alex Bennée wrote: Anastasia Belova writes: cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 76036a5fc7 ("hyperv: process

Re: stable-8.1.1: which bug do we keep?

2023-09-28 Thread Richard Henderson
On 9/20/23 16:45, Michael Tokarev wrote: 20.09.2023 12:17, Daniel P. Berrangé wrote: Since the 2nd series is shown to still be broken in some cases and 1st is thought to solve them all, IMHO it feels like we should just press ahead with applying the the 1st series to git master, and then

[PATCH] Fix compilation when UFFDIO_REGISTER is not set.

2023-09-28 Thread Pierre Labatut
Signed-off-by: Pierre Labatut --- subprojects/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 0469a50101..d4a2eab883 100644 ---

[PATCH v2 31/53] migration/rdma: Delete inappropriate error_report() in macro ERROR()

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

Re: [PATCH v1 9/9] docs: add notes on Golang code generator

2023-09-28 Thread Daniel P . Berrangé
On Wed, Sep 27, 2023 at 01:25:44PM +0200, Victor Toso wrote: > The goal of this patch is converge discussions into a documentation, > to make it easy and explicit design decisions, known issues and what > else might help a person interested in how the Go module is generated. > > Signed-off-by:

[PATCH v2 36/53] migration/rdma: Convert qemu_rdma_exchange_send() to Error

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 27/53] migration/rdma: Replace int error_state by bool errored

2023-09-28 Thread Markus Armbruster
All we do with the value of RDMAContext member @error_state is test whether it's zero. Change to bool and rename to @errored. Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 66 1 file changed, 33 insertions(+),

[PATCH v2 40/53] migration/rdma: Convert qemu_rdma_write_one() to Error

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 42/53] migration/rdma: Convert qemu_rdma_post_send_control() to Error

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 23/53] migration/rdma: Fix QEMUFileHooks method return values

2023-09-28 Thread Markus Armbruster
The QEMUFileHooks methods don't come with a written contract. Digging through the code calling them, we find: * save_page(): Negative values RAM_SAVE_CONTROL_DELAYED and RAM_SAVE_CONTROL_NOT_SUPP are special. Any other negative value is an unspecified error. qemu_rdma_save_page()

[PATCH v2 03/53] migration/rdma: Clean up rdma_delete_block()'s return type

2023-09-28 Thread Markus Armbruster
rdma_delete_block() always returns 0, which its only caller ignores. Return void instead. Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Li Zhijian --- migration/rdma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/migration/rdma.c

[PATCH v2 13/53] migration/rdma: Drop qemu_rdma_search_ram_block() error handling

2023-09-28 Thread Markus Armbruster
qemu_rdma_search_ram_block() can't fail. Return void, and drop the unreachable error handling. Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/migration/rdma.c

[PATCH v2 20/53] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error

2023-09-28 Thread Markus Armbruster
qemu_rdma_resolve_host() and qemu_rdma_dest_init() try addresses until they find on that works. If none works, they return the first Error set by qemu_rdma_broken_ipv6_kernel(), or else return a generic one. qemu_rdma_broken_ipv6_kernel() neglects to set an Error when ibv_open_device() fails.

[PULL 14/14] scripts/analyse-locks-simpletrace.py: changed iteritems() to items()

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal Python 3 removed `dict.iteritems()` in favor of `dict.items()`. This means the script currently doesn't work on Python 3. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal Message-id: 20230926103436.25700-15-m...@ynddal.dk

[PULL 09/14] simpletrace: refactor to separate responsibilities

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal Moved event_mapping and event_id_to_name down one level in the function call-stack to keep variable instantiation and usage closer (`process` and `run` has no use of the variables; `read_trace_records` does). Instead of passing event_mapping and event_id_to_name to the bottom

[PULL 11/14] simpletrace: move event processing to Analyzer class

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process function. This allows for new types of Analyzer-based subclasses without changing the core code. Note, that the fn_cache is important for

[PULL 08/14] simpletrace: made Analyzer into context-manager

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method

Re: [PATCH v24 15/21] tests/avocado: s390x cpu topology core

2023-09-28 Thread Thomas Huth
On 26/09/2023 14.15, Nina Schoetterl-Glausch wrote: From: Pierre Morel Introduction of the s390x cpu topology core functions and basic tests. We test the correlation between the command line and the QMP results in query-cpus-fast for various CPU topology. Signed-off-by: Pierre Morel

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-28 Thread Jonathan Cameron via
On Wed, 27 Sep 2023 10:37:37 -0600 Alex Williamson wrote: > On Wed, 27 Sep 2023 15:03:09 + > Vikram Sethi wrote: > > > > From: Alex Williamson > > > Sent: Wednesday, September 27, 2023 9:25 AM > > > To: Jason Gunthorpe > > > Cc: Jonathan Cameron ; Ankit Agrawal > > > ; David Hildenbrand

Re: [PATCH v4 14/18] virtio-mem: Pass non-const VirtIOMEM via virtio_mem_range_cb

2023-09-28 Thread Maciej S. Szmigiero
On 26.09.2023 20:57, David Hildenbrand wrote: Let's prepare for a user that has to modify the VirtIOMEM device state. Signed-off-by: David Hildenbrand --- hw/virtio/virtio-mem.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio-mem.c

[PATCH v2 05/16] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 core count test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 1 - 3. List the ACPI tables that will be added to test the type 4 core count field. Signed-off-by: Zhao Liu --- tests/data/acpi/q35/APIC.core-count | 0 tests/data/acpi/q35/DSDT.core-count

[PATCH v2 06/16] tests: bios-tables-test: Add test for smbios type4 core count

2023-09-28 Thread Zhao Liu
From: Zhao Liu This tests the commit 196ea60a734c3 ("hw/smbios: Fix core count in type4"). In smbios_build_type_4_table() (hw/smbios/smbios.c), if the number of cores in the socket is not more than 255, then smbios type4 table encodes cores per socket into the core count field. So for the

[PATCH v2 04/16] tests: bios-tables-test: Add ACPI table binaries for smbios type4 count test

2023-09-28 Thread Zhao Liu
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 5 and 6. Changes in the tables: FACP: +/* + * Intel ACPI Component Architecture + * AML/ASL+ Disassembler version 20200925 (64-bit version) + * Copyright (c) 2000 - 2020 Intel Corporation + * + *

Re: [PATCH v24 04/21] target/s390x/cpu topology: handle STSI(15) and build the SYSIB

2023-09-28 Thread Thomas Huth
On 26/09/2023 14.15, Nina Schoetterl-Glausch wrote: From: Pierre Morel On interception of STSI(15.1.x) the System Information Block (SYSIB) is built from the list of pre-ordered topology entries. Signed-off-by: Pierre Morel Reviewed-by: Nina Schoetterl-Glausch Co-developed-by: Nina

[PULL 07/14] simpletrace: define exception and add handling

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal Message-id:

[PULL 04/14] simpletrace: changed naming of edict and idtoname to improve readability

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code. Signed-off-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Message-id:

[PULL 10/14] simpletrace: move logic of process into internal function

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process into _process. Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal Message-id: 20230926103436.25700-11-m...@ynddal.dk

[PULL 01/14] simpletrace: add __all__ to define public interface

2023-09-28 Thread Stefan Hajnoczi
From: Mads Ynddal It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain. Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal Message-id: 20230926103436.25700-2-m...@ynddal.dk Signed-off-by: Stefan Hajnoczi

Re: [PATCH v1 7/9] qapi: golang: Generate qapi's command types in Go

2023-09-28 Thread Daniel P . Berrangé
On Wed, Sep 27, 2023 at 01:25:42PM +0200, Victor Toso wrote: > This patch handles QAPI command types and generates data structures in > Go that decodes from QMP JSON Object to Go data structure and vice > versa. > > Similar to Event, this patch adds a Command interface and two helper > functions

Re: [PATCH v7 01/12] nbd/server: Support a request payload

2023-09-28 Thread Eric Blake
On Thu, Sep 28, 2023 at 12:09:51PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 27.09.23 18:59, Eric Blake wrote: > > We could also try to be a bit more complicated by peeking at the next > > few bytes: if they look like a magic number of the next request, > > assume the client set the bit

Re: [PATCH v1 1/9] qapi: golang: Generate qapi's enum types in Go

2023-09-28 Thread Daniel P . Berrangé
On Thu, Sep 28, 2023 at 04:20:55PM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Wed, Sep 27, 2023 at 01:25:36PM +0200, Victor Toso wrote: > >> This patch handles QAPI enum types and generates its equivalent in Go. > >> > >> Basically, Enums are being handled as strings

Re: [PATCH] hyperv: add check for NULL for msg

2023-09-28 Thread Maciej S. Szmigiero
On 28.09.2023 15:25, Anastasia Belova wrote: cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 76036a5fc7 ("hyperv: process POST_MESSAGE hypercall")

[PATCH v2 38/53] migration/rdma: Convert qemu_rdma_reg_whole_ram_blocks() to Error

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 08/53] migration/rdma: Give qio_channel_rdma_source_funcs internal linkage

2023-09-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Li Zhijian --- migration/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/rdma.c b/migration/rdma.c index faca0ed998..0e991175f9 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@

[PATCH v2 12/53] migration/rdma: Drop rdma_add_block() error handling

2023-09-28 Thread Markus Armbruster
rdma_add_block() can't fail. Return void, and drop the unreachable error handling. Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Li Zhijian --- migration/rdma.c | 30 +- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git

[PATCH v2 17/53] migration/rdma: Ditch useless numeric error codes in error messages

2023-09-28 Thread Markus Armbruster
Several error messages include numeric error codes returned by failed functions: * ibv_poll_cq() returns an unspecified negative value. Useless. * rdma_accept and rdma_get_cm_event() return -1. Useless. * qemu_rdma_poll() returns either -1 or an unspecified negative value. Useless. *

[PATCH v2 34/53] migration/rdma: Drop "@errp is clear" guards around error_setg()

2023-09-28 Thread Markus Armbruster
These guards are all redundant now. Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian --- migration/rdma.c | 164 +++ 1 file changed, 51 insertions(+), 113 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index

[PATCH v2 21/53] migration/rdma: Fix qemu_get_cm_event_timeout() to always set error

2023-09-28 Thread Markus Armbruster
qemu_get_cm_event_timeout() neglects to set an error when it fails because rdma_get_cm_event() fails. Harmless, as its caller qemu_rdma_connect() substitutes a generic error then. Fix it anyway. qemu_rdma_connect() also sets the generic error when its own call of rdma_get_cm_event() fails.

[PATCH v2 07/53] migration/rdma: Clean up two more harmless signed vs. unsigned issues

2023-09-28 Thread Markus Armbruster
qemu_rdma_exchange_get_response() compares int parameter @expecting with uint32_t head->type. Actual arguments are non-negative enumeration constants, RDMAControlHeader uint32_t member type, or qemu_rdma_exchange_recv() int parameter expecting. Actual arguments for the latter are non-negative

Re: [PATCH] qtest/migration: Add a test for the analyze-migration script

2023-09-28 Thread Fabiano Rosas
Thomas Huth writes: > On 27/09/2023 23.47, Fabiano Rosas wrote: >> Add a smoke test that migrates to a file and gives it to the >> script. It should catch the most annoying errors such as changes in >> the ram flags. >> >> After code has been merged it becomes way harder to figure out what is

Re: [PATCH v4 2/4] qcow2: add configurations for zoned format extension

2023-09-28 Thread Eric Blake
On Mon, Sep 18, 2023 at 05:53:11PM +0800, Sam Li wrote: > To configure the zoned format feature on the qcow2 driver, it > requires settings as: the device size, zone model, zone size, > zone capacity, number of conventional zones, limits on zone > resources (max append sectors, max open zones, and

Re: [PATCH v24 09/21] qapi/s390x/cpu topology: set-cpu-topology qmp command

2023-09-28 Thread Thomas Huth
On 26/09/2023 14.15, Nina Schoetterl-Glausch wrote: From: Pierre Morel The modification of the CPU attributes are done through a monitor command. It allows to move the core inside the topology tree to optimize the cache usage in the case the host's hypervisor previously moved the CPU. The

[PATCH v2 53/53] migration/rdma: Replace flawed device detail dump by tracing

2023-09-28 Thread Markus Armbruster
qemu_rdma_dump_id() dumps RDMA device details to stdout. rdma_start_outgoing_migration() calls it via qemu_rdma_source_init() and qemu_rdma_resolve_host() to show source device details. rdma_start_incoming_migration() arranges its call via rdma_accept_incoming_migration() and qemu_rdma_accept()

Re: [PATCH] qtest/migration: Add a test for the analyze-migration script

2023-09-28 Thread Fabiano Rosas
Thomas Huth writes: > On 28/09/2023 15.32, Fabiano Rosas wrote: >> Thomas Huth writes: >> >>> On 27/09/2023 23.47, Fabiano Rosas wrote: Add a smoke test that migrates to a file and gives it to the script. It should catch the most annoying errors such as changes in the ram flags.

Re: [PATCH v1 1/9] qapi: golang: Generate qapi's enum types in Go

2023-09-28 Thread Daniel P . Berrangé
On Wed, Sep 27, 2023 at 01:25:36PM +0200, Victor Toso wrote: > This patch handles QAPI enum types and generates its equivalent in Go. > > Basically, Enums are being handled as strings in Golang. > > 1. For each QAPI enum, we will define a string type in Go to be the >assigned type of this

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-28 Thread Jonathan Cameron via
On Wed, 27 Sep 2023 12:42:40 -0300 Jason Gunthorpe wrote: > On Wed, Sep 27, 2023 at 03:03:09PM +, Vikram Sethi wrote: > > > From: Alex Williamson > > > Sent: Wednesday, September 27, 2023 9:25 AM > > > To: Jason Gunthorpe > > > Cc: Jonathan Cameron ; Ankit Agrawal > > > ; David Hildenbrand

Re: [PATCH 03/19] hw/cxl/mbox: Pull the CCI definition out of the CXLDeviceState

2023-09-28 Thread Fan Ni
On Mon, Sep 25, 2023 at 05:11:08PM +0100, Jonathan Cameron wrote: > Enables having multiple CCIs per devices. Each CCI (mailbox) has it's own > state and command list, so they can't share a single structure. > > Signed-off-by: Jonathan Cameron > --- Reviewed-by: Fan Ni >

[PATCH v2 37/53] migration/rdma: Convert qemu_rdma_exchange_get_response() to Error

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 49/53] migration/rdma: Silence qemu_rdma_block_for_wrid()

2023-09-28 Thread Markus Armbruster
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is

[PATCH v2 48/53] migration/rdma: Don't report received completion events as error

2023-09-28 Thread Markus Armbruster
When qemu_rdma_wait_comp_channel() receives an event from the completion channel, it reports an error "receive cm event while wait comp channel,cm event is T", where T is the numeric event type. However, the function fails only when T is a disconnect or device removal. Events other than these two

  1   2   3   >