Re: [PATCH v6 3/7] qemu-nbd: Use qcrypto_tls_creds_check_endpoint()

2021-06-28 Thread Akihiko Odaki
Tested-by: Akihiko Odaki 2021年6月29日(火) 1:09 Philippe Mathieu-Daudé : > > Avoid accessing QCryptoTLSCreds internals by using > the qcrypto_tls_creds_check_endpoint() helper. > > Signed-off-by: Philippe Mathieu-Daudé > --- > qemu-nbd.c | 19 +++ > 1 fi

[PATCH] block/file-posix: Use O_RDWR for locking on macOS

2021-07-06 Thread Akihiko Odaki
qemu_lock_fd_test always returns 0 when fd is not open for writing and exclusive is true on macOS 11.3.1. Signed-off-by: Akihiko Odaki --- block/file-posix.c | 17 + 1 file changed, 17 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index b3fbb9bd63a

[PATCH v5 1/3] block/file-posix: Optimize for macOS

2021-07-05 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- block/file-posix.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index b3fbb9bd63a..80da1f59a60 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -44,6 +44,7 @@ #if defined

[PATCH v5 2/3] block: Add backend_defaults property

2021-07-05 Thread Akihiko Odaki
utilize backend information more aggressively. By default, it is auto, which uses backend information for block sizes and ignores the others, which is consistent with the older versions. Signed-off-by: Akihiko Odaki --- hw/block/block.c | 42

[PATCH v5 3/3] block/io: Merge discard request alignments

2021-07-05 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- block/io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/io.c b/block/io.c index 323854d0633..db19ae2bd9c 100644 --- a/block/io.c +++ b/block/io.c @@ -125,6 +125,8 @@ void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll) static void

Re: [PATCH v6 3/7] qemu-nbd: Use qcrypto_tls_creds_check_endpoint()

2021-06-29 Thread Akihiko Odaki
I tested only with qemu-nbd. Other files were compiled successfully but I have not tested them. On Tue, Jun 29, 2021 at 4:01 PM Philippe Mathieu-Daudé wrote: > > On 6/29/21 4:52 AM, Akihiko Odaki wrote: > > Tested-by: Akihiko Odaki > > Thanks! Does this apply to this single pa

[v4 1/3] block/file-posix: Optimize for macOS

2021-04-02 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- block/file-posix.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 05079b40cae..8f25e194fcd 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -44,6 +44,7 @@ #if defined

[v4 2/3] block: Add backend_defaults property

2021-04-02 Thread Akihiko Odaki
utilize backend information more aggressively. By default, it is auto, which uses backend information for block sizes and ignores the others, which is consistent with the older versions. Signed-off-by: Akihiko Odaki --- hw/block/block.c | 42

[v4 3/3] block/io: Merge discard request alignments

2021-04-02 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- block/io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/io.c b/block/io.c index ca2dca30070..aad74bd6714 100644 --- a/block/io.c +++ b/block/io.c @@ -124,6 +124,8 @@ void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll) static void

[v5 1/3] block/file-posix: Optimize for macOS

2021-04-02 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- block/file-posix.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 05079b40cae..89e8ed9f801 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -44,6 +44,7 @@ #if defined

[v5 2/3] block: Add backend_defaults property

2021-04-02 Thread Akihiko Odaki
utilize backend information more aggressively. By default, it is auto, which uses backend information for block sizes and ignores the others, which is consistent with the older versions. Signed-off-by: Akihiko Odaki --- hw/block/block.c | 42

[v5 3/3] block/io: Merge discard request alignments

2021-04-02 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- block/io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/io.c b/block/io.c index ca2dca30070..aad74bd6714 100644 --- a/block/io.c +++ b/block/io.c @@ -124,6 +124,8 @@ void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll) static void

Re: [PATCH v2] block/file-posix: Optimize for macOS

2021-03-09 Thread Akihiko Odaki
2021年3月9日(火) 19:26 Daniel P. Berrangé : > > On Tue, Mar 09, 2021 at 10:37:18AM +0100, Kevin Wolf wrote: > > Am 09.03.2021 um 05:52 hat Akihiko Odaki geschrieben: > > > 2021年3月9日(火) 0:37 Akihiko Odaki : > > > > > > > > 2021年3月9日(火) 0:17 Stefan Hajn

