Re: Rust BoF and maintainer minutes and planning the roadmap to Rust

2024-09-30 Thread Stefan Hajnoczi
On Mon, Sep 30, 2024, 06:24 Alex Bennée wrote: > Stefan Hajnoczi writes: > > > On Thu, 26 Sept 2024 at 10:24, Alex Bennée > wrote: > > >> Another potential area for conversion was the VirtIO device and > >> vhost-user code which could expect to re-use a

Re: [PATCH 03/14] rust: define traits and pointer wrappers to convert from/to C representations

2024-09-27 Thread Stefan Hajnoczi
On Mon, 1 Jul 2024 at 11:02, Paolo Bonzini wrote: > +/// A type for which there is a canonical representation as a C datum. > +pub trait CloneToForeign { > +/// The representation of `Self` as a C datum. Typically a > +/// `struct`, though there are exceptions for example `c_char` > +

Re: Rust BoF and maintainer minutes and planning the roadmap to Rust

2024-09-26 Thread Stefan Hajnoczi
g C code. - Adding Rust bindings to existing subsystems so that new code (e.g. device models) can optionally be written in Rust while still allowing new C code. Let's speak more broadly about "integrating Rust" rather than "conversion", which is just one of the ways to use Rust in

Re: [PULL 3/6] migration/multifd: Fix loop conditions in multifd_zstd_send_prepare and multifd_zstd_recv

2024-09-17 Thread Stefan Weil via
Am 17.09.24 um 23:55 schrieb Peter Xu: From: Stefan Weil via How can I avoid that my author name/email is changed so often? Will this be fixed automatically before the commit is merged? Stefan

[PULL 1/1] hw/block: fix uint32 overflow

2024-09-17 Thread Stefan Hajnoczi
From: Dmitry Frolov The product bs->bl.zone_size * (bs->bl.nr_zones - 1) may overflow uint32. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov Message-id: 20240917080356.270576-2-fro...@swemel.ru Signed-off-by: Stefan Hajnoczi --- hw

[PULL 0/1] Block patches

2024-09-17 Thread Stefan Hajnoczi
The following changes since commit ea9cdbcf3a0b8d5497cddf87990f1b39d8f3bb0a: Merge tag 'hw-misc-20240913' of https://github.com/philmd/qemu into staging (2024-09-15 18:27:40 +0100) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request for you

Re: [PATCH] hw/block: fix uint32 overflow

2024-09-17 Thread Stefan Hajnoczi
/virtio-blk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, applied to my block tree: https://gitlab.com/stefanha/qemu/commits/block Stefan signature.asc Description: PGP signature

Re: [PATCH v3 4/5] vhost-user-dev: Add cache BAR

2024-09-17 Thread Stefan Hajnoczi
On Tue, 17 Sept 2024 at 10:33, Stefan Hajnoczi wrote: > > On Thu, Sep 12, 2024 at 04:53:34PM +0200, Albert Esteve wrote: > > @@ -331,6 +333,37 @@ static void vub_device_realize(DeviceState *dev, Error > > **errp) > > do_vhost_user_cleanup(vdev, vub); > >

Re: [PATCH v3 4/5] vhost-user-dev: Add cache BAR

