Re: [PATCH v2 01/16] migration: Don't use INT64_MAX for unlimited rate

2023-05-15 Thread Harsh Prateek Bora
On 5/16/23 01:26, Juan Quintela wrote: Define and use RATE_LIMIT_MAX instead. Signed-off-by: Juan Quintela --- migration/migration-stats.h | 6 ++ migration/migration.c | 4 ++-- migration/qemu-file.c | 6 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --

Re: [PULL v2 00/16] Block patches

2023-05-15 Thread Richard Henderson
On 5/15/23 09:04, Stefan Hajnoczi wrote: The following changes since commit 8844bb8d896595ee1d25d21c770e6e6f29803097: Merge tag 'or1k-pull-request-20230513' ofhttps://github.com/stffrdhrn/qemu into staging (2023-05-13 11:23:14 +0100) are available in the Git repository at: https://gitl

Re: [PATCH 1/8] block: Call .bdrv_co_create(_opts) unlocked

2023-05-15 Thread Eric Blake
On Mon, May 15, 2023 at 06:19:41PM +0200, Kevin Wolf wrote: > > > @@ -3724,8 +3726,10 @@ qcow2_co_create(BlockdevCreateOptions > > > *create_options, Error **errp) > > > goto out; > > > } > > > > > > +bdrv_graph_co_rdlock(); > > > ret = qcow2_alloc_clusters(blk_bs(blk),

Re: [Libguestfs] [PATCH v3 00/14] qemu patches for 64-bit NBD extensions

2023-05-15 Thread Eric Blake
Adding qemu-block for the cover letter (not sure how I missed that the first time). On Mon, May 15, 2023 at 02:53:29PM -0500, Eric Blake wrote: > > v2 was here: > https://lists.gnu.org/archive/html/qemu-devel/2022-11/msg02340.html > > Since then: > - upstream NBD has accepted the extension on

Re: [PULL 00/11] Migration 20230515 patches

2023-05-15 Thread Richard Henderson
https://gitlab.com/juan.quintela/qemu.git tags/migration-20230515-pull-request for you to fetch changes up to 6da835d42a2163b43578ae745bc613b06dd5d23c: qemu-file: Remove total from qemu_file_total_transferred_*() (2023-05-15 13:4

[PATCH v2 08/16] migration: Use migration_transferred_bytes() to calculate rate_limit

2023-05-15 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater --- migration/migration-stats.h | 8 +++- migration/migration-stats.c | 7 +-- migration/migration.c | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/migration/migration-stats.h b/migration/migration-

[PATCH v2 10/16] migration: Don't abuse qemu_file transferred for RDMA

2023-05-15 Thread Juan Quintela
Just create a variable for it, the same way that multifd does. This way it is safe to use for other thread, etc, etc. Signed-off-by: Juan Quintela --- migration/migration-stats.h | 4 migration/migration-stats.c | 5 +++-- migration/rdma.c| 22 -- migratio

[PATCH v2 12/16] migration/rdma: Remove QEMUFile parameter when not used

2023-05-15 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/rdma.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 074456f9df..416dec00a2 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2027,7 +2027,7 @@ static int qe

[PATCH v2 14/16] migration: Remove unused qemu_file_credit_transfer()

2023-05-15 Thread Juan Quintela
After this change, nothing abuses QEMUFile to account for data transferrefd during migration. Signed-off-by: Juan Quintela --- migration/qemu-file.h | 8 migration/qemu-file.c | 5 - 2 files changed, 13 deletions(-) diff --git a/migration/qemu-file.h b/migration/qemu-file.h index e

[PATCH v2 04/16] qemu-file: Account for rate_limit usage on qemu_fflush()

2023-05-15 Thread Juan Quintela
That is the moment we know we have transferred something. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater --- migration/qemu-file.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 4bc875b452..956bd2a580 10

[PATCH v2 15/16] migration/rdma: Simplify the function that saves a page

2023-05-15 Thread Juan Quintela
When we sent a page through QEMUFile hooks (RDMA) there are three posiblities: - We are not using RDMA. return RAM_SAVE_CONTROL_DELAYED and control_save_page() returns false to let anything else to proceed. - There is one error but we are using RDMA. Then we return a negative value, control_sa

[PATCH v2 16/16] migration/multifd: Compute transferred bytes correctly

2023-05-15 Thread Juan Quintela
In the past, we had to put the in the main thread all the operations related with sizes due to qemu_file not beeing thread safe. As now all counters are atomic, we can update the counters just after the do the write. As an aditional bonus, we are able to use the right value for the compression me

[PATCH v2 09/16] migration: We don't need the field rate_limit_used anymore

2023-05-15 Thread Juan Quintela
Since previous commit, we calculate how much data we have send with migration_transferred_bytes() so no need to maintain this counter and remember to always update it. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater --- migration/migration-stats.h | 14 -- migration/migra

[PATCH v2 13/16] migration/rdma: Don't use imaginary transfers

2023-05-15 Thread Juan Quintela
RDMA protocol is completely asynchronous, so in qemu_rdma_save_page() they "invent" that a byte has been transferred. And then they call qemu_file_credit_transfer() and ram_transferred_add() with that byte. Just remove that calls as nothing has been sent. Signed-off-by: Juan Quintela --- migrat

[PATCH v2 11/16] migration/RDMA: It is accounting for zero/normal pages in two places

2023-05-15 Thread Juan Quintela
Remove the one in control_save_page(). Signed-off-by: Juan Quintela --- migration/ram.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index a706edecc0..67ed49b387 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1191,13 +1191,6 @@ static bool c

[PATCH v2 00/16] Migration: More migration atomic counters

2023-05-15 Thread Juan Quintela
Hi In this v2 series: - More documentation here and there. - Fix migration_rate_set() to really / XFER_LIMIT_RATIO - All reviewed patches are in Migration PULL request 20230515 - There are later reviewed patches, but that depend on the first ones that are still not reviewed. Please review

[PATCH v2 03/16] migration: Move setup_time to mig_stats

2023-05-15 Thread Juan Quintela
It is a time that needs to be cleaned each time cancel migration. Once there create migration_time_since() to calculate how time since a time in the past. Signed-off-by: Juan Quintela --- Rename to migration_time_since (cédric) --- migration/migration-stats.h | 13 + migration/migr

[PATCH v2 07/16] migration: Add a trace for migration_transferred_bytes

2023-05-15 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater --- migration/migration-stats.c | 8 ++-- migration/trace-events | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 9bd97caa23..301392d208 1006

[PATCH v2 02/16] migration: Correct transferred bytes value

2023-05-15 Thread Juan Quintela
We forget several places to add to trasferred amount of data. With this fixes I get: qemu_file_transferred() + multifd_bytes == transferred The only place whrer this is not true is during devices sending. But going all through the full tree searching for devices that use QEMUFile directly is

[PATCH v2 06/16] migration: Move migration_total_bytes() to migration-stats.c

2023-05-15 Thread Juan Quintela
Once there rename it to migration_transferred_bytes() and pass a QEMUFile instead of a migration object. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater --- migration/migration-stats.h | 11 +++ migration/migration-stats.c | 6 ++ migration/migration.c | 13 +++

[PATCH v2 05/16] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-15 Thread Juan Quintela
These way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Functions got renamed, they are not qemu_file anymore. qemu_file_rate_limit -> migration_rate_exceeded qemu_file_set_rate_limit -> migration_rate_set qemu_f

[PATCH v2 01/16] migration: Don't use INT64_MAX for unlimited rate

2023-05-15 Thread Juan Quintela
Define and use RATE_LIMIT_MAX instead. Signed-off-by: Juan Quintela --- migration/migration-stats.h | 6 ++ migration/migration.c | 4 ++-- migration/qemu-file.c | 6 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/migration/migration-stats.h b/migration/mi

[PATCH v3 05/14] nbd: Add types for extended headers

2023-05-15 Thread Eric Blake
Add the constants and structs necessary for later patches to start implementing the NBD_OPT_EXTENDED_HEADERS extension in both the client and server, matching recent commit e6f3b94a934] in the upstream nbd project. This patch does not change any existing behavior, but merely sets the stage. This