[PATCH v3 1/2] block/file-posix: Optimize for macOS

2021-03-10 Thread Akihiko Odaki
rity and 0 to other members for the default values. Thanks to Konstantin Nazarov for detailed analysis of a flaw in an old version of this change: https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3654667 Signed-off-by: Akihiko Odaki --- block/file-posix

[PATCH v3 2/2] block: Add backend_defaults property

2021-03-10 Thread Akihiko Odaki
a physical device backend. Signed-off-by: Akihiko Odaki --- block/file-posix.c | 2 ++ block/nvme.c | 1 + hw/block/block.c | 27 ++- include/block/block.h| 1 + include/hw/block/block.h | 3 +++ 5 files changed, 29 insertions(+), 5 deletions

Re: [PATCH v2] block/file-posix: Optimize for macOS

2021-03-08 Thread Akihiko Odaki
implementing bdrv_probe_blocksizes. As far as I know, the values they report are already used by default, which is contrary to the default not being "host". Regards, Akihiko Odaki

Re: [PATCH v2] block/file-posix: Optimize for macOS

2021-03-08 Thread Akihiko Odaki
2021年3月9日(火) 0:37 Akihiko Odaki : > > 2021年3月9日(火) 0:17 Stefan Hajnoczi : > > > > The live migration compatibility issue is still present. Migrating to > > another host might not work if the block limits are different. > > > > Here is an idea for solving

Re: [PATCH] block/file-posix: Optimize for macOS

2021-02-24 Thread Akihiko Odaki
2021年2月25日(木) 2:31 Kevin Wolf : > > Am 24.02.2021 um 17:27 hat Stefan Hajnoczi geschrieben: > > On Fri, Feb 19, 2021 at 05:51:48PM +0900, Akihiko Odaki wrote: > > > This commit introduces "punch hole" operation and optimizes transfer > > > block size for m

[PATCH v4] virtio-blk: Respect discard granularity

2021-02-24 Thread Akihiko Odaki
types to avoid migration issues. Signed-off-by: Akihiko Odaki --- hw/block/virtio-blk.c | 8 +++- hw/core/machine.c | 4 +++- include/hw/virtio/virtio-blk.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c

[PATCH v2] virtio-blk: Respect discard granularity

2021-02-22 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/block/virtio-blk.c | 8 +++- hw/core/machine.c | 9 - include/hw/virtio/virtio-blk.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index bac2d6fa2b2

[PATCH v3] virtio-blk: Respect discard granularity

2021-02-23 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/block/virtio-blk.c | 8 +++- hw/core/machine.c | 4 +++- include/hw/virtio/virtio-blk.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index bac2d6fa2b2

[PATCH v2] block/file-posix: Optimize for macOS

2021-03-05 Thread Akihiko Odaki
rity and 0 to other members for the default values. Thanks to Konstantin Nazarov for detailed analysis of a flaw in an old version of this change: https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3654667 Signed-off-by: Akihiko Odaki --- block/file-posix

[PATCH] virtio-blk: Respect discard granularity

2021-02-19 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/block/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index bac2d6fa2b2..692fd17b0e0 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -965,7 +965,7 @@ static void

[PATCH] block/file-posix: Optimize for macOS

2021-02-19 Thread Akihiko Odaki
rity and 0 to other members for the default values. Signed-off-by: Akihiko Odaki --- block/file-posix.c| 40 ++-- block/nvme.c | 2 ++ hw/block/block.c | 12 ++-- include/block/block.h | 2 ++ 4 files changed, 52 insertions(+), 4

Re: [PATCH] block/file-posix: Fix return value translation for AIO discards.

2021-10-18 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki On Tue, Oct 19, 2021 at 3:08 AM Ari Sundholm wrote: > > AIO discards regressed as a result of the following commit: > 0dfc7af2 block/file-posix: Optimize for macOS > > When trying to run blkdiscard within a Linux guest, the request would &g

