Re: [PATCH 00/20] qapi: new sphinx qapi domain pre-requisites

2024-05-16 Thread Stefan Hajnoczi
pi/visit.py | 9 +- > tests/qapi-schema/doc-empty-section.err | 2 +- > tests/qapi-schema/doc-empty-section.json | 2 +- > tests/qapi-schema/doc-good.json | 18 +- > tests/qapi-schema/doc-good.out| 61 +++--- > tests/qapi

Re: [PATCH] qio: Inherit follow_coroutine_ctx across TLS

2024-05-16 Thread Stefan Hajnoczi
LS thread in nbd/server.c, > it is more generic if all qio channels that wrap other channels > inherit the follow status, in the same way that they inherit feature > bits. > > CC: Stefan Hajnoczi > CC: Daniel P. Berrangé > CC: qemu-sta...@nongnu.org > Fixes: https://issues.r

[PATCH 2/2] crypto/block: drop qcrypto_block_open() n_threads argument

2024-05-27 Thread Stefan Hajnoczi
The n_threads argument is no longer used since the previous commit. Remove it. Signed-off-by: Stefan Hajnoczi --- crypto/blockpriv.h | 1 - include/crypto/block.h | 2 -- block/crypto.c | 1 - block/qcow.c | 2 +- block/qcow2.c

[PATCH 1/2] block/crypto: create ciphers on demand

2024-05-27 Thread Stefan Hajnoczi
read's argument and allocate ciphers on demand. Reported-by: Qing Wang Buglink: https://issues.redhat.com/browse/RHEL-36159 Signed-off-by: Stefan Hajnoczi --- crypto/blockpriv.h | 12 +++-- crypto/block-luks.c | 3 +- crypto/block-qcow.c | 2 +- crypto/block.c

[PATCH 0/2] block/crypto: do not require number of threads upfront

2024-05-27 Thread Stefan Hajnoczi
arbitrary number of threads. --- Is it secure to store the key in QCryptoBlock? In this series I assumed the answer is yes since the QCryptoBlock's cipher state is equally sensitive, but I'm not familiar with this code or a crypto expert. Stefan Hajnoczi (2): block/crypto: create ciphers

Re: [PATCH 0/2] block/crypto: do not require number of threads upfront

2024-05-29 Thread Stefan Hajnoczi
On Wed, May 29, 2024 at 06:50:34PM +0200, Kevin Wolf wrote: > Am 27.05.2024 um 17:58 hat Stefan Hajnoczi geschrieben: > > The block layer does not know how many threads will perform I/O. It is > > possible > > to exceed the number of threads that is given to qcrypto_block

Re: [PATCH] Use "void *" as parameter for functions that are used for aio_set_event_notifier()

2024-05-29 Thread Stefan Hajnoczi
On Wed, May 29, 2024 at 07:49:48PM +0200, Thomas Huth wrote: > aio_set_event_notifier() and aio_set_event_notifier_poll() in > util/aio-posix.c and util/aio-win32.c are casting function pointers of > functions that take an "EventNotifier *" pointer as parameter to function > pointers that take a "v

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

2024-06-10 Thread Stefan Hajnoczi
On Thu, Jun 06, 2024 at 08:24:34PM +0800, Changqi Lu wrote: > Hi, > > patchv5 has been modified. > > Sincerely hope that everyone can help review the > code and provide some suggestions. > > v4->v5: > - Fixed a memory leak bug at hw/nvme/ctrl.c. > > v3->v4: > - At the nvme layer, the two patch

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

2024-06-10 Thread Stefan Hajnoczi
On Thu, Jun 06, 2024 at 08:24:35PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations > at the block level. The following operations > are included: > > - read_keys:retrieves the list of registered keys. > - read_reservation: retrieves the current reservation status. >

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

