[PATCH v2 03/11] qcow2: put discard requests in the common queue when discard-no-unref enabled

2024-05-13 Thread Andrey Drobyshev
for the presence of external data files for us and redirect request to underlying data_file. Here we want to do the same but avoid refcount updates, thus we perform the same checks. Suggested-by: Hanna Czenczek Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 39

[PATCH v2 06/11] iotests/290: add test case to check 'discard-no-unref' option behavior

2024-05-13 Thread Andrey Drobyshev
) and that with the option enabled cluster is still marked as allocated in "qemu-img map" output. We also check that the option doesn't work with qcow2 v2 images. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/290 | 34 ++ tests/qemu-iotests/29

[PATCH v2 00/11] qcow2: make subclusters discardable

2024-05-13 Thread Andrey Drobyshev
v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-10/msg07223.html Andrey Drobyshev (11): qcow2: make function update_refcount_discard() global qcow2: simplify L2 entries accounting for discard-no-unref qcow2: put discard requests in the common queue when discard-no-unref

[PATCH v2 11/11] iotests/271: add test cases for subcluster-based discard/unmap

2024-05-13 Thread Andrey Drobyshev
make all discard/unmap operations enable trace point 'file_do_fallocate' so that actual fallocate() calls are visible. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/271 | 70 +- tests/qemu-iotests/271.out | 69 ++--- 2

[PATCH v2 07/11] qcow2: add get_sc_range_info() helper for working with subcluster ranges

2024-05-13 Thread Andrey Drobyshev
. Also introduce struct SubClusterRangeInfo, which would contain all the needed params. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 140 -- 1 file changed, 108 insertions(+), 32 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2

[PATCH v2 05/11] iotests/common.rc: add disk_usage function

2024-05-13 Thread Andrey Drobyshev
Move the definition from iotests/250 to common.rc. This is used to detect real disk usage of sparse files. In particular, we want to use it for checking subclusters-based discards. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/250 | 5 - tests/qemu-iotests/common.rc | 6

[PATCH v2 09/11] qcow2: make subclusters discardable

2024-05-13 Thread Andrey Drobyshev
) with subclusters enabled. Also rename qcow2_cluster_discard() -> qcow2_subcluster_discard() to reflect the change. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 106 + block/qcow2-snapshot.c | 6 +-- block/qcow2.c | 25 +- bl

[PATCH v2 02/11] qcow2: simplify L2 entries accounting for discard-no-unref

2024-05-13 Thread Andrey Drobyshev
whether we unmap or zeroize the cluster. For that OR'ing with the old entry is enough. This patch doesn't change the logic and is pure refactoring. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions

[PATCH v2 04/11] block/file-posix: add trace event for fallocate() calls

2024-05-13 Thread Andrey Drobyshev
This would ease debugging of write zeroes and discard operations. Signed-off-by: Andrey Drobyshev --- block/file-posix.c | 1 + block/trace-events | 1 + 2 files changed, 2 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 35684f7e21..45134f0eef 100644 --- a/block/file

[PATCH v2 10/11] qcow2: zero_l2_subclusters: fall through to discard operation when requested

2024-05-13 Thread Andrey Drobyshev
to actual unmap. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 3c134a7e80..53e04eff93 100644 --- a/block/qcow2-cluster.c +++ b/b

[PATCH v2 01/11] qcow2: make function update_refcount_discard() global

2024-05-13 Thread Andrey Drobyshev
We are going to need it for discarding separate subclusters. The function itself doesn't do anything with the refcount tables, it simply adds a discard request to the queue, so rename it to qcow2_queue_discard(). Signed-off-by: Andrey Drobyshev Reviewed-by: Hanna Czenczek --- block/qcow2

[PATCH v2 08/11] qcow2: zeroize the entire cluster when there're no non-zero subclusters

2024-05-13 Thread Andrey Drobyshev
When zeroizing the last non-zero subclusters within single cluster, it makes sense to go zeroize the entire cluster and go down zero_in_l2_slice() path right away. That way we'd also update the corresponding refcount table. Signed-off-by: Andrey Drobyshev Reviewed-by: Hanna Czenczek --- block

Re: [BUG, RFC] Base node is in RW after making external snapshot

2024-05-10 Thread Andrey Drobyshev
On 4/24/24 21:00, Andrey Drobyshev wrote: > Hi everyone, > > When making an external snapshot, we end up in a situation when 2 block > graph nodes related to the same image file (format and storage nodes) > have different RO flags set on them. > > E.g. > > # ls -la

[BUG, RFC] Base node is in RW after making external snapshot

2024-04-24 Thread Andrey Drobyshev
Hi everyone, When making an external snapshot, we end up in a situation when 2 block graph nodes related to the same image file (format and storage nodes) have different RO flags set on them. E.g. # ls -la /proc/PID/fd lrwx-- 1 root qemu 64 Apr 24 20:14 12 -> /path/to/harddisk.hdd # virsh