Re: [PATCH v2 6/6] gitlab-ci: Support macOS 12 via cirrus-run

2022-01-10 Thread Akihiko Odaki
diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" and #pragma clang diagnostic pop Regards, Akihiko Odaki --- Generated using lcitool from: https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/210 --- .gitlab-ci.d/cirrus.yml | 16

Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12

2022-01-10 Thread Akihiko Odaki
12.0 and its existence does not mean that kAudioObjectPropertyElementMain is defined. I suggest the following: #if !__is_identifier(kAudioObjectPropertyElementMain) #define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster #endif Regards, Akihiko Odaki

Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12

2022-01-10 Thread Akihiko Odaki
On 2022/01/11 6:05, Christian Schoenebeck wrote: On Montag, 10. Januar 2022 21:39:28 CET Akihiko Odaki wrote: On 2022/01/11 5:22, Christian Schoenebeck wrote: On Montag, 10. Januar 2022 20:01:40 CET Akihiko Odaki wrote: On 2022/01/11 3:46, Christian Schoenebeck wrote: On Montag, 10

Re: [PATCH v12 3/7] net/vmnet: implement shared mode (vmnet-shared)

2022-01-13 Thread Akihiko Odaki
t; > #include "vmnet_int.h" > #include "clients.h" > -#include "qemu/error-report.h" > -#include "qapi/error.h" > > #include > > +typedef struct VmnetSharedState { > + VmnetCommonState cs; > +} VmnetSharedState; > + > +

Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12

2022-01-10 Thread Akihiko Odaki
On 2022/01/11 5:22, Christian Schoenebeck wrote: On Montag, 10. Januar 2022 20:01:40 CET Akihiko Odaki wrote: On 2022/01/11 3:46, Christian Schoenebeck wrote: On Montag, 10. Januar 2022 19:20:15 CET Akihiko Odaki wrote: On 2022/01/10 22:22, Peter Maydell wrote: On Mon, 10 Jan 2022 at 13

Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12

2022-01-10 Thread Akihiko Odaki
On 2022/01/11 3:46, Christian Schoenebeck wrote: On Montag, 10. Januar 2022 19:20:15 CET Akihiko Odaki wrote: On 2022/01/10 22:22, Peter Maydell wrote: On Mon, 10 Jan 2022 at 13:14, Christian Schoenebeck wrote: I'd suggest to use: #if !defined(MAC_OS_VERSION_12_0

Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12

2022-01-10 Thread Akihiko Odaki
nce of the two macros because they have the same value in QEMU and kAudioObjectPropertyElementMain is a constant resolved compile-time, but it is still nice to have the code semantically correct. Regards, Akihiko Odaki

Re: [PATCH v5 10/16] audio/coreaudio: Remove a deprecation warning on macOS 12

2022-02-14 Thread Akihiko Odaki
n > ^ > > Replace by kAudioObjectPropertyElementMain, redefining it to > kAudioObjectPropertyElementMaster if not available. > > Suggested-by: Akihiko Odaki > Suggested-by: Christian Schoenebeck > Suggested-by: Roman Bolshakov > Reviewed-by: Christian

Re: [PATCH v7 13/22] osdep: Avoid using Clang-specific __builtin_available()

2022-03-06 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki On Mon, Mar 7, 2022 at 8:19 AM Philippe Mathieu-Daudé wrote: > > From: Philippe Mathieu-Daudé > > Remove the Clang specific __builtin_available() to allow building > with GCC, otherwise we get: > > include/qemu

Re: [PATCH v7 14/22] meson: Resolve the entitlement.sh script once for good

2022-03-06 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki On Mon, Mar 7, 2022 at 8:19 AM Philippe Mathieu-Daudé wrote: > > From: Philippe Mathieu-Daudé > > Commit 235b523dba ("meson: Use find_program() to resolve the > entitlement.sh script") didn't correctly fixed t

Re: [PATCH v7 15/22] meson: Log QEMU_CXXFLAGS content in summary