2024-06-11 Thread Stefan Hajnoczi
ented in subsequent patches. Thanks for explaining! Stefan > > On 2024/6/11 01:18, Stefan Hajnoczi wrote: > > On Thu, Jun 06, 2024 at 08:24:34PM +0800, Changqi Lu wrote: > >> Hi, > >> > >> patchv5 has been modified. > >> > >> Sincerely ho

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-24 Thread Stefan Hajnoczi
On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > Tested using: Hi Nir, This looks like a good candidate for the qemu-iotests test suite. Adding it to the automated tests will protect against future regressions. Please add the script and the expected output to tests/qemu-iotests/test/

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

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 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 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 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 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 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 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 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 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 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 v7 05/10] hw/scsi: add persistent reservation in/out api for scsi device

2024-07-08 Thread Stefan Hajnoczi
On Fri, Jul 05, 2024 at 06:56:09PM +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 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 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 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 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 block layer, > so the ugly bs->

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: [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: [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 0/2] Consider discard option when writing zeros

2024-07-11 Thread Stefan Hajnoczi
On Fri, Jun 28, 2024 at 11:20:56PM +0300, Nir Soffer wrote: > Punch holes only when the image is opened with discard=on or discard=unmap. > > Tested by: > - new write-zeroes-unmap iotest on xfs, ext4, and tmpfs > - tests/qemu-iotests/check -raw > - tests/qemu-iotests/check -qcow2 > > Changes sinc

[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 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

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 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 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 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] util/async.c: Forbid negative min/max in aio_context_set_thread_pool_params()

2024-07-25 Thread Stefan Hajnoczi
On Tue, Jul 23, 2024 at 04:09:27PM +0100, Peter Maydell wrote: > aio_context_set_thread_pool_params() takes two int64_t arguments to > set the minimum and maximum number of threads in the pool. We do > some bounds checking on these, but we don't catch the case where the > inputs are negative. Thi

[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

[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

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

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

2024-08-12 Thread Stefan Hajnoczi
On Thu, Aug 08, 2024 at 10:05:45AM +0200, Stefano Garzarella wrote: > libblkio supports BLKIO_REQ_FUA with write zeros requests only since > version 1.4.0, so let's inform the block layer that the blkio driver > supports it only in this case. Otherwise we can have runtime errors > as reported in ht

[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

[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

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 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

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] hw/block: fix uint32 overflow

2024-09-17 Thread Stefan Hajnoczi
On Tue, Sep 17, 2024 at 11:03:18AM +0300, Dmitry Frolov wrote: > 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 > --- > hw/block/virtio-blk.c | 2 +- > 1 file chan

[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: [Qemu-block] [Qemu-devel] [PATCH] scsi: switch from g_slice allocator to malloc

2015-10-06 Thread Stefan Hajnoczi
hw/scsi/virtio-scsi-dataplane.c | 10 +- > hw/scsi/virtio-scsi.c | 12 +--- > 3 files changed, 12 insertions(+), 14 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH] gluster: allocate GlusterAIOCBs on the stack

2015-10-06 Thread Stefan Hajnoczi
On Thu, Oct 01, 2015 at 01:04:38PM +0200, Paolo Bonzini wrote: > This is simpler now that the driver has been converted to coroutines. > > Signed-off-by: Paolo Bonzini > --- > block/gluster.c | 86 > ++--- > 1 file changed, 33 insertions(+), 5

Re: [Qemu-block] [PATCH] nbd: switch from g_slice allocator to malloc

2015-10-06 Thread Stefan Hajnoczi
tions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [Qemu-devel] [PATCH] block: switch from g_slice allocator to malloc

2015-10-08 Thread Stefan Hajnoczi
On Thu, Oct 01, 2015 at 01:04:39PM +0200, Paolo Bonzini wrote: > Simplify memory allocation by sticking with a single API. GSlice > is not that fast anyway (tcmalloc/jemalloc are better). > > Signed-off-by: Paolo Bonzini > --- > block/io.c| 4 ++-- > block/mirror.c| 4 ++-- >

Re: [Qemu-block] [PATCH v10 00/10] Block replication for continuous checkpoints

2015-10-09 Thread Stefan Hajnoczi
On Wed, Oct 07, 2015 at 02:39:51PM +0800, Wen Congyang wrote: > Ping... Added to my todo list. Will review on Monday. Stefan

Re: [Qemu-block] [PATCH v2 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-10-09 Thread Stefan Hajnoczi
On Thu, Oct 01, 2015 at 03:13:31PM +0200, Kevin Wolf wrote: > +static void change_parent_backing_link(BlockDriverState *from, > + BlockDriverState *to) > +{ > +BdrvChild *c, *next; > + > +QLIST_FOREACH_SAFE(c, &from->parents, next_parent, next) { I fin

Re: [Qemu-block] [PATCH v2 00/16] block: Get rid of bdrv_swap()

2015-10-09 Thread Stefan Hajnoczi
-- > block/vpc.c | 34 ++-- > block/vvfat.c | 19 +- > blockdev.c| 6 +- > blockjob.c| 15 +- > include/block/block.h | 15 +- > include/block/block_int.h | 20 +- > include/block/blockjob.h | 8 + > include/qemu/queue.h | 6 - > qemu-img.c| 20 +- > 36 files changed, 762 insertions(+), 809 deletions(-) Modulo review comments: Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH v10 02/10] Backup: clear all bitmap when doing block checkpoint

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:30PM +0800, Wen Congyang wrote: > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Reviewed-by: Jeff Cody > --- > block/backup.c | 14 ++ > blockjob.c | 11 +++ > include/block/blockj

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +static void backup_job_completed(void *opaque, int ret) > +{ > +BDRVReplicationState *s = opaque; > + > +if (s->replication_state != BLOCK_REPLICATION_DONE) { > +/* The backup job is cancelled unexpectedly */ > +

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +/* start backup job now */ > +bdrv_op_unblock(s->hidden_disk, BLOCK_OP_TYPE_BACKUP_TARGET, > +s->active_disk->backing_blocker); > +bdrv_op_unblock(s->secondary_disk, BLOCK_OP_TYPE_BACKUP

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +static void replication_start(BlockDriverState *bs, ReplicationMode mode, > + Error **errp) > +{ > +BDRVReplicationState *s = bs->opaque; > +int64_t active_length, hidden_length, disk_length; > +

Re: [Qemu-block] [PATCH v3 00/16] block: Get rid of bdrv_swap()

2015-10-13 Thread Stefan Hajnoczi
| 25 +-- > block/vhdx.c | 36 ++-- > block/vmdk.c | 133 +++-- > block/vpc.c | 34 ++-- > block/vvfat.c | 19 +- > blockdev.c| 6 +- > blockjob.c| 15 +- > include/block/block.h | 15 +- > include/block/block_int.h | 20 +- > include/block/blockjob.h | 8 + > include/qemu/queue.h | 6 - > qemu-img.c| 20 +- > 36 files changed, 754 insertions(+), 835 deletions(-) > > -- > 1.8.3.1 > Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH v2 01/22] xen_disk: Account for flush operations

2015-10-13 Thread Stefan Hajnoczi
rtions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH v2 02/22] ide: Account for write operations correctly

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:12PM +0300, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia > --- > hw/ide/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH v2 03/22] block: define 'clock_type' for the accounting code

2015-10-13 Thread Stefan Hajnoczi
lock/accounting.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH v2 05/22] block: Add idle_time_ns to BlockDeviceStats

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:15PM +0300, Alberto Garcia wrote: > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 5f12af7..a529e2f 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -448,6 +448,10 @@ > # @wr_merged: Number of write requests that have been merged

Re: [Qemu-block] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:16PM +0300, Alberto Garcia wrote: > query-blockstats always returns a BlockDeviceStats structure for each > BDS, regardless of whether it implements accounting or not. Since the > field is mandatory there's no way to tell that from the values alone. > > This field sol

Re: [Qemu-block] [PATCH v2 04/22] util: Infrastructure for computing recent averages

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:14PM +0300, Alberto Garcia wrote: > +int64_t cpu_get_clock(void) > +{ > +return my_clock_value; > +} Please add a comment here explaining that this is the clock for QEMU_CLOCK_VIRTUAL. > +/* Account a value > + * > + * @ta:the TimedAverage structure > + * @va

Re: [Qemu-block] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:17PM +0300, Alberto Garcia wrote: > +void block_acct_failed(BlockAcctStats *stats, BlockAcctCookie *cookie) > +{ > +int64_t time_ns = qemu_clock_get_ns(clock_type); > + > +assert(cookie->type < BLOCK_MAX_IOTYPE); > + > +stats->failed_ops[cookie->type]++; >

Re: [Qemu-block] [PATCH v2 08/22] block: Allow configuring whether to account failed and invalid ops

2015-10-13 Thread Stefan Hajnoczi
qapi/block-core.json | 17 - > qmp-commands.hx| 25 - > 6 files changed, 79 insertions(+), 11 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH] Revert "blockdev: add note that block_job_cb() must be thread-safe"

2015-10-14 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 06:16:15PM +0800, Fam Zheng wrote: > This reverts commit 723c5d93c51bdb3adbc238ce90195c0864aa6cd5. > > block_job_cb is called by block_job_completed, which is always called in > a main loop bottom half in existing block jobs. So we don't need to > worry about thread-safety

Re: [Qemu-block] [PATCH v10 02/10] Backup: clear all bitmap when doing block checkpoint

2015-10-14 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 05:13:14PM +0800, Wen Congyang wrote: > On 10/12/2015 09:45 PM, Stefan Hajnoczi wrote: > > On Fri, Sep 25, 2015 at 02:17:30PM +0800, Wen Congyang wrote: > >> Signed-off-by: Wen Congyang > >> Signed-off-by: zhanghailiang > >> Signed-off

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-14 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: > On 10/13/2015 12:27 AM, Stefan Hajnoczi wrote: > > On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > >> +/* start backup job now */ > >> +bdrv_op_unblock(s->hidden_dis

Re: [Qemu-block] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats

2015-10-15 Thread Stefan Hajnoczi
On Thu, Oct 15, 2015 at 03:06:19PM +0200, Alberto Garcia wrote: > On Tue 13 Oct 2015 05:38:30 PM CEST, Stefan Hajnoczi wrote: > > >> query-blockstats always returns a BlockDeviceStats structure for each > >> BDS, regardless of whether it implements accounting or not.

[Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-15 Thread Stefan Hajnoczi
ad where block_job_completed() may be called safely. This is very subtle so it's nice to eliminate the assumption by unifying the early exit with the normal exit code path. Cc: Fam Zheng Cc: Jeff Cody Signed-off-by: Stefan Hajnoczi --- block/stream.c | 15 ++- 1 file changed, 10 ins

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-15 Thread Stefan Hajnoczi
On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: > On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: > > On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: > >> On 10/13/2015 12:27 AM, Stefan Hajnoczi wrote: > >>> On Fri, Sep 25, 2015 at 02:17:

Re: [Qemu-block] [Qemu-devel] [PATCH] Revert "blockdev: add note that block_job_cb() must be thread-safe"

2015-10-15 Thread Stefan Hajnoczi
On Wed, Oct 14, 2015 at 10:51:27PM -0400, Fam Zheng wrote: > > > - Original Message - > > On Tue, Oct 13, 2015 at 06:16:15PM +0800, Fam Zheng wrote: > > > This reverts commit 723c5d93c51bdb3adbc238ce90195c0864aa6cd5. > > > > > > block_job_cb is called by block_job_completed, which is alw

Re: [Qemu-block] [PATCH v8 03/11] block: never cancel a streaming job without running stream_complete()

2015-10-16 Thread Stefan Hajnoczi
it > will become more important as we introduce support for streaming to > any intermediate node. > > Signed-off-by: Alberto Garcia > Reviewed-by: Max Reitz > --- > block/stream.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-16 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 08:58:12AM +0200, Alberto Garcia wrote: > On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi > wrote: > > The stream block job has two early exit code paths. They do not free > > s->backing_file_str. > > > > Also, the early exits re

Re: [Qemu-block] [PATCH v2 2/2] aio: Introduce aio-epoll.c

2015-10-16 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 07:10:55PM +0800, Fam Zheng wrote: > +static bool aio_epoll_try_enable(AioContext *ctx) > +{ > +AioHandler *node; > +struct epoll_event event; > +if (!ctx->epoll_available) { > +return false; > +} Why check this here since aio_epoll_check_poll() alre

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-16 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 10:22:05AM +0800, Wen Congyang wrote: > On 10/15/2015 10:55 PM, Stefan Hajnoczi wrote: > > On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: > >> On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: > >>> On Tue, Oct 13, 2015 at 05:08:

Re: [Qemu-block] [Qemu-devel] [RFC] transactions: add transaction-wide property

2015-10-16 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 12:50:20PM -0400, John Snow wrote: > Ping -- any consensus on how we should implement the "do-or-die" > argument for transactions that start block jobs? :) > > This patch may look a little hokey in how it boxes arguments, but I can > re-do it on top of Eric Blake's very off

Re: [Qemu-block] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats

2015-10-21 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 11:49:00AM +0200, Alberto Garcia wrote: > On Thu 15 Oct 2015 04:58:22 PM CEST, Stefan Hajnoczi wrote: > >> > If I/O accounting isn't being used then all fields will be 0? > >> > >> Yes, but there's no way to tell if that happens b

Re: [Qemu-block] [PATCH v2 0/3] virtio-blk: no scsi-passthrough by default

2015-10-21 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 12:25:51PM +0200, Cornelia Huck wrote: > Lightly tested on s390x. > > Changes v1->v2: > - have the s390x compat hander include HW_COMPAT > - prepare the pseries 2.4 compat handler > - switch compat property at virtio-blk-device instead of the > transport level > > Cornel

Re: [Qemu-block] [Qemu-devel] [RFC] transactions: add transaction-wide property

2015-10-21 Thread Stefan Hajnoczi
Thanks for summarizing the discussion! If you are taking over Fam's series, please squash in your patches to make review easier. Maybe the names can be improved: "allow-partial" is not self-explanatory. "sync-cancel" is misleading since successful completion is affected too, not just failure/ca

Re: [Qemu-block] [PATCH 1/4] ide/atapi: make PIO read requests async

2015-10-22 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:22PM +0200, Peter Lieven wrote: > @@ -129,9 +134,71 @@ static int cd_read_sector(IDEState *s, int lba, uint8_t > *buf, int sector_size) > ret = -EIO; > break; > } > + > +if (!ret) { > +s->lba++; This function probably shouldn't take

Re: [Qemu-block] [PATCH 2/4] ide/atapi: blk_aio_readv may return NULL

2015-10-22 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:23PM +0200, Peter Lieven wrote: > Signed-off-by: Peter Lieven > --- > hw/ide/atapi.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c > index 2271ea2..e0cf066 100644 > --- a/hw/ide/atapi.c > +++ b/hw/ide/atapi.c > @@ -429,

Re: [Qemu-block] [PATCH v3 08/21] block: Compute minimum, maximum and average I/O latencies

2015-10-23 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 11:11:18AM +0300, Alberto Garcia wrote: > +struct BlockAcctTimedStats { > +TimedAverage latency[BLOCK_MAX_IOTYPE]; > +unsigned interval_length; /* in seconds */ would be nice here so the units are clear. Or even interval_length_secs.

Re: [Qemu-block] [PATCH v3 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats

2015-10-23 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 11:11:19AM +0300, Alberto Garcia wrote: > +/* Get the sum of all accounted values > + * @ta: the TimedAverage structure > + * @elapsed: if non-NULL, the elapsed time (in ns) will be stored here > + * @ret: the sum of all accounted values > + */ > +uint64_t timed_ave

Re: [Qemu-block] [PATCH v3 00/21] Extended I/O accounting

2015-10-23 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 11:11:10AM +0300, Alberto Garcia wrote: > Here's a new version of the extended I/O accounting patches. > > This one is rebased on top of the current master, has a few minor > documentation fixes and drops the 'supports_stats' field completely. Looks good overall. I posted

Re: [Qemu-block] [PATCH v7 01/10] aio: Add "is_external" flag for event handlers

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:05AM +0800, Fam Zheng wrote: > All callers pass in false, and the real external ones will switch to > true in coming patches. > > Signed-off-by: Fam Zheng > Reviewed-by: Jeff Cody > Reviewed-by: Kevin Wolf > --- > aio-posix.c | 6 - > aio-

Re: [Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:09AM +0800, Fam Zheng wrote: > +void bdrv_drained_begin(BlockDriverState *bs) > +{ > +if (!bs->quiesce_counter++) { > +aio_disable_external(bdrv_get_aio_context(bs)); > +} > +bdrv_drain(bs); > +} > + > +void bdrv_drained_end(BlockDriverState *bs) >

Re: [Qemu-block] [PATCH v7 00/10] block: Protect nested event loop with bdrv_drained_begin and bdrv_drained_end

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:04AM +0800, Fam Zheng wrote: > v7: Exclude bdrv_drain and bdrv_qed_drain patches, they'll follow the > bdrv_drain fix for bdrv_aio_flush. > Fix internal snapshot clean. > > v6: Add Kevin's rev-by in patches 1-3, 6-8, 10, 12. > Add Jeff's rev-by in patches

Re: [Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:09AM +0800, Fam Zheng wrote: > +/** > + * bdrv_drained_begin: > + * > + * Begin a quiesced section for exclusive access to the BDS, by disabling > + * external request sources including NBD server and device model. Note that > + * this doesn't block timers or coroutine

Re: [Qemu-block] [PATCH 00/17] Framework for securely passing secrets to QEMU

2015-10-23 Thread Stefan Hajnoczi
++-- > qemu-nbd.c | 142 +++- > qemu-nbd.texi | 7 + > qemu-options.hx | 84 - > qmp.c | 83 + > qom/object_interfaces.c | 76 > tests/.gitignore| 1 + > tests/Makefile | 2 + > tests/qemu-iotests/087 | 20 + > tests/qemu-iotests/087.out | 26 +- > tests/qemu-iotests/134 | 17 +- > tests/qemu-iotests/134.out | 44 +-- > tests/qemu-iotests/common.rc| 4 +- > tests/test-crypto-secret.c | 440 ++ > util/oslib-posix.c | 66 > util/oslib-win32.c | 24 -- > util/qemu-option.c | 6 + > vl.c| 8 +- > 45 files changed, 2740 insertions(+), 751 deletions(-) > create mode 100644 crypto/secret.c > create mode 100644 include/crypto/secret.h > create mode 100644 tests/test-crypto-secret.c Acked-by: Stefan Hajnoczi i.e. makes sense to me but I haven't reviewed patches in detail

Re: [Qemu-block] [PATCH 3/4] ide: add support for cancelable read requests

2015-10-26 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:24PM +0200, Peter Lieven wrote: > this patch adds a new aio readv compatible function which copies > all data through a bounce buffer. The benefit is that these requests > can be flagged as canceled to avoid guest memory corruption when > a canceled request is complete

Re: [Qemu-block] [PATCH V2 0/4] ide: avoid main-loop hang on CDROM/NFS failure

2015-10-26 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:21PM +0200, Peter Lieven wrote: > This series aims at avoiding a hanging main-loop if a vserver has a > CDROM image mounted from a NFS share and that NFS share goes down. > Typical situation is that users mount an CDROM ISO to install something > and then forget to eje

Re: [Qemu-block] [PATCH] block/nfs: add support for setting debug level

2015-10-26 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 08:37:19AM +0200, Peter Lieven wrote: > Am 22.09.2015 um 08:13 schrieb Peter Lieven: > >Am 25.06.2015 um 15:18 schrieb Stefan Hajnoczi: > >>On Tue, Jun 23, 2015 at 10:12:15AM +0200, Peter Lieven wrote: > >>>upcoming libnfs versions will suppo

  1   2   3   4   5   6   7   8   9   10   >