Re: [PATCH 4/7] qcow2: make subclusters discardable

2024-04-16 Thread Andrey Drobyshev
On 10/27/23 14:10, Jean-Louis Dupond wrote: > [...] > > I've checked all the code paths, and as far as I see it nowhere breaks > the discard_no_unref option. > It's important that we don't introduce new code paths that can make > holes in the qcow2 image when this option is enabled :) > > If you

Re: [PATCH v4 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-privileged' field

2024-04-01 Thread Andrey Drobyshev
On 3/22/24 15:17, Andrey Drobyshev wrote: > On 3/22/24 12:39, Daniel P. Berrangé wrote: >> On Wed, Mar 20, 2024 at 06:16:42PM +0200, Andrey Drobyshev wrote: >>> Since the commit 25b5ff1a86 ("qga: add mountpoint usage info to >>> GuestFilesystemInfo") we have

Re: [PATCH v4 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-privileged' field

2024-03-22 Thread Andrey Drobyshev
On 3/22/24 12:39, Daniel P. Berrangé wrote: > On Wed, Mar 20, 2024 at 06:16:42PM +0200, Andrey Drobyshev wrote: >> Since the commit 25b5ff1a86 ("qga: add mountpoint usage info to >> GuestFilesystemInfo") we have 2 values reported in guest-get-fsinfo: >> use

[PATCH v4 3/7] qga/commands-posix: qmp_guest_shutdown: use ga_run_command helper

2024-03-20 Thread Andrey Drobyshev
Also remove the G_GNUC_UNUSED attribute added in the previous commit from the helper. Signed-off-by: Andrey Drobyshev Reviewed-by: Daniel P. Berrangé --- qga/commands-posix.c | 39 ++- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/qga

[PATCH v4 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-privileged' field

2024-03-20 Thread Andrey Drobyshev
here, also tweak the docs to reflect better where those values come from. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 2 ++ qga/commands-win32.c | 1 + qga/qapi-schema.json | 7 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qga/commands-posix.c b/qga/comman

[PATCH v4 5/7] qga/commands-posix: execute_fsfreeze_hook: use ga_run_command helper

2024-03-20 Thread Andrey Drobyshev
There's no need to check for the existence of the hook executable, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev Reviewed-by: Daniel P. Berrangé --- qga/commands-posix.c | 35 +++ 1 file changed, 3 insertions(+), 32 deletions(-) diff

[PATCH v4 0/7] qga/commands-posix: replace code duplicating commands with a helper

2024-03-20 Thread Andrey Drobyshev
declaration. v3: https://lists.nongnu.org/archive/html/qemu-devel/2024-03/msg04068.html Andrey Drobyshev (7): qga: guest-get-fsinfo: add optional 'total-bytes-privileged' field qga: introduce ga_run_command() helper for guest cmd execution qga/commands-posix: qmp_guest_shutdown: use ga_run_command help

[PATCH v4 6/7] qga/commands-posix: don't do fork()/exec() when suspending via sysfs

2024-03-20 Thread Andrey Drobyshev
te. Let's just use g_file_set_contents() to simplify things here. Suggested-by: Daniel P. Berrangé Signed-off-by: Andrey Drobyshev Reviewed-by: Daniel P. Berrangé --- qga/commands-posix.c | 41 + 1 file changed, 5 insertions(+), 36 deletions(-) diff -

[PATCH v4 4/7] qga/commands-posix: qmp_guest_set_time: use ga_run_command helper

2024-03-20 Thread Andrey Drobyshev
There's no need to check for the existence of "/sbin/hwclock", the exec() call will do that for us. Signed-off-by: Andrey Drobyshev Reviewed-by: Daniel P. Berrangé --- qga/commands-posix.c | 43 +++ 1 file changed, 3 insertions(+), 40 deletion

[PATCH v4 7/7] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper

2024-03-20 Thread Andrey Drobyshev
There's no need to check for the existence of the "chpasswd", "pw" executables, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev Reviewed-by: Daniel P. Berrangé --- qga/commands-posix.c | 96 ++-- 1 file ch

[PATCH v4 2/7] qga: introduce ga_run_command() helper for guest cmd execution

2024-03-20 Thread Andrey Drobyshev
bisectable, let's replace qmp commands implementations one by one. Also add G_GNUC_UNUSED attribute to the helper and remove it in the next commit. Originally-by: Yuri Pudgorodskiy Signed-off-by: Andrey Drobyshev Reviewed-by: Daniel P. Berrangé --- qga/commands-posix.c | 150

Re: [PATCH v3 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-root' field

2024-03-20 Thread Andrey Drobyshev
On 3/19/24 19:37, Daniel P. Berrangé wrote: > On Fri, Mar 15, 2024 at 02:29:40PM +0200, Andrey Drobyshev wrote: >> Since the commit 25b5ff1a86 ("qga: add mountpoint usage info to >> GuestFilesystemInfo") we have 2 values reported in guest-get-fsinfo: >> use

Re: [PATCH v3 6/7] qga/commands-posix: don't do fork()/exec() when suspending via sysfs

2024-03-20 Thread Andrey Drobyshev
On 3/19/24 20:02, Daniel P. Berrangé wrote: > On Fri, Mar 15, 2024 at 02:29:45PM +0200, Andrey Drobyshev wrote: >> Since commit 246d76eba ("qga: guest_suspend: decoupling pm-utils and sys >> logic") pm-utils logic is running in a separate child from the sysfs >>

Re: [PATCH v3 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-root' field

2024-03-15 Thread Andrey Drobyshev
On 3/15/24 15:44, Markus Armbruster wrote: > [?? ??? ? ?? ?? arm...@redhat.com. ???, ?? ??? ?, > ?? ?? https://aka.ms/LearnAboutSenderIdentification ] > > Andrey Drobyshev writes: > >> Since the commit 25b5ff1a86 ("qga:

[PATCH v3 5/7] qga/commands-posix: execute_fsfreeze_hook: use ga_run_command helper

2024-03-15 Thread Andrey Drobyshev
There's no need to check for the existence of the hook executable, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 35 +++ 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/qga/commands-posix.c b/qga

[PATCH v3 7/7] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper

2024-03-15 Thread Andrey Drobyshev
There's no need to check for the existence of the "chpasswd", "pw" executables, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 96 ++-- 1 file changed, 13 insertions(+), 83 deletions(

[PATCH v3 3/7] qga/commands-posix: qmp_guest_shutdown: use ga_run_command helper

2024-03-15 Thread Andrey Drobyshev
Also remove the G_GNUC_UNUSED attribute added in the previous commit from the helper. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 39 ++- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c

[PATCH v3 4/7] qga/commands-posix: qmp_guest_set_time: use ga_run_command helper

2024-03-15 Thread Andrey Drobyshev
There's no need to check for the existence of "/sbin/hwclock", the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 43 +++ 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/qga/commands

[PATCH v3 2/7] qga: introduce ga_run_command() helper for guest cmd execution

2024-03-15 Thread Andrey Drobyshev
bisectable, let's replace qmp commands implementations one by one. Also add G_GNUC_UNUSED attribute to the helper and remove it in the next commit. Originally-by: Yuri Pudgorodskiy Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 150 +++ 1 file

[PATCH v3 6/7] qga/commands-posix: don't do fork()/exec() when suspending via sysfs

2024-03-15 Thread Andrey Drobyshev
te. Let's just use g_file_set_contents() to simplify things here. Suggested-by: Daniel P. Berrangé Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 41 + 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/qga/commands-posix.c b/qg

[PATCH v3 0/7] qga/commands-posix: replace code duplicating commands with a helper

2024-03-15 Thread Andrey Drobyshev
tps://lists.nongnu.org/archive/html/qemu-devel/2024-03/msg00147.html Andrey Drobyshev (7): qga: guest-get-fsinfo: add optional 'total-bytes-root' field qga: introduce ga_run_command() helper for guest cmd execution qga/commands-posix: qmp_guest_shutdown: use ga_run_command helper qga/commands-po

[PATCH v3 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-root' field

2024-03-15 Thread Andrey Drobyshev
ere, let's document better where those values come from in both POSIX and Windows. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 2 ++ qga/commands-win32.c | 1 + qga/qapi-schema.json | 12 +++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/qga/commands-pos

Re: [PATCH v2 6/7] qga/commands-posix: use ga_run_command helper when suspending via sysfs

2024-03-15 Thread Andrey Drobyshev
On 3/5/24 20:34, Daniel P. Berrangé wrote: > [Вы нечасто получаете письма от berra...@redhat.com. Узнайте, почему это > важно, по адресу https://aka.ms/LearnAboutSenderIdentification ] > > On Fri, Mar 01, 2024 at 07:28:57PM +0200, Andrey Drobyshev wrote: >> We replace the d

Re: [PATCH v2 2/7] qga: introduce ga_run_command() helper for guest cmd execution

2024-03-15 Thread Andrey Drobyshev
On 3/5/24 19:58, Daniel P. Berrangé wrote: > On Fri, Mar 01, 2024 at 07:28:53PM +0200, Andrey Drobyshev wrote: >> When executing guest commands in *nix environment, we repeat the same >> fork/exec pattern multiple times. Let's just separate it into a single >> helper whi

Re: [PATCH v2 7/7] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper

2024-03-15 Thread Andrey Drobyshev
On 3/5/24 20:38, Daniel P. Berrangé wrote: > On Fri, Mar 01, 2024 at 07:28:58PM +0200, Andrey Drobyshev wrote: >> There's no need to check for the existence of the "chpasswd", "pw" >> executables, as the exec() call will do that for us. >> >>

[PATCH v2 4/7] qga/commands-posix: qmp_guest_set_time: use ga_run_command helper

2024-03-01 Thread Andrey Drobyshev
There's no need to check for the existence of "/sbin/hwclock", the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 43 +++ 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/qga/commands

[PATCH v2 3/7] qga/commands-posix: qmp_guest_shutdown: use ga_run_command helper

2024-03-01 Thread Andrey Drobyshev
Also remove the G_GNUC_UNUSED attribute added in the previous commit from the helper. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 39 ++- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c

[PATCH v2 0/7] qga/commands-posix: replace code duplicating commands with a helper

2024-03-01 Thread Andrey Drobyshev
ues come from. v1: https://lists.nongnu.org/archive/html/qemu-devel/2024-02/msg05766.html Andrey Drobyshev (7): qga: guest-get-fsinfo: add optional 'total-bytes-root' field qga: introduce ga_run_command() helper for guest cmd execution qga/commands-posix: qmp_guest_shutdown: use ga_run_comm

[PATCH v2 2/7] qga: introduce ga_run_command() helper for guest cmd execution

2024-03-01 Thread Andrey Drobyshev
bisectable, let's replace qmp commands implementations one by one. Also add G_GNUC_UNUSED attribute to the helper and remove it in the next commit. Originally-by: Yuri Pudgorodskiy Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 140 +++ 1 file

[PATCH v2 7/7] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper

2024-03-01 Thread Andrey Drobyshev
There's no need to check for the existence of the "chpasswd", "pw" executables, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 96 ++-- 1 file changed, 13 insertions(+), 83 deletions(

[PATCH v2 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-root' field

2024-03-01 Thread Andrey Drobyshev
ere, let's document better where those values come from in both POSIX and Windows. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 2 ++ qga/commands-win32.c | 1 + qga/qapi-schema.json | 12 +++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/qga/commands-pos

[PATCH v2 6/7] qga/commands-posix: use ga_run_command helper when suspending via sysfs

2024-03-01 Thread Andrey Drobyshev
We replace the direct call to open() with a "sh -c 'echo ...'" call, so that it becomes an executable command. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 36 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/qga/comman

[PATCH v2 5/7] qga/commands-posix: execute_fsfreeze_hook: use ga_run_command helper

2024-03-01 Thread Andrey Drobyshev
There's no need to check for the existence of the hook executable, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 35 +++ 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/qga/commands-posix.c b/qga

Re: [PATCH 1/7] qga/commands-posix: return fsinfo values directly as reported by statvfs

2024-03-01 Thread Andrey Drobyshev
On 2/28/24 09:55, Marc-André Lureau wrote: > [Вы нечасто получаете письма от marcandre.lur...@redhat.com. Узнайте, почему > это важно, по адресу https://aka.ms/LearnAboutSenderIdentification ] > > Hi > > On Tue, Feb 27, 2024 at 4:38 PM Andrey Drobyshev > wrote: >>

Re: [PATCH 1/7] qga/commands-posix: return fsinfo values directly as reported by statvfs

2024-02-27 Thread Andrey Drobyshev
On 2/26/24 20:50, Konstantin Kostiuk wrote: > > Best Regards, > Konstantin Kostiuk. > > > On Mon, Feb 26, 2024 at 7:02 PM Andrey Drobyshev > mailto:andrey.drobys...@virtuozzo.com>> > wrote: > > Since the commit 25b5ff1a86 ("qga: add mountpoin

[PATCH 7/7] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper

2024-02-26 Thread Andrey Drobyshev
There's no need to check for the existence of the "chpasswd", "pw" executables, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 96 ++-- 1 file changed, 13 insertions(+), 83 deletions(

[PATCH 1/7] qga/commands-posix: return fsinfo values directly as reported by statvfs

2024-02-26 Thread Andrey Drobyshev
t into QGA source to understand how they're obtained. Let's just report the values f_blocks, f_bfree, f_bavail (in bytes) from statvfs() as they are, letting the user decide how to process them further. Originally-by: Yuri Pudgorodskiy Signed-off-by: Andrey Drobyshev --- qga/commands-po

[PATCH 3/7] qga/commands-posix: qmp_guest_shutdown: use ga_run_command helper

2024-02-26 Thread Andrey Drobyshev
Also remove the G_GNUC_UNUSED attribute added in the previous commit from the helper. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 39 ++- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c

[PATCH 2/7] qga: introduce ga_run_command() helper for guest cmd execution

2024-02-26 Thread Andrey Drobyshev
bisectable, let's replace qmp commands implementations one by one. Also add G_GNUC_UNUSED attribute to the helper and remove it in the next commit. Originally-by: Yuri Pudgorodskiy Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 140 +++ 1 file

[PATCH 6/7] qga/commands-posix: use ga_run_command helper when suspending via sysfs

2024-02-26 Thread Andrey Drobyshev
We replace the direct call to open() with a "sh -c 'echo ...'" call, so that it becomes an executable command. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 36 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/qga/comman

[PATCH 0/7] qga/commands-posix: replace code duplicating commands with a helper

2024-02-26 Thread Andrey Drobyshev
values. Andrey Drobyshev (7): qga/commands-posix: return fsinfo values directly as reported by statvfs qga: introduce ga_run_command() helper for guest cmd execution qga/commands-posix: qmp_guest_shutdown: use ga_run_command helper qga/commands-posix: qmp_guest_set_time: use

[PATCH 5/7] qga/commands-posix: execute_fsfreeze_hook: use ga_run_command helper

2024-02-26 Thread Andrey Drobyshev
There's no need to check for the existence of the hook executable, as the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 35 +++ 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/qga/commands-posix.c b/qga

[PATCH 4/7] qga/commands-posix: qmp_guest_set_time: use ga_run_command helper

2024-02-26 Thread Andrey Drobyshev
There's no need to check for the existence of "/sbin/hwclock", the exec() call will do that for us. Signed-off-by: Andrey Drobyshev --- qga/commands-posix.c | 43 +++ 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/qga/commands

Re: [PATCH] kvm: emit GUEST_PANICKED event in case of abnormal KVM exit

2024-02-08 Thread Andrey Drobyshev
On 1/25/24 18:36, Andrey Drobyshev wrote: > On 1/11/24 15:15, Andrey Drobyshev wrote: >> On 11/1/23 18:13, Denis V. Lunev wrote: >>> On 11/1/23 16:23, Andrey Drobyshev wrote: >>>> Currently we emit GUEST_PANICKED event in case kvm_vcpu_ioctl() returns >>>>

Re: [PATCH] block: allocate aligned write buffer for 'truncate -m full'

2024-02-08 Thread Andrey Drobyshev
On 1/25/24 18:46, Vladimir Sementsov-Ogievskiy wrote: > On 11.12.23 13:55, Andrey Drobyshev wrote: >> In case we're truncating an image opened with O_DIRECT, we might get >> -EINVAL on write with unaligned buffer.  In particular, when running >> iotests/298 with '-nocache'

Re: [PATCH] iotests: don't run tests requiring cached writes in '-nocache' mode

2024-01-26 Thread Andrey Drobyshev
On 1/26/24 12:24, Kevin Wolf wrote: > Am 11.12.2023 um 14:32 hat Andrey Drobyshev geschrieben: >> There're tests whose logic implies running without O_DIRECT set, >> otherwise they fail when running iotests in '-nocache' mode. For these >> tests let's add _require_no_o_dire

Re: [PATCH] block: allocate aligned write buffer for 'truncate -m full'

2024-01-25 Thread Andrey Drobyshev
On 1/11/24 14:53, Andrey Drobyshev wrote: > On 12/11/23 13:27, Denis V. Lunev wrote: >> On 12/11/23 11:55, Andrey Drobyshev wrote: >>> In case we're truncating an image opened with O_DIRECT, we might get >>> -EINVAL on write with unaligned buffer.  In particular, w

Re: [PATCH] kvm: emit GUEST_PANICKED event in case of abnormal KVM exit

2024-01-25 Thread Andrey Drobyshev
On 1/11/24 15:15, Andrey Drobyshev wrote: > On 11/1/23 18:13, Denis V. Lunev wrote: >> On 11/1/23 16:23, Andrey Drobyshev wrote: >>> Currently we emit GUEST_PANICKED event in case kvm_vcpu_ioctl() returns >>> KVM_EXIT_SYSTEM_EVENT with the event type KVM_SYSTEM_EVE

Re: [PATCH] iotests: don't run tests requiring cached writes in '-nocache' mode

2024-01-25 Thread Andrey Drobyshev
On 1/11/24 14:53, Andrey Drobyshev wrote: > On 12/11/23 15:32, Andrey Drobyshev wrote: >> There're tests whose logic implies running without O_DIRECT set, >> otherwise they fail when running iotests in '-nocache' mode. For these >> tests let's add _require_no_o_direct() he

Re: [PATCH] iotests/277: Use iotests.sock_dir for socket creation

2024-01-25 Thread Andrey Drobyshev
On 1/24/24 19:59, Denis V. Lunev wrote: > On 1/24/24 18:43, Eric Blake wrote: >> On Wed, Jan 24, 2024 at 06:22:57PM +0200, Andrey Drobyshev wrote: >>> If socket path is too long (longer than 108 bytes), socket can't be >>> opened.  This might lead to failure when t

[PATCH] iotests/264: Use iotests.sock_dir for socket creation

2024-01-25 Thread Andrey Drobyshev
-by: Andrey Drobyshev --- tests/qemu-iotests/264 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/264 b/tests/qemu-iotests/264 index c532ccd809..c6ba2754e2 100755 --- a/tests/qemu-iotests/264 +++ b/tests/qemu-iotests/264 @@ -25,7 +25,8 @@ import os import iotests

[PATCH] iotests/277: Use iotests.sock_dir for socket creation

2024-01-24 Thread Andrey Drobyshev
-by: Andrey Drobyshev --- tests/qemu-iotests/277 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/277 b/tests/qemu-iotests/277 index 24833e7eb6..4224202ac2 100755 --- a/tests/qemu-iotests/277 +++ b/tests/qemu-iotests/277 @@ -27,7 +27,8 @@ from iotests import file_path

Re: [PATCH] kvm: emit GUEST_PANICKED event in case of abnormal KVM exit

2024-01-11 Thread Andrey Drobyshev
On 11/1/23 18:13, Denis V. Lunev wrote: > On 11/1/23 16:23, Andrey Drobyshev wrote: >> Currently we emit GUEST_PANICKED event in case kvm_vcpu_ioctl() returns >> KVM_EXIT_SYSTEM_EVENT with the event type KVM_SYSTEM_EVENT_CRASH.  Let's >> extend this scenario and emit G

Re: [PATCH] block: allocate aligned write buffer for 'truncate -m full'

2024-01-11 Thread Andrey Drobyshev
On 12/11/23 13:27, Denis V. Lunev wrote: > On 12/11/23 11:55, Andrey Drobyshev wrote: >> In case we're truncating an image opened with O_DIRECT, we might get >> -EINVAL on write with unaligned buffer.  In particular, when running >> iotests/298 with '-nocache' we get:

Re: [PATCH] iotests: don't run tests requiring cached writes in '-nocache' mode

2024-01-11 Thread Andrey Drobyshev
On 12/11/23 15:32, Andrey Drobyshev wrote: > There're tests whose logic implies running without O_DIRECT set, > otherwise they fail when running iotests in '-nocache' mode. For these > tests let's add _require_no_o_direct() helper which can be put in the > preabmle and which makes su

[PATCH] iotests: don't run tests requiring cached writes in '-nocache' mode

2023-12-11 Thread Andrey Drobyshev
does have 'direct-io' mode (see https://docs.kernel.org/filesystems/fuse-io.html) we aren't using it yet, thus getting errors like: qemu-io: can't open device /path/to/t.qcow2.fuse: Could not open '/path/to/t.qcow2.fuse': filesystem does not support O_DIRECT Signed-off-by: Andrey Drobyshev

[PATCH] block: allocate aligned write buffer for 'truncate -m full'

2023-12-11 Thread Andrey Drobyshev
the buffer using qemu_blockalign0() instead. Signed-off-by: Andrey Drobyshev --- block/file-posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index b862406c71..cee8de510b 100644 --- a/block/file-posix.c +++ b/block/file-posix.c

Re: [PATCH] Revert "test/qga: use G_TEST_DIR to locate os-release test file"

2023-12-04 Thread Andrey Drobyshev
On 12/4/23 19:09, Marc-André Lureau wrote: > Hi > > On Mon, Dec 4, 2023 at 9:01 PM Andrey Drobyshev > wrote: >> >> On 12/4/23 18:51, Marc-André Lureau wrote: >>> Hi >>> >>> On Mon, Dec 4, 2023 at 8:33 PM Andrey Drobyshev >>> wrote: &

Re: [PATCH] Revert "test/qga: use G_TEST_DIR to locate os-release test file"

2023-12-04 Thread Andrey Drobyshev
On 12/4/23 18:51, Marc-André Lureau wrote: > Hi > > On Mon, Dec 4, 2023 at 8:33 PM Andrey Drobyshev > wrote: >> >> Since the commit a85d09269b QGA_OS_RELEASE variable points to the path >> relative to the build dir. Then on qemu-ga startup this path can't be >&g

[PATCH] Revert "test/qga: use G_TEST_DIR to locate os-release test file"

2023-12-04 Thread Andrey Drobyshev
a85d09269bb1a7071d3ce0f2957e3ca9dba7c047. Signed-off-by: Andrey Drobyshev --- tests/unit/test-qga.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index 671e83cb86..47cf5e30ec 100644 --- a/tests/unit/test-qga.c +++ b/tests

Re: [PATCH] kvm: emit GUEST_PANICKED event in case of abnormal KVM exit

2023-11-22 Thread Andrey Drobyshev
On 11/1/23 18:13, Denis V. Lunev wrote: > On 11/1/23 16:23, Andrey Drobyshev wrote: >> Currently we emit GUEST_PANICKED event in case kvm_vcpu_ioctl() returns >> KVM_EXIT_SYSTEM_EVENT with the event type KVM_SYSTEM_EVENT_CRASH.  Let's >> extend this scenario and emit G

[PATCH] iotests: fix default MT detection

2023-11-22 Thread Andrey Drobyshev
lt) (deprecated)". To fix potential issues here, let's relax that requirement and detect the mere presence of " (default)" line instead. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/testenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu

Re: [PATCH 4/7] qcow2: make subclusters discardable

2023-11-10 Thread Andrey Drobyshev
On 10/31/23 18:33, Hanna Czenczek wrote: > (Sorry, opened another reply window, forgot I already had one open...) > > On 20.10.23 23:56, Andrey Drobyshev wrote: >> This commit makes the discard operation work on the subcluster level >> rather than cluster

Re: [PATCH 5/7] qcow2: zero_l2_subclusters: fall through to discard operation when requested

2023-11-10 Thread Andrey Drobyshev
On 11/3/23 17:19, Hanna Czenczek wrote: > On 20.10.23 23:56, Andrey Drobyshev wrote: >> When zeroizing subclusters within single cluster, detect usage of the >> BDRV_REQ_MAY_UNMAP flag and fall through to the subcluster-based discard >> operation, much like it's done w

Re: [PATCH 7/7] iotests/271: check disk usage on subcluster-based discard/unmap

2023-11-09 Thread Andrey Drobyshev
On 11/3/23 17:51, Hanna Czenczek wrote: > On 20.10.23 23:56, Andrey Drobyshev wrote: >> Add _verify_du_delta() checker which is used to check that real disk >> usage delta meets the expectations.  For now we use it for checking that >> subcluster-based discard/unmap operation

Re: [PATCH 4/7] qcow2: make subclusters discardable

2023-11-09 Thread Andrey Drobyshev
On 10/31/23 18:32, Hanna Czenczek wrote: > On 20.10.23 23:56, Andrey Drobyshev wrote: >> This commit makes the discard operation work on the subcluster level >> rather than cluster level.  It introduces discard_l2_subclusters() >> function and makes use of it in qcow2 discard

Re: [PATCH 7/7] iotests/271: check disk usage on subcluster-based discard/unmap

2023-11-09 Thread Andrey Drobyshev
On 11/3/23 17:59, Hanna Czenczek wrote: > On 03.11.23 16:51, Hanna Czenczek wrote: >> On 20.10.23 23:56, Andrey Drobyshev wrote: > > [...] > >>> @@ -528,6 +543,14 @@ for use_backing_file in yes no; do >>>   else >>>   _make_test_img -o ex

Re: [PATCH 6/7] iotests/common.rc: add disk_usage function

2023-11-09 Thread Andrey Drobyshev
On 11/3/23 17:20, Hanna Czenczek wrote: > On 20.10.23 23:56, Andrey Drobyshev wrote: >> Move the definition from iotests/250 to common.rc.  This is used to >> detect real disk usage of sparse files.  In particular, we want to use >> it for checking subclusters-based disca

Re: [PATCH 2/7] qcow2: add get_sc_range_info() helper for working with subcluster ranges

2023-11-09 Thread Andrey Drobyshev
Hello Hanna, Sorry for the delay and thanks for your thorough and detailed review. On 10/31/23 17:53, Hanna Czenczek wrote: > On 20.10.23 23:56, Andrey Drobyshev wrote: >> This helper simply obtains the l2 table parameters of the cluster which >> contains the given subclusters ra

Re: [PATCH v3 1/8] qemu-img: rebase: stop when reaching EOF of old backing file

2023-11-01 Thread Andrey Drobyshev
On 11/1/23 11:50, Michael Tokarev wrote: > 19.09.2023 19:57, Andrey Drobyshev via wrote: >> In case when we're rebasing within one backing chain, and when target >> image >> is larger than old backing file, bdrv_is_allocated_above() ends up >> setting >> *pnum

[PATCH] kvm: emit GUEST_PANICKED event in case of abnormal KVM exit

2023-11-01 Thread Andrey Drobyshev
operational anyway. Signed-off-by: Andrey Drobyshev Acked-by: Denis V. Lunev --- accel/kvm/kvm-all.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e39a810a4e..d74b3f0b0e 100644 --- a/accel/kvm/kvm-all.c +++ b

Re: [PATCH 1/6] qemu-img: rebase: stop when reaching EOF of old backing file

2023-10-26 Thread Andrey Drobyshev
On 10/26/23 09:32, Michael Tokarev wrote: > 01.06.2023 22:28, Andrey Drobyshev via: >> In case when we're rebasing within one backing chain, and when target >> image >> is larger than old backing file, bdrv_is_allocated_above() ends up >> setting >> *pnum = 0. 

[PATCH 7/7] iotests/271: check disk usage on subcluster-based discard/unmap

2023-10-20 Thread Andrey Drobyshev
for discarding particular subcluster within one cluster. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/271 | 25 - tests/qemu-iotests/271.out | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/271 b/tests/qemu-iotests/271 index

[PATCH 3/7] qcow2: zeroize the entire cluster when there're no non-zero subclusters

2023-10-20 Thread Andrey Drobyshev
When zeroizing the last non-zero subclusters within single cluster, it makes sense to go zeroize the entire cluster and go down zero_in_l2_slice() path right away. That way we'd also update the corresponding refcount table. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 18

[PATCH 2/7] qcow2: add get_sc_range_info() helper for working with subcluster ranges

2023-10-20 Thread Andrey Drobyshev
. Also introduce struct SubClusterRangeInfo, which would contain all the needed params. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 90 +-- 1 file changed, 62 insertions(+), 28 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2

[PATCH 5/7] qcow2: zero_l2_subclusters: fall through to discard operation when requested

2023-10-20 Thread Andrey Drobyshev
to actual unmap. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index cf40f2dc12..040251f2c3 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2

[PATCH 0/7] qcow2: make subclusters discardable

2023-10-20 Thread Andrey Drobyshev
are enabled. Andrey Drobyshev (7): qcow2: make function update_refcount_discard() global qcow2: add get_sc_range_info() helper for working with subcluster ranges qcow2: zeroize the entire cluster when there're no non-zero subclusters qcow2: make subclusters discardable qcow2

[PATCH 4/7] qcow2: make subclusters discardable

2023-10-20 Thread Andrey Drobyshev
) with subclusters enabled. Signed-off-by: Andrey Drobyshev --- block/qcow2-cluster.c | 100 -- block/qcow2.c | 8 ++-- 2 files changed, 101 insertions(+), 7 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 7c6fa5524c

[PATCH 1/7] qcow2: make function update_refcount_discard() global

2023-10-20 Thread Andrey Drobyshev
We are going to need it for discarding separate subclusters. The function itself doesn't do anything with the refcount tables, it simply adds a discard request to the queue, so rename it to qcow2_queue_discard(). Signed-off-by: Andrey Drobyshev --- block/qcow2-refcount.c | 8 block

[PATCH 6/7] iotests/common.rc: add disk_usage function

2023-10-20 Thread Andrey Drobyshev
Move the definition from iotests/250 to common.rc. This is used to detect real disk usage of sparse files. In particular, we want to use it for checking subclusters-based discards. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/250 | 5 - tests/qemu-iotests/common.rc | 6

Re: [PATCH v3 0/8] qemu-img: rebase: add compression support

2023-10-16 Thread Andrey Drobyshev
On 10/2/23 09:35, Andrey Drobyshev wrote: > On 9/19/23 20:57, Andrey Drobyshev wrote: >> v2 --> v3: >> * Patch 3/8: fixed logic in the if statement, so that we align on blk >>when blk_old_backing == NULL; >> * Patch 4/8: comment fix; >> * Patch

Re: [PATCH v3 0/8] qemu-img: rebase: add compression support

2023-10-02 Thread Andrey Drobyshev
On 9/19/23 20:57, Andrey Drobyshev wrote: > v2 --> v3: > * Patch 3/8: fixed logic in the if statement, so that we align on blk >when blk_old_backing == NULL; > * Patch 4/8: comment fix; > * Patch 5/8: comment fix; dropped redundant "if (blk_new_backing)" >

Re: [PATCH] maint: Tweak comment in mailmap to sound friendlier

2023-09-27 Thread Andrey Drobyshev
munging issue in the first place. > > Fixes: 3bd2608d ("maint: Add .mailmap entries for patches claiming list > authorship") > CC: Andrey Drobyshev > Cc: Peter Maydell > Signed-off-by: Eric Blake > --- > > I'm sending this email with a temporary 'git

[PATCH] mailmap: Fix Andrey Drobyshev author email

2023-09-26 Thread andrey . drobyshev--- via
From: Andrey Drobyshev This fixes authorship of commits 2848289168, 52b10c9c0c as the mailing list rewrote the "From:" field in the corresponding patches. See commit 3bd2608db7 ("maint: Add .mailmap entries for patches claiming list authorship") for explanation. Signed-off-

[PATCH v3 1/8] qemu-img: rebase: stop when reaching EOF of old backing file

2023-09-19 Thread Andrey Drobyshev via
further down the loop body, as the offsets beyond the old backing size need to be explicitly zeroed. Signed-off-by: Andrey Drobyshev Reviewed-by: Denis V. Lunev Reviewed-by: Hanna Czenczek --- qemu-img.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b

[PATCH v3 5/8] qemu-img: rebase: avoid unnecessary COW operations

2023-09-19 Thread Andrey Drobyshev via
y case we end up aligning to the smallest unit of allocation. Signed-off-by: Andrey Drobyshev --- qemu-img.c | 74 +++--- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 0f67b021f7..a2d6241648 100644 --- a/

  1   2   >