2022-03-06 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki On Mon, Mar 7, 2022 at 8:19 AM Philippe Mathieu-Daudé wrote: > > From: Philippe Mathieu-Daudé > > Signed-off-by: Philippe Mathieu-Daudé > --- > meson.build | 1 + > 1 file changed, 1 insertion(+) > > diff --git

Re: [PATCH v7 16/22] configure: Pass filtered QEMU_OBJCFLAGS to meson

2022-03-06 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki On Mon, Mar 7, 2022 at 8:19 AM Philippe Mathieu-Daudé wrote: > > From: Philippe Mathieu-Daudé > > Filter unsupported Objective-C options, to avoid > 'unknown-warning-option' warnings when using Clang: > > [34/373]

Re: [PATCH v7 17/22] ui/cocoa: Constify qkeycode translation arrays

2022-03-06 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki On Mon, Mar 7, 2022 at 8:19 AM Philippe Mathieu-Daudé wrote: > > From: Philippe Mathieu-Daudé > > Reported-by: Peter Maydell > Signed-off-by: Philippe Mathieu-Daudé > --- > ui/cocoa.m | 4 ++-- > 1 file cha

Re: [PATCH] ui/cocoa: Do not alert even without block devices

2022-02-14 Thread Akihiko Odaki
On Mon, Feb 14, 2022 at 9:31 PM Philippe Mathieu-Daudé wrote: > Is this menu updated when removable blkdev are hot-plugged from > the monitor or QMP? Actually no.

Re: [PATCH 10/11] net/eth: Clean up local variable shadowing

2023-09-01 Thread Akihiko Odaki
On 2023/09/01 7:56, Philippe Mathieu-Daudé wrote: Fix: net/eth.c:435:20: error: declaration shadows a local variable [-Werror,-Wshadow] size_t input_size = iov_size(pkt, pkt_frags); ^ net/eth.c:413:16: note: previous declaration is here size_t

Re: [PATCH v2 15/22] net/eth: Clean up local variable shadowing

2023-09-09 Thread Akihiko Odaki
input_size = iov_size(pkt, pkt_frags); ^ Suggested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- net/eth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/eth.c b/net/eth.c index 649e66bb1f..3f680cc033 100644 --- a/net/eth.c +++ b/net/eth.c @@ -432,8 +432,6

Re: [PATCH v2 01/12] build: Only define OS_OBJECT_USE_OBJC with gcc

2023-08-31 Thread Akihiko Odaki
On 2023/08/31 17:59, Alexander Graf wrote: On 31.08.23 10:53, Akihiko Odaki wrote: On 2023/08/31 17:12, Philippe Mathieu-Daudé wrote: On 30/8/23 18:14, Alexander Graf wrote: Recent versions of macOS use clang instead of gcc. The OS_OBJECT_USE_OBJC define is only necessary when building

Re: [PATCH v2 01/12] build: Only define OS_OBJECT_USE_OBJC with gcc

2023-08-31 Thread Akihiko Odaki
Silicon Mac that is incompatible with GCC. Regards, Akihiko Odaki

[PATCH v3 0/8] util: Introduce qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
get_user_cache_dir() when $XDG_DATA_DIRS is not available. In the case, we rather use: get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") V2 -> V3: Rebase to the current master. Dropped patch "qga: Remove platform GUID definitions" since it is irrelevant. V1 -> V2:

[PATCH v3 5/8] scsi: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki --- scsi/qemu-pr-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index c6c6347e9b..507f23357f 100644 --- a/scsi/qemu-pr

[PATCH v3 3/8] contrib/rdmacm-mux: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default Unix socket path. Signed-off-by: Akihiko Odaki --- contrib/rdmacm-mux/main.c | 22 ++ contrib/rdmacm-mux/meson.build | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/contrib/rdmacm-mux

[PATCH v3 7/8] util: Remove qemu_get_local_state_dir()

2023-09-21 Thread Akihiko Odaki
There are no users of the function anymore. Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 8 util/oslib-posix.c | 6 -- util/oslib-win32.c | 10 -- 3 files changed, 24 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index bb857c910f

