aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-06-28 16:09:38 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-06-28 16:09:38 -0700
commit3665dd6bb9043bef181c91e2dce9e1efff47ed51 (patch)
tree766c8fda9206131cf2a500a281598aed34fd70e9 /block.c
parent28b8a57ad63670aa0ce90334523dc552b13b4336 (diff)
parentb31d386781cf85c193f3b1355dd0604cd6a59943 (diff)
downloadqemu-3665dd6bb9043bef181c91e2dce9e1efff47ed51.zip
qemu-3665dd6bb9043bef181c91e2dce9e1efff47ed51.tar.gz
qemu-3665dd6bb9043bef181c91e2dce9e1efff47ed51.tar.bz2
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* configure: detect --cpu=mipsisa64r6 * target/i386: decode address before going back to translate.c * meson: allow configuring the x86-64 baseline * meson: remove dead optimization option * exec: small changes to allow compilation with C++ in Android emulator * fix SEV compilation on 32-bit systems # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmZ+8mEUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroMVmAf+PjJBpMYNFb2qxJDw5jI7hITsrtm4 # v5TKo9x7E3pna5guae5ODFencYhBITQznHFa3gO9w09QN7Gq/rKjuBBST9VISslU # dW3HtxY9A1eHQtNqHuD7jBWWo9N0hhNiLRa6xz/VDTjEJSxhjSdK2bRW9Yz9hZAe # 8bbEEC9us21RdFTS+eijOMo9SPyASUlqIq4RbQpbAVuzzOMeXnfOuX9VSTcBy9o2 # 7cKMg7zjL8WQugJKynyl5lny7m1Ji55LD2UrYMF6Mik3Wz5kwgHcUITJ+ZHd/9hR # a+MI7o/jyCPdmX9pBvJCxyerCVYBu0ugLqYKpAcsqU6111FLrnGgDvHf/g== # =LdYd # -----END PGP SIGNATURE----- # gpg: Signature made Fri 28 Jun 2024 10:26:57 AM PDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (23 commits) target/i386/sev: Fix printf formats target/i386/sev: Use size_t for object sizes target/i386: SEV: store pointer to decoded id_auth in SevSnpGuest target/i386: SEV: rename sev_snp_guest->id_auth target/i386: SEV: store pointer to decoded id_block in SevSnpGuest target/i386: SEV: rename sev_snp_guest->id_block target/i386: remove unused enum target/i386: give CC_OP_POPCNT low bits corresponding to MO_TL target/i386: use cpu_cc_dst for CC_OP_POPCNT target/i386: fix CC_OP dump include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH() exec: don't use void* in pointer arithmetic in headers exec: avoid using C++ keywords in function parameters block: rename former bdrv_file_open callbacks block: remove separate bdrv_file_open callback block: do not check bdrv_file_open block: make assertion more generic meson: remove dead optimization option meson: allow configuring the x86-64 baseline Revert "host/i386: assume presence of SSE2" ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'block.c')
-rw-r--r--block.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/block.c b/block.c
index 468cf5e..c1cc313 100644
--- a/block.c
+++ b/block.c
@@ -926,7 +926,6 @@ BlockDriver *bdrv_find_protocol(const char *filename,
int i;
GLOBAL_STATE_CODE();
- /* TODO Drivers without bdrv_file_open must be specified explicitly */
/*
* XXX(hch): we really should not let host device detection
@@ -1655,10 +1654,8 @@ bdrv_open_driver(BlockDriverState *bs, BlockDriver *drv, const char *node_name,
bs->drv = drv;
bs->opaque = g_malloc0(drv->instance_size);
- if (drv->bdrv_file_open) {
- assert(!drv->bdrv_needs_filename || bs->filename[0]);
- ret = drv->bdrv_file_open(bs, options, open_flags, &local_err);
- } else if (drv->bdrv_open) {
+ assert(!drv->bdrv_needs_filename || bs->filename[0]);
+ if (drv->bdrv_open) {
ret = drv->bdrv_open(bs, options, open_flags, &local_err);
} else {
ret = 0;
@@ -1983,7 +1980,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file,
open_flags = bdrv_open_flags(bs, bs->open_flags);
node_name = qemu_opt_get(opts, "node-name");
- assert(!drv->bdrv_file_open || file == NULL);
+ assert(!drv->protocol_name || file == NULL);
ret = bdrv_open_driver(bs, drv, node_name, options, open_flags, errp);
if (ret < 0) {
goto fail_opts;
@@ -2084,7 +2081,7 @@ static int bdrv_fill_options(QDict **options, const char *filename,
}
/* If the user has explicitly specified the driver, this choice should
* override the BDRV_O_PROTOCOL flag */
- protocol = drv->bdrv_file_open;
+ protocol = drv->protocol_name;
}
if (protocol) {
@@ -4123,7 +4120,7 @@ bdrv_open_inherit(const char *filename, const char *reference, QDict *options,
}
/* BDRV_O_PROTOCOL must be set iff a protocol BDS is about to be created */
- assert(!!(flags & BDRV_O_PROTOCOL) == !!drv->bdrv_file_open);
+ assert(!!(flags & BDRV_O_PROTOCOL) == !!drv->protocol_name);
/* file must be NULL if a protocol BDS is about to be created
* (the inverse results in an error message from bdrv_open_common()) */
assert(!(flags & BDRV_O_PROTOCOL) || !file);
@@ -5971,7 +5968,7 @@ int64_t coroutine_fn bdrv_co_get_allocated_file_size(BlockDriverState *bs)
return drv->bdrv_co_get_allocated_file_size(bs);
}
- if (drv->bdrv_file_open) {
+ if (drv->protocol_name) {
/*
* Protocol drivers default to -ENOTSUP (most of their data is
* not stored in any of their children (if they even have any),
@@ -8030,7 +8027,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* Both of these conditions are represented by generate_json_filename.
*/
if (primary_child_bs->exact_filename[0] &&
- primary_child_bs->drv->bdrv_file_open &&
+ primary_child_bs->drv->protocol_name &&
!drv->is_filter && !generate_json_filename)
{
strcpy(bs->exact_filename, primary_child_bs->exact_filename);