2024-09-17 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:53:34PM +0200, Albert Esteve wrote: > @@ -331,6 +333,37 @@ static void vub_device_realize(DeviceState *dev, Error > **errp) > do_vhost_user_cleanup(vdev, vub); > } > > +ret = vub->vhost_dev.vhost_ops->vhost_get_shmem_config(&vub->vhost_dev, > +

Re: [PATCH v3 4/5] vhost-user-dev: Add cache BAR

2024-09-17 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:53:34PM +0200, Albert Esteve wrote: > Add a cache BAR in the vhost-user-device > into which files can be directly mapped. > > The number, shmid, and size of the VIRTIO Shared > Memory subregions is retrieved through a get_shmem_config > message sent by the vhost-user-bas

Re: [PATCH v3 3/5] vhost_user: Add frontend command for shmem config

2024-09-17 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:53:33PM +0200, Albert Esteve wrote: > The frontend can use this command to retrieve > VIRTIO Shared Memory Regions configuration from > the backend. The response contains the number of > shared memory regions, their size, and shmid. > > This is useful when the frontend i

Re: [PATCH v3 3/5] vhost_user: Add frontend command for shmem config

2024-09-17 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:53:33PM +0200, Albert Esteve wrote: > The frontend can use this command to retrieve > VIRTIO Shared Memory Regions configuration from > the backend. The response contains the number of > shared memory regions, their size, and shmid. > > This is useful when the frontend i

Re: [PATCH v3 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-17 Thread Stefan Hajnoczi
On Tue, Sep 17, 2024 at 09:05:34AM +0200, Albert Esteve wrote: > On Mon, Sep 16, 2024 at 7:57 PM Stefan Hajnoczi wrote: > > > This patch series could use tests. The first two patches seem broken and > > testing would have revealed that the memory allocation and pointers are &

Re: [PATCH v3 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-16 Thread Stefan Hajnoczi
with --device vhost-user-device, and then use the qtest API to enumerate and access the VIRTIO Shared Memory Regions. Unfortunately this involves writing quite a bit of test code. I can explain it in more detail if you want. Does anyone have other ideas for testing? Stefan signature.asc

Re: [PATCH v3 2/5] virtio: Track shared memory mappings

2024-09-16 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:53:32PM +0200, Albert Esteve wrote: > Update shmem_list to be able to track > active mappings on VIRTIO shared memory > regions. This allows to verify that new > mapping request received from backends > do not overlap. If they do, the request > shall fail in order to adhe

Re: [PATCH v3 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-16 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:53:31PM +0200, Albert Esteve wrote: > Add SHMEM_MAP/UNMAP requests to vhost-user to > handle VIRTIO Shared Memory mappings. > > This request allows backends to dynamically map > fds into a VIRTIO Shared Memory Region indentified > by its `shmid`. Then, the fd memory is a

Re: [PATCH 0/3] Document SHMEM vhost-user requests

2024-09-16 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:44:29PM +0200, Albert Esteve wrote: > As a continuation of the > "Add SHMEM_MAP/UNMAP requests" patch [1], > I wanted to split vhost-user spec > parts into a separate patch, so that > it could be reviewed and integrated > separately. Having the specs upstreamed > would he

Re: [PATCH 1/3] vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec

2024-09-16 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:44:30PM +0200, Albert Esteve wrote: > Add SHMEM_MAP/_UNMAP request to the vhost-user > spec documentation. > > Signed-off-by: Albert Esteve > --- > docs/interop/vhost-user.rst | 31 +++ > 1 file changed, 31 insertions(+) > > diff --git a/do

Re: [PATCH 3/3] vhost_user.rst: Add GET_SHMEM_CONFIG message

2024-09-16 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 04:44:32PM +0200, Albert Esteve wrote: > Add GET_SHMEM_CONFIG vhost-user frontend > message to the spec documentation. > > Signed-off-by: Albert Esteve > --- > docs/interop/vhost-user.rst | 39 + > 1 file changed, 39 insertions(+) > >

Re: [PATCH 1/3] vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec

2024-09-16 Thread Stefan Hajnoczi
rMMap defined? Please keep patches self-contained and in a logical order so they can be reviewed linearly. Otherwise: Reviewed-by: Stefan Hajnoczi > + :reply payload: N/A > + > + This message can be submitted by the backends to advertise a new mapping > + to be made in a given VIRTIO Shar

Re: [PATCH v12 09/10] hw/nvme: add reservation protocal command

2024-09-13 Thread Stefan Hajnoczi
On Thu, Sep 12, 2024 at 07:19:16PM +0800, Changqi Lu wrote: > +static int nvme_read_reservation_cb(NvmeReadReservation *reservation) > +{ > +int rc; > +NvmeReservationStatus *nvme_status; > +NvmeRequest *req = reservation->req; > +NvmeCtrl *n = req->sq->ctrl; > +NvmeResvKeys *ke

Re: [PATCH] ppc/pnv: Add support for TPM with SPI interface

2024-09-12 Thread Stefan Berger
On 9/12/24 12:09 PM, dan tan wrote: From: dan tan SPI interface to TPM TIS implementation via swtpm Apart from Cedric's comments: Can you say a bit more about the specs you followed and details how many localities are supported etc. Is this device pnv-specific or can it be used on other

Re: [RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-11 Thread Stefan Hajnoczi
On Wed, 11 Sept 2024 at 07:58, Albert Esteve wrote: > On Thu, Sep 5, 2024 at 6:45 PM Stefan Hajnoczi wrote: >> >> On Tue, Sep 03, 2024 at 01:54:12PM +0200, Albert Esteve wrote: >> > On Tue, Sep 3, 2024 at 11:54 AM Albert Esteve wrote: >> > >> > >

Re: [PATCH v11 09/10] hw/nvme: add reservation protocal command

2024-09-10 Thread Stefan Hajnoczi
On Mon, Sep 09, 2024 at 07:34:52PM +0800, Changqi Lu wrote: > Add reservation acquire, reservation register, > reservation release and reservation report commands > in the nvme device layer. > > By introducing these commands, this enables the nvme > device to perform reservation-related tasks, inc

[PATCH] migration/multifd: Fix loop conditions in multifd_zstd_send_prepare and multifd_zstd_recv

2024-09-09 Thread Stefan Weil via
GitHub's CodeQL reports four critical errors which are fixed by this commit: Unsigned difference expression compared to zero An expression (u - v > 0) with unsigned values u, v is only false if u == v, so all changed expressions did not work as expected. Signed-off-by: Stefan Weil

[PATCH] Fix calculation of minimum in colo_compare_tcp

2024-09-09 Thread Stefan Weil via
GitHub's CodeQL reports a critical error which is fixed by using the MIN macro: Unsigned difference expression compared to zero Signed-off-by: Stefan Weil --- net/colo-compare.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-comp

Re: [PATCH 1/3] ui/sdl2: reenable the SDL2 Windows keyboard hook procedure

2024-09-09 Thread Stefan Weil via
ibility with < 2.0.16. This would help reduce the potential combinations of versions and bugs reports. [...] I agree. My builds for Windows typically use the very latest versions, for example mingw-w64-i686-SDL2-2.30.7-1-any for the next build. So depending on a recent SDL version would be fine for me. Stefan W.

Re: [RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-06 Thread Stefan Hajnoczi
On Fri, 6 Sept 2024 at 03:06, Albert Esteve wrote: > On Thu, Sep 5, 2024 at 6:39 PM Stefan Hajnoczi wrote: >> >> On Tue, Sep 03, 2024 at 10:42:34AM +0200, Albert Esteve wrote: >> > Hello all, >> > >> > Sorry, I have been a bit disconnected from this thre

Re: [RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-06 Thread Stefan Hajnoczi
On Fri, 6 Sept 2024 at 00:19, David Stevens wrote: > > On Fri, Sep 6, 2024 at 12:56 AM Stefan Hajnoczi wrote: > > > > On Tue, Jul 16, 2024 at 10:21:35AM +0900, David Stevens wrote: > > > On Fri, Jul 12, 2024 at 2:47 PM Michael S. Tsirkin > > > wrote: > &

Re: [RFC PATCH v2 5/5] vhost_user: Implement mem_read/mem_write handlers

2024-09-05 Thread Stefan Hajnoczi
On Wed, Sep 04, 2024 at 03:01:06PM +0200, Albert Esteve wrote: > On Thu, Jul 11, 2024 at 10:55 AM Stefan Hajnoczi > wrote: > > > On Fri, Jun 28, 2024 at 04:57:10PM +0200, Albert Esteve wrote: > > > Implement function handlers for memory read and write > > > oper

Re: [RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-05 Thread Stefan Hajnoczi
On Tue, Sep 03, 2024 at 01:54:12PM +0200, Albert Esteve wrote: > On Tue, Sep 3, 2024 at 11:54 AM Albert Esteve wrote: > > > > > > > On Thu, Jul 11, 2024 at 9:45 AM Stefan Hajnoczi > > wrote: > > > >> On Fri, Jun 28, 2024 at 04:57:06PM +0200, Al

Re: [RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-05 Thread Stefan Hajnoczi
that frequently MAP/UNMAP like virtiofs. Will virtio-gpu and virtio-media use MAP/UNMAP often at runtime? They might be able to get away with this simple solution. I'd be happy with that. If someone wants to make virtiofs DAX faster, they can implement READ/WRITE_MEM or another solution later,

Re: [RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-05 Thread Stefan Hajnoczi
> > > > > > It would be great if this could be standardised between QEMU and crosvm > > > > (and therefore have a clearer path toward being implemented in other > > > > VMMs)! > > > > > > Setting aside vhost-user for a moment, the DAX exa

Re: [PATCH v2 05/17] thread-pool: Implement non-AIO (generic) pool support

2024-09-03 Thread Stefan Hajnoczi
On Tue, 3 Sept 2024 at 12:54, Maciej S. Szmigiero wrote: > > On 3.09.2024 15:55, Stefan Hajnoczi wrote: > > On Tue, 27 Aug 2024 at 13:58, Maciej S. Szmigiero > > wrote: > >> > >> From: "Maciej S. Szmigiero" > >> > >> Migrati

Re: [PATCH v2 05/17] thread-pool: Implement non-AIO (generic) pool support

2024-09-03 Thread Stefan Hajnoczi
On Tue, 27 Aug 2024 at 13:58, Maciej S. Szmigiero wrote: > > From: "Maciej S. Szmigiero" > > Migration code wants to manage device data sending threads in one place. > > QEMU has an existing thread pool implementation, however it was limited > to queuing AIO operations only and essentially had a

[PATCH v3 1/2] qdev-monitor: avoid QemuOpts in QMP device_add

2024-08-27 Thread Stefan Hajnoczi
h. The code ended up very close to what he suggested. Suggested-by: Markus Armbruster Cc: Daniel P. Berrangé Signed-off-by: Stefan Hajnoczi --- system/qdev-monitor.c | 44 --- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/system/qde

[PATCH v3 2/2] vl: use qmp_device_add() in qemu_create_cli_devices()

2024-08-27 Thread Stefan Hajnoczi
and use qmp_device_add(). Cc: Peter Krempa Reviewed-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- system/vl.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/system/vl.c b/system/vl.c index 01b8b8e77a..3db63af764 100644 --- a/system/vl.c +++ b

[PATCH v3 0/2] qdev-monitor: avoid QemuOpts in QMP device_add()

2024-08-27 Thread Stefan Hajnoczi
device_add (e.g. virtio-blk-pci,iothread-vq-mapping=). Stop converting from QDict to QemuOpts and back again as this loses type information and cannot represent non-scalars. Stefan Hajnoczi (2): qdev-monitor: avoid QemuOpts in QMP device_add vl: use qmp_device_add() in qemu_create_cli_devices(

Re: [PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add

2024-08-27 Thread Stefan Hajnoczi
On Tue, Aug 13, 2024 at 09:18:46AM +0100, Paul Durrant wrote: > On 12/08/2024 19:15, Stefan Hajnoczi wrote: > > On Fri, Aug 02, 2024 at 10:10:43AM +0200, Markus Armbruster wrote: > > > Can we additionally cut out the QemuOpts middleman in > > > usbback_portid_add

Re: [PATCH v1] softmmu/physmem: fix memory leak in dirty_memory_extend()

2024-08-27 Thread Stefan Hajnoczi
On Tue, 27 Aug 2024 at 13:24, David Hildenbrand wrote: > > On 27.08.24 18:52, Stefan Hajnoczi wrote: > > On Tue, 27 Aug 2024 at 04:38, David Hildenbrand wrote: > >> > >> As reported by Peter, we might be leaking memory when removing the > >> highest RAMBlo

Re: [PATCH v1] softmmu/physmem: fix memory leak in dirty_memory_extend()

2024-08-27 Thread Stefan Hajnoczi
L=AfX6A4kScq=vssk0pe...@mail.gmail.com > Reported-by: Peter Maydell > Fixes: 5b82b703b69a ("memory: RCU ram_list.dirty_memory[] for safe RAM > hotplug") > Cc: qemu-sta...@nongnu.org > Cc: Stefan Hajnoczi > Cc: Paolo Bonzini > Cc: Peter Xu > Cc: "Philippe Ma

Re: [PATCH for-9.1] nbd/server: CVE-2024-7409: Avoid use-after-free when closing server

2024-08-26 Thread Stefan Hajnoczi
7;/path/to/build/qemu-nbd -L -k /tmp/nbd-sock') > > > > def test(): > > sst = Thread(target=start_stop) > > sst.start() > > nlt = Thread(target=nbd_list) > > nlt.start() > > > > sst.join() > > nlt.join() > > &g

Re: [PATCH] .travis.yml: Install python3-tomli in all build jobs

2024-08-20 Thread Stefan Weil via
ever is "qemu", he/she might do the same as you did and write to the Travis support. And https://travis-ci.org/qemu/qemu could be replaced by https://app.travis-ci.com/github/qemu/qemu in MAINTAINERS. Stefan

Re: [PATCH] meson.build: Check for the availability of __attribute__((gcc_struct)) on MSYS2

2024-08-15 Thread Stefan Weil via
ibute__((gcc_struct));', + args: '-Werror') +error('Your compiler does not support __attribute__((gcc_struct)) - please use GCC instead of Clang') + endif endif # __sync_fetch_and_and requires at least -march=i486. Many toolchains Tested-by: Stefan Weil

Re: [PATCH] dma-helpers: Fix iovec alignment

2024-08-13 Thread Stefan Fritsch
On Mon, 12 Aug 2024, John Snow wrote: > On Tue, Apr 16, 2024 at 7:54 AM Stefan Fritsch wrote: > > > adding John Snow to CC because he investigated this in 2020. > > > > On Fri, 12 Apr 2024, Eric Blake wrote: > > > > > On Fri, Apr 12, 2024 at

[PATCH-for-9.1] docs: Fix some typos (found by typos) and grammar issues

2024-08-13 Thread Stefan Weil via
Fix the misspellings of "overriden" also in code comments. Signed-off-by: Stefan Weil --- docs/devel/migration/uadk-compression.rst | 4 ++-- docs/interop/qemu-ga.rst | 2 +- docs/tools/qemu-vmsr-helper.rst | 4 ++-- hw/arm/smmu-common.c

Drop support for Python 3.7?

2024-08-13 Thread Stefan Weil via
which still mentions Python 3.7 or even 3.5 and 3.6 could be reviewed and maybe simplified, but I think this is less urgent and can be done after QEMU release 9.1.0. Regards Stefan W. $ git grep -i python.*3.7 docs/about/build-platforms.rst: As of QEMU |version|, the minimum supported version of

Re: [PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add

2024-08-12 Thread Stefan Hajnoczi
; > usbif->ports[port - 1].dev = USB_DEVICE(qdev_device_add(opts, > &local_err)); > > Trying this is up to you! Paul or Anthony: Do you know how to run usbback_portid_add() for testing? I would like to make sure that suggested the code change works and don't have experience running the Xen code in QEMU. Thanks, Stefan signature.asc Description: PGP signature

Re: [PATCH v2 1/2] qdev-monitor: avoid QemuOpts in QMP device_add

2024-08-12 Thread Stefan Hajnoczi
On Fri, Aug 02, 2024 at 10:01:20AM +0200, Markus Armbruster wrote: > Stefan Hajnoczi writes: > > > The QMP device_add monitor command converts the QDict arguments to > > QemuOpts and then back again to QDict. This process only supports scalar > > types. Device properti

[PULL 0/1] Block patches

2024-08-12 Thread Stefan Hajnoczi
The following changes since commit 0f397dcfecc9211d12c2c720c01eb32f0eaa7d23: Merge tag 'pull-nbd-2024-08-08' of https://repo.or.cz/qemu/ericb into staging (2024-08-09 08:40:37 +1000) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request for yo

[PULL 1/1] block/blkio: use FUA flag on write zeroes only if supported

2024-08-12 Thread Stefan Hajnoczi
m Signed-off-by: Stefan Hajnoczi --- meson.build | 2 ++ block/blkio.c | 6 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c2a050b844..81ecd4bae7 100644 --- a/meson.build +++ b/meson.build @@ -2305,6 +2305,8 @@ config_host_data.set('CONFIG

Re: [PATCH] block/blkio: use FUA flag on write zeroes only if supported

2024-08-12 Thread Stefan Hajnoczi
+ > block/blkio.c | 6 -- > 2 files changed, 6 insertions(+), 2 deletions(-) Thanks, applied to my block tree: https://gitlab.com/stefanha/qemu/commits/block Stefan signature.asc Description: PGP signature

Re: [PATCH 2/2] qemu-img: CVE-XXX Sanitize untrusted output from NBD server

2024-08-07 Thread Stefan Hajnoczi
On Fri, Aug 02, 2024 at 11:41:35PM +0200, Philippe Mathieu-Daudé wrote: > On 2/8/24 21:26, Eric Blake wrote: > > Error messages from an NBD server must be treated as untrusted; a > > malicious server can inject escape sequences to try and trigger RCE > > flaws via escape sequences to whatever termi

[PATCH v2 2/2] vl: use qmp_device_add() in qemu_create_cli_devices()

2024-08-01 Thread Stefan Hajnoczi
and use qmp_device_add(). Cc: Peter Krempa Signed-off-by: Stefan Hajnoczi --- system/vl.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/system/vl.c b/system/vl.c index 9e8f16f155..0beb8bfb57 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2651,17 +2651,11

Re: [PATCH v2 1/2] virtio: Allow .get_vhost() without vhost_started

2024-08-01 Thread Stefan Hajnoczi
8 +++--- > 4 files changed, 34 insertions(+), 6 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

[PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add

2024-08-01 Thread Stefan Hajnoczi
tion and cannot represent non-scalars. Stefan Hajnoczi (2): qdev-monitor: avoid QemuOpts in QMP device_add vl: use qmp_device_add() in qemu_create_cli_devices() system/qdev-monitor.c | 56 ++- system/vl.c | 14 --- 2 files changed, 33 in

[PATCH v2 1/2] qdev-monitor: avoid QemuOpts in QMP device_add

2024-08-01 Thread Stefan Hajnoczi
om_qdict() so all callers benefit from it automatically. This avoids code duplication. Markus helped me figure this out and even provided a draft patch. The code ended up very close to what he suggested. Suggested-by: Markus Armbruster Cc: Daniel P. Berrangé Signed-off-by: Stefan Hajnoczi --- s

Re: [PATCH 1/7] block/vdi.c: Avoid potential overflow when calculating size of write

2024-07-31 Thread Stefan Weil via
ks. Reviewed-by: Stefan Weil

Re: [PATCH] qdev-monitor: QAPIfy QMP device_add

2024-07-31 Thread Stefan Hajnoczi
On Wed, 31 Jul 2024 at 09:59, Peter Krempa wrote: > > On Tue, Jul 09, 2024 at 16:27:22 +0200, Markus Armbruster wrote: > > Stefan Hajnoczi writes: > > > > > The QMP device_add monitor command converts the QDict arguments to > > > QemuOpts and then back again

[PULL 1/1] util/async.c: Forbid negative min/max in aio_context_set_thread_pool_params()

2024-07-25 Thread Stefan Hajnoczi
olves: Coverity CID 1547605 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240723150927.1396456-1-peter.mayd...@linaro.org Signed-off-by: Stefan Hajnoczi --- util/async.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/async.c b/util/as

[PULL 0/1] Block patches

2024-07-25 Thread Stefan Hajnoczi
The following changes since commit 029e13a8a56a2931e7c24c0db52ae7256b932cb0: Merge tag 'bsd-user-for-9.1-pull-request' of gitlab.com:bsdimp/qemu into staging (2024-07-25 09:53:57 +1000) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request for

Re: [PATCH] util/async.c: Forbid negative min/max in aio_context_set_thread_pool_params()

2024-07-25 Thread Stefan Hajnoczi
aio_context_set_thread_pool_params() return an error if either min or > max are negative. > > Resolves: Coverity CID 1547605 > Signed-off-by: Peter Maydell > --- > util/async.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, applied to my block tree

Re: [PATCH v8 09/10] hw/nvme: add reservation protocal command

2024-07-11 Thread Stefan Hajnoczi
On Tue, Jul 09, 2024 at 10:47:05AM +0800, Changqi Lu wrote: > Add reservation acquire, reservation register, > reservation release and reservation report commands > in the nvme device layer. > > By introducing these commands, this enables the nvme > device to perform reservation-related tasks, inc

Re: [PATCH v8 10/10] block/iscsi: add persistent reservation in/out driver

2024-07-11 Thread Stefan Hajnoczi
_co_pr_clear and bdrv_co_pr_preempt. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --- > block/iscsi.c | 425 ++ > 1 file changed, 425 insertions(+) Aside from the g_free() issue I commented on: Reviewed-by: St

Re: [PATCH v8 10/10] block/iscsi: add persistent reservation in/out driver

2024-07-11 Thread Stefan Hajnoczi
On Tue, Jul 09, 2024 at 10:47:06AM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations for iscsi driver. > The following methods are implemented: bdrv_co_pr_read_keys, > bdrv_co_pr_read_reservation, bdrv_co_pr_register, bdrv_co_pr_reserve, > bdrv_co_pr_release, bdrv_co_pr_clear

Re: [PATCH v8 08/10] hw/nvme: enable ONCS and rescap function

2024-07-11 Thread Stefan Hajnoczi
Reviewed-by: Klaus Jensen > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --- > hw/nvme/ctrl.c | 3 ++- > hw/nvme/ns.c | 5 + > include/block/nvme.h | 2 +- > 3 files changed, 8 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v8 05/10] hw/scsi: add persistent reservation in/out api for scsi device

2024-07-11 Thread Stefan Hajnoczi
ent manner. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --- > hw/scsi/scsi-disk.c | 368 > 1 file changed, 368 insertions(+) Paolo: Please review this patch, I'm not familiar enough with hw/scsi/. Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

[PULL 2/2] Consider discard option when writing zeros

2024-07-11 Thread Stefan Hajnoczi
https://lists.nongnu.org/archive/html/qemu-discuss/2024-06/msg3.html Signed-off-by: Nir Soffer Message-id: 20240628202058.1964986-3-nsof...@redhat.com Signed-off-by: Stefan Hajnoczi --- block/io.c| 9 +- tests/qemu-iotests/tests/write-zeroes-unmap

[PULL 1/2] qemu-iotest/245: Add missing discard=unmap

2024-07-11 Thread Stefan Hajnoczi
From: Nir Soffer The test works since we punch holes by default even when opening the image without discard=on or discard=unmap. Fix the test to enable discard. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/245 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests

[PULL 0/2] Block patches

2024-07-11 Thread Stefan Hajnoczi
The following changes since commit 59084feb256c617063e0dbe7e64821ae8852d7cf: Merge tag 'pull-aspeed-20240709' of https://github.com/legoater/qemu into staging (2024-07-09 07:13:55 -0700) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request fo

Re: [PATCH v3 0/2] Consider discard option when writing zeros

2024-07-11 Thread Stefan Hajnoczi
81 +++ > 4 files changed, 214 insertions(+), 5 deletions(-) > create mode 100755 tests/qemu-iotests/tests/write-zeroes-unmap > create mode 100644 tests/qemu-iotests/tests/write-zeroes-unmap.out > > -- > 2.45.2 > Thanks, applied to my block tree: https://gitlab.com/stefanha/qemu/commits/block Stefan signature.asc Description: PGP signature

Re: [PATCH v3 2/2] Consider discard option when writing zeros

2024-07-11 Thread Stefan Hajnoczi
| 9 +- > tests/qemu-iotests/tests/write-zeroes-unmap | 127 ++ > .../qemu-iotests/tests/write-zeroes-unmap.out | 81 +++ > 3 files changed, 213 insertions(+), 4 deletions(-) > create mode 100755 tests/qemu-iotests/tests/write-zeroes-unmap > create

Re: [PATCH v3 1/2] qemu-iotest/245: Add missing discard=unmap

2024-07-11 Thread Stefan Hajnoczi
ion(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-07-11 Thread Stefan Hajnoczi
s use SHMEM_MAP due to the incomplete memory table that prevents translating those memory addresses. In other words, if the guest has a device that uses SHMEM_MAP, then all other vhost-user devices should support MEM_READ/MEM_WRITE in order to ensure that DMA works with Shared Memory Regions. St

Re: [RFC PATCH v2 5/5] vhost_user: Implement mem_read/mem_write handlers

2024-07-11 Thread Stefan Hajnoczi
On Fri, Jun 28, 2024 at 04:57:10PM +0200, Albert Esteve wrote: > Implement function handlers for memory read and write > operations. > > Signed-off-by: Albert Esteve > --- > hw/virtio/vhost-user.c | 34 ++ > 1 file changed, 30 insertions(+), 4 deletions(-) > > di

Re: [RFC PATCH v2 4/5] vhost_user: Add MEM_READ/WRITE backend requests

2024-07-11 Thread Stefan Hajnoczi
On Fri, Jun 28, 2024 at 04:57:09PM +0200, Albert Esteve wrote: > With SHMEM_MAP messages, sharing descriptors between > devices will cause that these devices do not see the > mappings, and fail to access these memory regions. > > To solve this, introduce MEM_READ/WRITE requests > that will get tri

Re: [RFC PATCH v2 3/5] vhost-user-dev: Add cache BAR

2024-07-11 Thread Stefan Hajnoczi
On Fri, Jun 28, 2024 at 04:57:08PM +0200, Albert Esteve wrote: > Add a cache BAR in the vhost-user-device > into which files can be directly mapped. > > The number, shmid, and size of the VIRTIO Shared > Memory subregions is retrieved through a get_shmem_config > message sent by the vhost-user-bas

Re: [RFC PATCH v2 2/5] vhost_user: Add frontend command for shmem config

2024-07-11 Thread Stefan Hajnoczi
On Fri, Jun 28, 2024 at 04:57:07PM +0200, Albert Esteve wrote: > The frontend can use this command to retrieve > VIRTIO Shared Memory Regions configuration from > the backend. The response contains the number of > shared memory regions, their size, and shmid. > > This is useful when the frontend i

Re: [RFC PATCH v2 2/5] vhost_user: Add frontend command for shmem config

2024-07-11 Thread Stefan Hajnoczi
On Fri, Jun 28, 2024 at 04:57:07PM +0200, Albert Esteve wrote: > The frontend can use this command to retrieve > VIRTIO Shared Memory Regions configuration from > the backend. The response contains the number of > shared memory regions, their size, and shmid. > > This is useful when the frontend i

Re: [RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-07-11 Thread Stefan Hajnoczi
On Fri, Jun 28, 2024 at 04:57:06PM +0200, Albert Esteve wrote: > Add SHMEM_MAP/UNMAP requests to vhost-user to > handle VIRTIO Shared Memory mappings. > > This request allows backends to dynamically map > fds into a VIRTIO Shared Memory Region indentified > by its `shmid`. Then, the fd memory is a

Re: [PATCH 0/2] block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked

2024-07-10 Thread Stefan Hajnoczi
ck > block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked > > include/block/graph-lock.h | 21 ++--- > block/block-copy.c | 4 +++- > meson.build| 14 +- > 3 files changed, 30 insertions(+), 9 deletions(-) >

Re: [RFC] Per-request private data in virtio-block

2024-07-10 Thread Stefan Hajnoczi
ncing of the VIRTIO and Linux communities to add this new concept. Is the concept of cache metadata (separate from I/O priority in Linux) a thing? If you can show examples from other storage protocols like NVMe or SCSI, then that would help in designing a virtio-blk solution too. Stefan > > Thank you, > Dmitry > signature.asc Description: PGP signature

Re: [PATCH] virtio: Always reset vhost devices

2024-07-10 Thread Stefan Hajnoczi
it 95e1019a4a9), but also that the vhost back-end is connected > (`hdev = k->get_vhost(); hdev != NULL && hdev->vhost_ops != NULL`). > > Signed-off-by: Hanna Czenczek I think an additional SET_STATUS 0 call is made to the vDPA vhost backend after this patch, but that seems fine.

[PATCH] qdev-monitor: QAPIfy QMP device_add

2024-07-08 Thread Stefan Hajnoczi
ruster Cc: Daniel P. Berrangé Signed-off-by: Stefan Hajnoczi --- system/qdev-monitor.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 6af6ef7d66..1427aa173c 100644 --- a/system/qdev-mo

Re: [PATCH v7 00/10] Support persistent reservation operations

2024-07-08 Thread Stefan Hajnoczi
On Fri, Jul 05, 2024 at 06:56:04PM +0800, Changqi Lu wrote: > Hi, > > Patch v7 has been modified. > Thanks again to Stefan for reviewing the code. > > v6->v7: > - Add buferlen size check at SCSI layer. > - Add pr_cap calculation in bdrv_merge_limits() function at bloc

Re: [PATCH v7 06/10] block/nvme: add reservation command protocol constants

2024-07-08 Thread Stefan Hajnoczi
angqi Lu > Signed-off-by: zhenwei pi > --- > include/block/nvme.h | 61 > 1 file changed, 61 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v7 10/10] block/iscsi: add persistent reservation in/out driver

2024-07-08 Thread Stefan Hajnoczi
On Fri, Jul 05, 2024 at 06:56:14PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations for iscsi driver. > The following methods are implemented: bdrv_co_pr_read_keys, > bdrv_co_pr_read_reservation, bdrv_co_pr_register, bdrv_co_pr_reserve, > bdrv_co_pr_release, bdrv_co_pr_clear

Re: [PATCH v7 05/10] hw/scsi: add persistent reservation in/out api for scsi device

2024-07-08 Thread Stefan Hajnoczi
buf = scsi_req_get_buf(&r->req); > +num_keys = MIN(blk_keys->num_keys, ret); The behavior of scsi_disk_req_check_error() above is strange for pr_read_keys operations. When --drive ...,rerror=ignore and ret < 0 this line is reached and we don't want a negative num_keys value. It would be safer to use (ret > 0 ? ret : 0) instead of the raw value of ret. Stefan signature.asc Description: PGP signature

Re: [PATCH v7 08/10] hw/nvme: enable ONCS and rescap function

2024-07-08 Thread Stefan Hajnoczi
ed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --- > hw/nvme/ctrl.c | 3 ++- > hw/nvme/ns.c | 5 + > include/block/nvme.h | 2 +- > 3 files changed, 8 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v6 08/10] hw/nvme: enable ONCS and rescap function

2024-07-05 Thread Stefan Hajnoczi
On Thu, Jul 04, 2024 at 08:20:31PM +0200, Stefan Hajnoczi wrote: > On Thu, Jun 13, 2024 at 03:13:25PM +0800, Changqi Lu wrote: > > This commit enables ONCS to support the reservation > > function at the controller level. Also enables rescap > > function in the namespace by de

Re: [PATCH v6 09/10] hw/nvme: add reservation protocal command

2024-07-04 Thread Stefan Hajnoczi
I will skip this since Klaus Jensen's review is required for NVMe anyway. Stefan signature.asc Description: PGP signature

Re: [PATCH v6 10/10] block/iscsi: add persistent reservation in/out driver

2024-07-04 Thread Stefan Hajnoczi
On Thu, Jun 13, 2024 at 03:13:27PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations for iscsi driver. > The following methods are implemented: bdrv_co_pr_read_keys, > bdrv_co_pr_read_reservation, bdrv_co_pr_register, bdrv_co_pr_reserve, > bdrv_co_pr_release, bdrv_co_pr_clear

Re: [PATCH v6 06/10] block/nvme: add reservation command protocol constants

2024-07-04 Thread Stefan Hajnoczi
On Thu, Jun 13, 2024 at 03:13:23PM +0800, Changqi Lu wrote: > Add constants for the NVMe persistent command protocol. > The constants include the reservation command opcode and > reservation type values defined in section 7 of the NVMe > 2.0 specification. > > Signed-off-by: Changqi Lu > Signed-o

Re: [PATCH v6 08/10] hw/nvme: enable ONCS and rescap function

2024-07-04 Thread Stefan Hajnoczi
On Thu, Jun 13, 2024 at 03:13:25PM +0800, Changqi Lu wrote: > This commit enables ONCS to support the reservation > function at the controller level. Also enables rescap > function in the namespace by detecting the supported reservation > function in the backend driver. > > Signed-off-by: Changqi

Re: [PATCH v6 05/10] hw/scsi: add persistent reservation in/out api for scsi device

2024-07-04 Thread Stefan Hajnoczi
On Thu, Jun 13, 2024 at 03:13:22PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations in the > SCSI device layer. By introducing the persistent > reservation in/out api, this enables the SCSI device > to perform reservation-related tasks, including querying > keys, querying res

Re: [PATCH v6 05/10] hw/scsi: add persistent reservation in/out api for scsi device

2024-07-04 Thread Stefan Hajnoczi
On Thu, Jun 13, 2024 at 03:13:22PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations in the > SCSI device layer. By introducing the persistent > reservation in/out api, this enables the SCSI device > to perform reservation-related tasks, including querying > keys, querying res

Re: [PATCH v6 04/10] scsi/util: add helper functions for persistent reservation types conversion

2024-06-26 Thread Stefan Hajnoczi
u > Signed-off-by: zhenwei pi > --- > include/scsi/utils.h | 8 + > scsi/utils.c | 81 > 2 files changed, 89 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v6 03/10] scsi/constant: add persistent reservation in/out protocol constants

2024-06-26 Thread Stefan Hajnoczi
i_proto.h like the rest of the file, but it's okay because constants.h is not kept in sync with the Linux headers. Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v6 02/10] block/raw: add persistent reservation in/out driver

2024-06-26 Thread Stefan Hajnoczi
_co_pr_clear and bdrv_co_pr_preempt. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --- > block/raw-format.c | 56 ++ > 1 file changed, 56 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v6 01/10] block: add persistent reservation in/out api

2024-06-26 Thread Stefan Hajnoczi
| 40 +++ > include/block/block-io.h | 20 ++ > include/block/block_int-common.h | 84 +++ > include/sysemu/block-backend-io.h | 24 ++ > 6 files changed, 734 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

  1   2   3   4   5   6   7   8   9   10   >