[PATCH v3 10/14] nbd/client: Initial support for extended headers

2023-05-15 Thread Eric Blake
Update the client code to be able to send an extended request, and parse an extended header from the server. Note that since we reject any structured reply with a too-large payload, we can always normalize a valid header back into the compact form, so that the caller need not deal with two branche

[PATCH v3 07/14] nbd/server: Refactor to pass full request around

2023-05-15 Thread Eric Blake
Part of NBD's 64-bit headers extension involves passing the client's requested offset back as part of the reply header (one reason for this change: converting absolute offsets stored in NBD_REPLY_TYPE_OFFSET_DATA to relative offsets within the buffer is easier if the absolute offset of the buffer i

[PATCH v3 12/14] nbd/client: Request extended headers during negotiation

2023-05-15 Thread Eric Blake
All the pieces are in place for a client to finally request extended headers. Note that we must not request extended headers when qemu-nbd is used to connect to the kernel module (as nbd.ko does not expect them), but there is no harm in all other clients requesting them. Extended headers are not

[PATCH v3 13/14] nbd/server: Prepare for per-request filtering of BLOCK_STATUS

2023-05-15 Thread Eric Blake
The next commit will add support for the new addition of NBD_CMD_FLAG_PAYLOAD during NBD_CMD_BLOCK_STATUS, where the client can request that the server only return a subset of negotiated contexts, rather than all contexts. To make that task easier, this patch populates the list of contexts to retu

[PATCH v3 04/14] nbd: Prepare for 64-bit request effect lengths

2023-05-15 Thread Eric Blake
Widen the length field of NBDRequest to 64-bits, although we can assert that all current uses are still under 32 bits. Move the request magic number to nbd.h, to live alongside the reply magic number. Convert 'bool structured_reply' into a tri-state enum that will eventually track whether the cli

[PATCH v3 06/14] nbd/server: Refactor handling of request payload

2023-05-15 Thread Eric Blake
Upcoming additions to support NBD 64-bit effect lengths allow for the possibility to distinguish between payload length (capped at 32M) and effect length (up to 63 bits). Without that extension, only the NBD_CMD_WRITE request has a payload; but with the extension, it makes sense to allow at least

[PATCH v3 11/14] nbd/client: Accept 64-bit block status chunks

2023-05-15 Thread Eric Blake
Because we use NBD_CMD_FLAG_REQ_ONE with NBD_CMD_BLOCK_STATUS, a client in narrow mode should not be able to provoke a server into sending a block status result larger than the client's 32-bit request. But in extended mode, a 64-bit status request must be able to handle a 64-bit status result, once

[PATCH v3 02/14] nbd/client: Add safety check on chunk payload length

2023-05-15 Thread Eric Blake
Our existing use of structured replies either reads into a qiov capped at 32M (NBD_CMD_READ) or caps allocation to 1000 bytes (see NBD_MAX_MALLOC_PAYLOAD in block/nbd.c). But the existing length checks are rather late; if we encounter a buggy (or malicious) server that sends a super-large payload

[PATCH v3 01/14] nbd/client: Use smarter assert

2023-05-15 Thread Eric Blake
Assigning strlen() to a uint32_t and then asserting that it isn't too large doesn't catch the case of an input string 4G in length. Thankfully, the incoming strings can never be that large: if the export name or query is reflecting a string the client got from the server, we already guarantee that

[PATCH v3 09/14] nbd/server: Initial support for extended headers

2023-05-15 Thread Eric Blake
Time to support clients that request extended headers. Now we can finally reach the code added across several previous patches. Even though the NBD spec has been altered to allow us to accept NBD_CMD_READ larger than the max payload size (provided our response is a hole or broken up over more tha

[PATCH v3 14/14] nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS

2023-05-15 Thread Eric Blake
Allow a client to request a subset of negotiated meta contexts. For example, a client may ask to use a single connection to learn about both block status and dirty bitmaps, but where the dirty bitmap queries only need to be performed on a subset of the disk; forcing the server to compute that info

[PATCH v3 08/14] nbd/server: Support 64-bit block status

2023-05-15 Thread Eric Blake
The NBD spec states that if the client negotiates extended headers, the server must avoid NBD_REPLY_TYPE_BLOCK_STATUS and instead use NBD_REPLY_TYPE_BLOCK_STATUS_EXT which supports 64-bit lengths, even if the reply does not need more than 32 bits. As of this patch, client->header_style is still ne

[PATCH v3 03/14] nbd/server: Prepare for alternate-size headers

2023-05-15 Thread Eric Blake
Upstream NBD now documents[1] an extension that supports 64-bit effect lengths in requests. As part of that extension, the size of the reply headers will change in order to permit a 64-bit length in the reply for symmetry[2]. Additionally, where the reply header is currently 16 bytes for simple r

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-15 Thread Juan Quintela
Cédric Le Goater wrote: > On 5/15/23 15:09, Juan Quintela wrote: >> Cédric Le Goater wrote: >>> On 5/8/23 15:08, Juan Quintela wrote: This way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Fun

Re: [PATCH 1/8] block: Call .bdrv_co_create(_opts) unlocked

2023-05-15 Thread Kevin Wolf
Am 12.05.2023 um 18:12 hat Eric Blake geschrieben: > > On Wed, May 10, 2023 at 10:35:54PM +0200, Kevin Wolf wrote: > > > > These are functions that modify the graph, so they must be able to take > > a writer lock. This is impossible if they already hold the reader lock. > > If they need a reader

[PULL v2 11/16] qemu-iotests: test zone append operation

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li The patch tests zone append writes by reporting the zone wp after the completion of the call. "zap -p" option can print the sector offset value after completion, which should be the start sector where the append write begins. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Mess

[PULL v2 10/16] block: introduce zone append write for zoned devices

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li A zone append command is a write operation that specifies the first logical block of a zone as the write position. When writing to a zoned block device using zone append, the byte offset of the call may point at any position within the zone to which the data is being appended. Upon c

[PULL v2 05/16] block: add zoned BlockDriver check to block layer

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230508045533.175575-6-faithi

[PULL v2 12/16] block: add some trace events for zone append

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi Message-id: 20230508051510.177850-5-faithilike...@gmail.com Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/bl

[PULL v2 09/16] file-posix: add tracking of the zone write pointers

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Since Linux doesn't have a user API to issue zone append operations to zoned devices from user space, the file-posix driver is modified to add zone append emulation using regular writes. To do this, the file-posix driver tracks the wp location of all zones of the device. It uses an a

[PULL v2 08/16] docs/zoned-storage: add zoned device documentation

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230508045533.175575-9-fai

[PULL v2 04/16] block/raw-format: add zone operations to pass through requests

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-

[PULL v2 14/16] block: add accounting for zone append operation

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li Message-id: 20230508051916.178322-3-faithilike...@gmail.com Signed-off-by: Stefan Hajnoczi ---

[PULL v2 07/16] block: add some trace events for new block layer APIs

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230508045533.175575-8-faithilike...@gmail.com Message-id: 20230324090605.28361-8-faithilike...@gmail.com Signed-off-by: Stefan Hajnoc

[PULL v2 16/16] docs/zoned-storage:add zoned emulation use case

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li Message-id: 20230508051916.178322-5-faithilike...@gmail.com [Fix pre-formatted code syntax --Stefan] Signed-off-by: Stefan Hajnoczi --- d

[PULL v2 13/16] virtio-blk: add zoned storage emulation for zoned devices

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li This patch extends virtio-blk emulation to handle zoned device commands by calling the new block layer APIs to perform zoned device I/O on behalf of the guest. It supports Report Zone, four zone oparations (open, close, finish, reset), and Append Zone. The VIRTIO_BLK_F_ZONED feature

[PULL v2 01/16] block/block-common: add zoned device structs

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230508045533.175575-2-faithilike...@gmail.com Message-id: 20230324090605.2

[PULL v2 15/16] virtio-blk: add some trace events for zoned emulation

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Message-id: 20230508051916.178322-4-faithilike...@gmail.com Signed-off-by: Stefan Hajnoczi --- hw/block/virtio-blk.c | 12 hw/block/trace-events | 7 +++ 2 files changed, 19 insertions(+) diff --git a/hw/block/

[PULL v2 06/16] iotests: test new zone operations

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li The new block layer APIs of zoned block devices can be tested by: $ tests/qemu-iotests/check zoned Run each zone operation on a newly created null_blk device and see whether it outputs the same zone information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Acked-by: Kevin Wo

[PULL v2 02/16] block/file-posix: introduce helper functions for sysfs attributes

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Review

[PULL v2 00/16] Block patches

2023-05-15 Thread Stefan Hajnoczi
The following changes since commit 8844bb8d896595ee1d25d21c770e6e6f29803097: Merge tag 'or1k-pull-request-20230513' of https://github.com/stffrdhrn/qemu into staging (2023-05-13 11:23:14 +0100) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-requ

[PULL v2 03/16] block/block-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-05-15 Thread Stefan Hajnoczi
From: Sam Li Add zoned device option to host_device BlockDriver. It will be presented only for zoned host block devices. By adding zone management operations to the host_block_device BlockDriver, users can use the new block layer APIs including Report Zone and four zone management operations (ope

Re: [PULL 09/28] block: bdrv/blk_co_unref() for calls in coroutine context

2023-05-15 Thread Michael Tokarev
15.05.2023 16:07, Kevin Wolf wrote: Am 11.05.2023 um 17:32 hat Michael Tokarev geschrieben: 10.05.2023 15:20, Kevin Wolf wrote: These functions must not be called in coroutine context, because they need write access to the graph. How important for this and 2 surrounding changes to be for 7.2-

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-15 Thread Juan Quintela
Cédric Le Goater wrote: > On 5/15/23 15:09, Juan Quintela wrote: >> Cédric Le Goater wrote: >>> On 5/8/23 15:08, Juan Quintela wrote: This way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Fun

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-15 Thread Cédric Le Goater
On 5/15/23 15:09, Juan Quintela wrote: Cédric Le Goater wrote: On 5/8/23 15:08, Juan Quintela wrote: This way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Functions got renamed, they are not qemu_file anymore

Re: [PATCH 14/21] migration: We don't need the field rate_limit_used anymore

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:09, Juan Quintela wrote: Since previous commit, we calculate how much data we have send with migration_transferred_bytes() so no need to maintain this counter and remember to always update it. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater Thanks, C. --- mig

Re: [PATCH 11/21] migration: Move migration_total_bytes() to migration-stats.c

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: Once there rename it to migration_transferred_bytes() and pass a QEMUFile instead of a migration object. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater C. --- migration/migration-stats.c | 6 ++ migration/migration-stats.h | 9 ++

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-15 Thread Juan Quintela
Cédric Le Goater wrote: > On 5/8/23 15:08, Juan Quintela wrote: >> This way we can make them atomic and use this functions from any >> place. I also moved all functions that use rate_limit to >> migration-stats. >> Functions got renamed, they are not qemu_file anymore. >> qemu_file_rate_limit ->

Re: [PULL 09/28] block: bdrv/blk_co_unref() for calls in coroutine context

2023-05-15 Thread Kevin Wolf
Am 11.05.2023 um 17:32 hat Michael Tokarev geschrieben: > 10.05.2023 15:20, Kevin Wolf wrote: > > These functions must not be called in coroutine context, because they > > need write access to the graph. > > How important for this and 2 surrounding changes to be for 7.2-stable > (if we'll ever rel

Re: [PATCH 12/21] migration: Add a trace for migration_transferred_bytes

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:09, Juan Quintela wrote: Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater Thanks, C. --- migration/migration-stats.c | 8 ++-- migration/trace-events | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/migration/migration-stats.c b/

Re: [PATCH 13/21] migration: Use migration_transferred_bytes() to calculate rate_limit

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:09, Juan Quintela wrote: Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater C. --- migration/migration-stats.c | 7 +-- migration/migration-stats.h | 6 +- migration/migration.c | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: This way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Functions got renamed, they are not qemu_file anymore. qemu_file_rate_limit -> migration_rate_limit_exceeded qemu_fil

[PULL 05/11] migration: Teach dirtyrate about qemu_target_page_bits()

2023-05-15 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230511141208.17779-5-quint...@redhat.com> --- migration/dirtyrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.

[PULL 09/11] qemu-file: make qemu_file_[sg]et_rate_limit() use an uint64_t

2023-05-15 Thread Juan Quintela
It is really size_t. Everything else uses uint64_t, so move this to uint64_t as well. A size can't be negative anyways. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater Message-Id: <20230508130909.65420-5-quint...@redhat.com> --- migration/qemu-file.h | 4 ++-- migration/qemu-file.c

[PULL 04/11] migration: Teach dirtyrate about qemu_target_page_size()

2023-05-15 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230511141208.17779-4-quint...@redhat.com> --- migration/dirtyrate.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration/dirtyrate.c b/migration/dirtyr

[PULL 03/11] Use new created qemu_target_pages_to_MiB()

2023-05-15 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Richard Henderson Message-Id: <20230511141208.17779-3-quint...@redhat.com> --- migration/dirtyrate.c | 11 +-- softmmu/dirtylimit.c | 11 +++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/migration/dirtyrate.c b/migrati

[PULL 08/11] migration: We set the rate_limit by a second

2023-05-15 Thread Juan Quintela
That the implementation does the check every 100 milliseconds is an implementation detail that shouldn't be seen on the interfaz. Notice that all callers of qemu_file_set_rate_limit() used the division or pass 0, so this change is a NOP. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater

[PULL 07/11] migration: A rate limit value of 0 is valid

2023-05-15 Thread Juan Quintela
And it is the best way to not have rate_limit. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater Message-Id: <20230508130909.65420-2-quint...@redhat.com> --- migration/migration.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/migration/migration.c b/migratio

[PULL 11/11] qemu-file: Remove total from qemu_file_total_transferred_*()

2023-05-15 Thread Juan Quintela
Function is already quite long. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater Message-Id: <20230508130909.65420-7-quint...@redhat.com> --- migration/qemu-file.h | 10 +- migration/block.c | 4 ++-- migration/migration.c | 2 +- migration/qemu-file.c | 4 ++-- migrati

[PULL 06/11] migration: Make dirtyrate.c target independent

2023-05-15 Thread Juan Quintela
After the previous two patches, there is nothing else that is target specific. Signed-off-by: Juan Quintela Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230511141208.17779-6-quint...@redhat.com> --- migration/dirtyrate.c | 2 -- migration/meson.build | 4 ++

[PULL 10/11] qemu-file: Make rate_limit_used an uint64_t

2023-05-15 Thread Juan Quintela
Change all the functions that use it. It was already passed as uint64_t. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrangé Reviewed-by: Cédric Le Goater Message-Id: <20230508130909.65420-6-quint...@redhat.com> --- migration/qemu-file.h | 2 +- migration/qemu-file.c | 4 ++-- 2 file

[PULL 01/11] migration/calc-dirty-rate: replaced CRC32 with xxHash

2023-05-15 Thread Juan Quintela
From: Andrei Gudkov This significantly reduces overhead of dirty page rate calculation in sampling mode. Tested using 32GiB VM on E5-2690 CPU. With CRC32: total_pages=8388608 sampled_pages=16384 millis=71 With xxHash: total_pages=8388608 sampled_pages=16384 millis=14 Signed-off-by: Andrei Gudk

[PULL 02/11] softmmu: Create qemu_target_pages_to_MiB()

2023-05-15 Thread Juan Quintela
Function that convert a number of target_pages into its size in MiB. Suggested-by: Richard Henderson Richard Henderson Signed-off-by: Juan Quintela Message-Id: <20230511141208.17779-2-quint...@redhat.com> --- include/exec/target_page.h | 1 + softmmu/physmem.c | 11 +++ 2 fil

[PULL 00/11] Migration 20230515 patches

2023-05-15 Thread Juan Quintela
/migration-20230515-pull-request for you to fetch changes up to 6da835d42a2163b43578ae745bc613b06dd5d23c: qemu-file: Remove total from qemu_file_total_transferred_*() (2023-05-15 13:46:14 +0200) Migration Pull request 20230515 H

Re: [PATCH 09/21] qemu-file: Account for rate_limit usage on qemu_fflush()

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: That is the moment we know we have transferred something. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater Thanks, C. --- migration/qemu-file.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/migration/qemu-fil

Re: [PATCH 08/21] migration: Move setup_time to mig_stats

2023-05-15 Thread Juan Quintela
Cédric Le Goater wrote: > On 5/8/23 15:08, Juan Quintela wrote: >> It is a time that needs to be cleaned each time cancel migration. >> Once there ccreate calculate_time_since() to calculate how time since >> a time in the past. >> Signed-off-by: Juan Quintela >> --- >> migration/migration-stat

Re: [PATCH 03/21] migration: We set the rate_limit by a second

2023-05-15 Thread Juan Quintela
Cédric Le Goater wrote: > On 5/8/23 15:08, Juan Quintela wrote: >> That the implementation does the check every 100 milliseconds is an >> implementation detail that shouldn't be seen on the interfaz. > > Si. Pero, "interface" es mejor aqui. Muchas gracias. > >> Notice that all callers of qemu_fi

Re: [PATCH 02/21] migration: Don't use INT64_MAX for unlimited rate

2023-05-15 Thread Juan Quintela
Cédric Le Goater wrote: > On 5/9/23 13:51, Juan Quintela wrote: >> Harsh Prateek Bora wrote: >>> On 5/8/23 18:38, Juan Quintela wrote: Use 0 instead. Signed-off-by: Juan Quintela --- migration/migration.c | 4 ++-- migration/qemu-file.c | 3 +++ 2 files chang

Re: [PATCH 08/21] migration: Move setup_time to mig_stats

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: It is a time that needs to be cleaned each time cancel migration. Once there ccreate calculate_time_since() to calculate how time since a time in the past. Signed-off-by: Juan Quintela --- migration/migration-stats.c | 7 +++ migration/migration-sta

Re: [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-15 Thread Stefano Garzarella
On Thu, May 11, 2023 at 11:03:22AM -0500, Jonathon Jongsma wrote: On 5/11/23 4:15 AM, Stefano Garzarella wrote: The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the new 'fd' property. Let's expose this to the user, so the management layer can pass the file descriptor of an already ope

Re: [PATCH 06/21] qemu-file: Remove total from qemu_file_total_transferred_*()

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: Function is already quite long. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater C. --- migration/block.c | 4 ++-- migration/migration.c | 2 +- migration/qemu-file.c | 4 ++-- migration/qemu-file.h | 10 +- migration

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-15 Thread Harsh Prateek Bora
On 5/9/23 16:40, Juan Quintela wrote: Harsh Prateek Bora wrote: On 5/8/23 18:38, Juan Quintela wrote: This way we can make them atomic and use this functions from any s/this/these Fixed. Sure, providing ack from ppc/spapr perspective. Reviewed-by: Harsh Prateek Bora Thanks.

Re: [PATCH 05/21] qemu-file: Make rate_limit_used an uint64_t

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: Change all the functions that use it. It was already passed as uint64_t. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrangé Message-Id: <20230504113841.23130-5-quint...@redhat.com> Reviewed-by: Cédric Le Goater C. --- migration/qemu-fil

Re: [PATCH 04/21] qemu-file: make qemu_file_[sg]et_rate_limit() use an uint64_t

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: It is really size_t. Everything else uses uint64_t, so move this to uint64_t as well. A size can't be negative anyways. Signed-off-by: Juan Quintela Message-Id: <20230504113841.23130-4-quint...@redhat.com> Reviewed-by: Cédric Le Goater C. * --- D

Re: [PATCH 03/21] migration: We set the rate_limit by a second

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: That the implementation does the check every 100 milliseconds is an implementation detail that shouldn't be seen on the interfaz. Si. Pero, "interface" es mejor aqui. Notice that all callers of qemu_file_set_rate_limit() used the division or pass 0, so th

Re: [PATCH 02/21] migration: Don't use INT64_MAX for unlimited rate

2023-05-15 Thread Cédric Le Goater
On 5/9/23 13:51, Juan Quintela wrote: Harsh Prateek Bora wrote: On 5/8/23 18:38, Juan Quintela wrote: Use 0 instead. Signed-off-by: Juan Quintela --- migration/migration.c | 4 ++-- migration/qemu-file.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/m

Re: [PATCH 01/21] migration: A rate limit value of 0 is valid

2023-05-15 Thread Cédric Le Goater
On 5/8/23 15:08, Juan Quintela wrote: And it is the best way to not have rate_limit. Signed-off-by: Juan Quintela Reviewed-by: Cédric Le Goater C. --- migration/migration.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/migration/migration.c b/migration/migra