[PATCH v3 4/8] qga: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki --- qga/main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index 8668b9f3d3..145ee02df3 100644 --- a/qga/main.c +++ b/qga/main.c

[PATCH v3 1/8] util: Introduce qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
get_user_cache_dir() when $XDG_DATA_DIRS is not available. In the case, we rather use: get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 12 util/oslib-posix.c | 11 +++ util/oslib-win32.c | 26

[PATCH v3 8/8] spice-app: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() provides QEMU-specific fallback of runtime directory. Signed-off-by: Akihiko Odaki --- ui/spice-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-app.c b/ui/spice-app.c index 405fb7f9f5..f6c2343213 100644 --- a/ui/spice-app.c +++ b/ui

Re: [PATCH v2 01/10] qga: Remove platform GUID definitions

2023-09-21 Thread Akihiko Odaki
On 2022/11/17 18:45, Konstantin Kostiuk wrote: Reviewed-by: Konstantin Kostiuk <mailto:kkost...@redhat.com>> Will merge this patch in QGA series On Thu, Nov 10, 2022 at 12:06 PM Akihiko Odaki <mailto:akihiko.od...@daynix.com>> wrote: GUID

[PATCH v3 6/8] module: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki --- util/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e263163c..580658edf4 100644 --- a/util/module.c +++ b/util/module.c

[PATCH v3 2/8] ivshmem-server: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default PID file path. Signed-off-by: Akihiko Odaki --- contrib/ivshmem-server/main.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index

Re: [PATCH v2 07/10] virtiofsd: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
On 2023/09/21 21:58, Stefan Hajnoczi wrote: On Thu, Nov 10, 2022 at 07:06:26PM +0900, Akihiko Odaki wrote: qemu_get_runtime_dir() is used to construct the path to a lock file. Signed-off-by: Akihiko Odaki --- tools/virtiofsd/fuse_virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3

Re: [PATCH 4/4] tests/qtest: Use qtest_get_base_arch()

2023-10-10 Thread Akihiko Odaki
On 2023/10/10 16:49, Philippe Mathieu-Daudé wrote: Additionally use qtest_get_arch_bits() when relevant. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki

Re: [PATCH v3 10/16] ui/cocoa: Clean up global variable shadowing

