From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: svt-core@virtuozzo.com
Cc: den@openvz.org, andrey.drobyshev@virtuozzo.com
Subject: [QEMU HCI-8.0 PATCH 1/5] blk: factor out validation
Date: Thu, 3 Sep 2026 15:32:00 +0300 [thread overview]
Message-ID: <20260903123204.24035-2-andrey.zhadchenko@virtuozzo.com> (raw)
In-Reply-To: <20260903123204.24035-1-andrey.zhadchenko@virtuozzo.com>
Preparational patch. This helper will be used in the next patches
to validate vhost-blk block parameters.
https://virtuozzo.atlassian.net/browse/VSTOR-143437
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
---
hw/block/block.c | 5 +++++
include/hw/block/block.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/hw/block/block.c b/hw/block/block.c
index 47897ca5d3..6f135b7e2f 100644
--- a/hw/block/block.c
+++ b/hw/block/block.c
@@ -162,6 +162,11 @@ bool blkconf_blocksizes(BlockConf *conf, Error **errp)
}
}
+ return blkconf_validate_blocksizes(conf, errp);
+}
+
+bool blkconf_validate_blocksizes(BlockConf *conf, Error **errp)
+{
if (conf->logical_block_size > conf->physical_block_size) {
error_setg(errp,
"logical_block_size > physical_block_size not supported");
diff --git a/include/hw/block/block.h b/include/hw/block/block.h
index 664d629d37..dfd3ff0f62 100644
--- a/include/hw/block/block.h
+++ b/include/hw/block/block.h
@@ -106,6 +106,7 @@ bool blkconf_geometry(BlockConf *conf, int *trans,
unsigned cyls_max, unsigned heads_max, unsigned secs_max,
Error **errp);
bool blkconf_blocksizes(BlockConf *conf, Error **errp);
+bool blkconf_validate_blocksizes(BlockConf *conf, Error **errp);
bool blkconf_apply_backend_options(BlockConf *conf, bool readonly,
bool resizable, Error **errp);
--
2.43.5
next prev parent reply other threads:[~2026-09-03 12:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 12:31 [QEMU HCI-8.0 PATCH 0/5] vhost-blk change backend setup Andrey Zhadchenko
2026-09-03 12:32 ` Andrey Zhadchenko [this message]
2026-09-03 14:56 ` [QEMU HCI-8.0 PATCH 1/5] blk: factor out validation Andrey Drobyshev
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 2/5] vhost-blk: change backend setup Andrey Zhadchenko
2026-09-03 14:56 ` Andrey Drobyshev
2026-09-03 15:27 ` Andrey Zhadchenko
2026-09-03 15:34 ` Andrey Drobyshev
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 3/5] vhost-blk: add read-only flag Andrey Zhadchenko
2026-09-03 14:56 ` Andrey Drobyshev
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 4/5] vhost-blk: watch the device for resize events Andrey Zhadchenko
2026-09-03 14:56 ` Andrey Drobyshev
2026-09-03 15:30 ` Andrey Zhadchenko
2026-09-03 15:45 ` Andrey Drobyshev
2026-09-03 15:50 ` Andrey Zhadchenko
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 5/5] vhost-blk: filter uevents in the kernel Andrey Zhadchenko
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=20260903123204.24035-2-andrey.zhadchenko@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=den@openvz.org \
--cc=svt-core@virtuozzo.com \
/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