qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [PULL 5/8] block/copy-before-write: use uint64_t for timeout in nanoseconds
Date: Tue, 11 Jun 2024 19:36:55 +0200	[thread overview]
Message-ID: <20240611173658.231831-6-kwolf@redhat.com> (raw)
In-Reply-To: <20240611173658.231831-1-kwolf@redhat.com>

From: Fiona Ebner <f.ebner@proxmox.com>

rather than the uint32_t for which the maximum is slightly more than 4
seconds and larger values would overflow. The QAPI interface allows
specifying the number of seconds, so only values 0 to 4 are safe right
now, other values lead to a much lower timeout than a user expects.

The block_copy() call where this is used already takes a uint64_t for
the timeout, so no change required there.

Fixes: 6db7fd1ca9 ("block/copy-before-write: implement cbw-timeout option")
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Message-ID: <20240429141934.442154-1-f.ebner@proxmox.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/copy-before-write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/copy-before-write.c b/block/copy-before-write.c
index cd65524e26..853e01a1eb 100644
--- a/block/copy-before-write.c
+++ b/block/copy-before-write.c
@@ -43,7 +43,7 @@ typedef struct BDRVCopyBeforeWriteState {
     BlockCopyState *bcs;
     BdrvChild *target;
     OnCbwError on_cbw_error;
-    uint32_t cbw_timeout_ns;
+    uint64_t cbw_timeout_ns;
     bool discard_source;
 
     /*
-- 
2.45.2



  parent reply	other threads:[~2024-06-11 17:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 17:36 [PULL 0/8] Block layer patches Kevin Wolf
2024-06-11 17:36 ` [PULL 1/8] block: drop force_dup parameter of raw_reconfigure_getfd() Kevin Wolf
2024-06-11 17:36 ` [PULL 2/8] Revert "monitor: use aio_co_reschedule_self()" Kevin Wolf
2024-06-11 17:36 ` [PULL 3/8] aio: warn about iohandler_ctx special casing Kevin Wolf
2024-06-11 17:36 ` [PULL 4/8] qemu-io: add cvtnum() error handling for zone commands Kevin Wolf
2024-06-11 17:36 ` Kevin Wolf [this message]
2024-06-11 17:36 ` [PULL 6/8] linux-aio: add IO_CMD_FDSYNC command support Kevin Wolf
2024-06-11 17:36 ` [PULL 7/8] block/crypto: create ciphers on demand Kevin Wolf
2024-06-11 17:36 ` [PULL 8/8] crypto/block: drop qcrypto_block_open() n_threads argument Kevin Wolf
2024-06-13 14:51 ` [PULL 0/8] Block layer patches Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240611173658.231831-6-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).