2023-10-04 Thread Akihiko Odaki
] && [cocoaView handleEvent:event]) { +if ([view isMouseGrabbed] && [view handleEvent:event]) { COCOA_DEBUG("Global events tap: qemu handled the event, capturing!\n"); return NULL; } Reviewed-by: Akihiko Odaki

[PATCH] msix: Assert that specified vector is in range

2022-08-29 Thread Akihiko Odaki
it is sometimes too late to check the vector range in msix functions. Signed-off-by: Akihiko Odaki --- hw/net/e1000e.c | 15 ++--- hw/net/rocker/rocker.c| 23 ++ hw/net/vmxnet3.c | 27 +++- hw/nvme/ctrl.c| 5 +-- hw/pci/msix.c | 24

[PATCH v2] pci: Assert that capabilities never overlap

2022-08-30 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt| 4 +-- hw/display/bochs-display.c | 4 +-- hw/i386/amd_iommu.c| 18 ++- hw/ide/ich.c | 8 ++--- hw/net/e1000e.c| 22 +++-- hw/ne

Re: [PATCH] pci: Abort if pci_add_capability fails

2022-08-31 Thread Akihiko Odaki
literal offset, we > can recover safely by failing the hot plug. > > But perhaps the offset comes from a table, and some other bug scribbled > over it. Continuing the process is *unsafe*, and may increase the > damage and/or obstruct the root cause. > > The former kind of bug is unlikely to survive even cursory testing. > Whatever kind of programming error it is, it is dangerous to attempt to recover from it using an error handling code path untested for a long period. I think it is better to have some common code to recover from assertion failures. For example, we may have some option to print "oops" just like Linux does when an assertion fails and let the user handle it. That is quite out of scope of this change though. Regards, Akihiko Odaki

Re: [PATCH v2] pci: Assert that capabilities never overlap

2022-09-04 Thread Akihiko Odaki
On Fri, Sep 2, 2022 at 7:23 PM Markus Armbruster wrote: > > Akihiko Odaki writes: > > > pci_add_capability appears most PCI devices. Its error handling required > > lots of code, and led to inconsistent behaviors such as: > > - passing error_abort > > - pa

Re: [PATCH v2] pci: Assert that capabilities never overlap

2022-09-29 Thread Akihiko Odaki
On Mon, Sep 5, 2022 at 7:11 PM Akihiko Odaki wrote: > > On Mon, Sep 5, 2022 at 6:26 PM Markus Armbruster wrote: > > > > Akihiko Odaki writes: > > > > > On Fri, Sep 2, 2022 at 7:23 PM Markus Armbruster > > > wrote: > > >> > > >>

[PATCH v2 14/17] hw/vfio/pci-quirks: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/vfio/pci-quirks.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index f0147a050a..e94fd273ea 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1530,7 +1530,7

[PATCH v2 15/17] hw/vfio/pci: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/vfio/pci.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 939dcc3d4a..2b653d01e3 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -1826,7 +1826,7 @@ static void vfio_add_emulated_long

[PATCH v2 06/17] hw/nvme: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/nvme/ctrl.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 87aeba0564..ff4e2beea6 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -7325,17 +7325,9 @@ static void nvme_init_sriov

[PATCH v2 05/17] eepro100: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/net/eepro100.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 679f52f80f..bf2ecdded9 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -549,12 +549,7 @@ static void e100_pci_reset

[PATCH v2 02/17] hw/i386/amd_iommu: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/i386/amd_iommu.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 725f69095b..8a88cbea0a 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1539,7 +1539,6

[PATCH v2 12/17] pci/slotid: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci/slotid_cap.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/pci/slotid_cap.c b/hw/pci/slotid_cap.c index 36d021b4a6..5da8c82133 100644 --- a/hw/pci/slotid_cap.c +++ b/hw/pci/slotid_cap.c @@ -12,7 +12,7 @@ int slotid_cap_init

[PATCH v2 16/17] virtio-pci: Omit errp for pci_add_capability

2022-10-22 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/virtio/virtio-pci.c | 9 ++--- include/hw/pci/pci.h | 12 ++-- include/hw/virtio/virtio-pci.h | 2 +- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index

[PATCH v2 00/17] pci: Abort if pci_add_capability fails

2022-10-21 Thread Akihiko Odaki
. v2: Split the patch (Markus Armbruster) Akihiko Odaki (17): pci: Allow to omit errp for pci_add_capability hw/i386/amd_iommu: Omit errp for pci_add_capability ahci: Omit errp for pci_add_capability e1000e: Omit errp for pci_add_capability eepro100: Omit errp for pci_add_capability h

[PATCH v2 04/17] e1000e: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/net/e1000e.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index ac96f7665a..e433b8f9a5 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -377,17 +377,10 @@ e1000e_gen_dsn(uint8_t

[PATCH v2 13/17] hw/pci-bridge/pcie_pci_bridge: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci-bridge/pcie_pci_bridge.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c index 99778e3e24..1b839465e7 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw

[PATCH v2 09/17] pcie: Omit errp for pci_add_capability

2022-10-22 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt| 4 +-- hw/display/bochs-display.c | 4 +-- hw/net/e1000e.c| 4 +-- hw/pci-bridge/cxl_downstream.c | 9 ++ hw/pci-bridge/cxl_upstream.c | 8 ++--- hw/pci-bridge/pcie_pci_bridge.c

[PATCH v2 01/17] pci: Allow to omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
as the first step. Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 8 include/hw/pci/pci.h | 13 ++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2f450f6a72..8ee2171011 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c

[PATCH v2 11/17] msix: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci/msix.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 1e381a9813..28af83403b 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -311,7 +311,7 @@ int msix_init(struct PCIDevice *dev, unsigned

[PATCH v2 10/17] pci/shpc: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pcie_pci_bridge.c | 2 +- hw/pci/shpc.c | 23 ++- include/hw/pci/shpc.h | 3 +-- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/hw/pci-bridge

[PATCH v2 03/17] ahci: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/ide/ich.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 1007a51fcb..3b478b01f8 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -106,7 +106,7 @@ static void pci_ich9_ahci_init(Object *obj) static

[PATCH v2 07/17] msi: Omit errp for pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci/msi.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 058d1d1ef1..5283a08b5a 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -194,7 +194,6 @@ int msi_init(struct PCIDevice *dev, uint8_t offset

[PATCH v2 17/17] pci: Remove legacy errp from pci_add_capability

2022-10-21 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 8ee2171011..8ff71e4553 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2513,38 +2513,23 @@ static void

[PATCH v2 08/17] hw/pci/pci_bridge: Omit errp for pci_add_capability

2022-10-22 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci-bridge/i82801b11.c | 14 ++ hw/pci-bridge/pcie_root_port.c | 7 +-- hw/pci-bridge/xio3130_downstream.c | 8 ++-- hw/pci-bridge/xio3130_upstream.c | 8 ++-- hw/pci/pci_bridge.c| 21

[PATCH v3 01/16] pci: Allow to omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
as the first step. Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 8 include/hw/pci/pci.h | 13 ++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2f450f6a72..8ee2171011 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c

[PATCH v3 00/16] pci: Abort if pci_add_capability fails

2022-10-26 Thread Akihiko Odaki
tencies. v3: - Correct patch split between virtio-pci and pci (Markus Armbruster) - Add messages for individual patches (Markus Armbruster) - Acked-by: Jonathan Cameron v2: Split the patch (Markus Armbruster) Akihiko Odaki (16): pci: Allow to omit errp for pci_add_capability hw/i386/amd_iomm

[PATCH v3 10/16] pci/shpc: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of shpc_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge

[PATCH v3 05/16] eepro100: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate heare because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v3 14/16] hw/vfio/pci: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
mitting errp. Signed-off-by: Akihiko Odaki --- hw/vfio/pci-quirks.c | 15 +++ hw/vfio/pci.c| 14 +- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index f0147a050a..e94fd273ea 100644 --- a/hw/vfio/pci-quirks.c +

[PATCH v3 04/16] e1000e: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate heare because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v3 12/16] pci/slotid: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of slotid_cap_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci/slotid_cap.c | 8 ++-- 1 file changed, 2 insertions

[PATCH v3 13/16] hw/pci-bridge/pcie_pci_bridge: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate heare because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v3 08/16] hw/pci/pci_bridge: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of pci_bridge_ssvid_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci-bridge/i82801b11.c | 14

[PATCH v3 11/16] msix: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of msix_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci/msix.c | 8 ++-- 1 file changed, 2 insertions(+), 6

[PATCH v3 06/16] hw/nvme: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate heare because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v3 07/16] msi: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of msi_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci/msi.c | 9 + 1 file changed, 1 insertion(+), 8

[PATCH v3 03/16] ahci: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate heare because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v3 09/16] pcie: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of a PCIe function which calls pci_add_capability() in turn is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki Acked-by: Jonathan Cameron (for CXL parts) --- docs/pcie_sriov.txt

[PATCH v3 16/16] pci: Remove legacy errp from pci_add_capability

2022-10-26 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 29 +++-- include/hw/pci/pci.h | 12 ++-- 2 files changed, 9 insertions(+), 32 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 8ee2171011..8ff71e4553 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c

[PATCH v3 15/16] virtio-pci: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate heare because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v3 02/16] hw/i386/amd_iommu: Omit errp for pci_add_capability

2022-10-26 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate heare because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v4 08/17] msi: Omit errp for pci_add_capability

2022-10-27 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of msi_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci/msi.c | 9 + 1 file changed, 1 insertion(+), 8

[PATCH v4 11/17] pci/shpc: Omit errp for pci_add_capability

2022-10-27 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of shpc_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge

[PATCH v4 03/17] hw/i386/amd_iommu: Omit errp for pci_add_capability

2022-10-27 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate here because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v4 06/17] eepro100: Omit errp for pci_add_capability

2022-10-27 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate here because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

  1   2   3   4   5   >