Skip to content

Commit 7f041b1

Browse files
committed
Merge tag 'v9.0.2' into update_qemu_v9.0.2
v9.0.2 release
2 parents 6db2f6e + 5ebde3b commit 7f041b1

File tree

105 files changed

+1468
-730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1468
-730
lines changed

.gitlab-ci.d/buildtest-template.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
then
2727
pyvenv/bin/meson configure . -Dbackend_max_links="$LD_JOBS" ;
2828
fi || exit 1;
29-
- make -j"$JOBS"
29+
- $MAKE -j"$JOBS"
3030
- if test -n "$MAKE_CHECK_ARGS";
3131
then
32-
make -j"$JOBS" $MAKE_CHECK_ARGS ;
32+
$MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
3333
fi
3434
- ccache --show-stats
3535

@@ -60,7 +60,7 @@
6060
- cd build
6161
- find . -type f -exec touch {} +
6262
# Avoid recompiling by hiding ninja with NINJA=":"
63-
- make NINJA=":" $MAKE_CHECK_ARGS
63+
- $MAKE NINJA=":" $MAKE_CHECK_ARGS
6464

6565
.native_test_job_template:
6666
extends: .common_test_job_template

.gitlab-ci.d/buildtest.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ build-system-centos:
158158
- .native_build_job_template
159159
- .native_build_artifact_template
160160
needs:
161-
job: amd64-centos8-container
161+
job: amd64-centos9-container
162162
variables:
163-
IMAGE: centos8
163+
IMAGE: centos9
164164
CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-vfio-user-server
165165
--enable-modules --enable-trace-backends=dtrace --enable-docs
166166
TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
@@ -242,7 +242,7 @@ check-system-centos:
242242
- job: build-system-centos
243243
artifacts: true
244244
variables:
245-
IMAGE: centos8
245+
IMAGE: centos9
246246
MAKE_CHECK_ARGS: check
247247

248248
avocado-system-centos:
@@ -251,7 +251,7 @@ avocado-system-centos:
251251
- job: build-system-centos
252252
artifacts: true
253253
variables:
254-
IMAGE: centos8
254+
IMAGE: centos9
255255
MAKE_CHECK_ARGS: check-avocado
256256
AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx
257257
arch:sh4 arch:nios2
@@ -327,9 +327,9 @@ avocado-system-flaky:
327327
build-tcg-disabled:
328328
extends: .native_build_job_template
329329
needs:
330-
job: amd64-centos8-container
330+
job: amd64-centos9-container
331331
variables:
332-
IMAGE: centos8
332+
IMAGE: centos9
333333
script:
334334
- mkdir build
335335
- cd build
@@ -575,6 +575,9 @@ tsan-build:
575575
CONFIGURE_ARGS: --enable-tsan --cc=clang --cxx=clang++
576576
--enable-trace-backends=ust --disable-slirp
577577
TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
578+
# Remove when we switch to a distro with clang >= 18
579+
# https://github.com/google/sanitizers/issues/1716
580+
MAKE: setarch -R make
578581

579582
# gcov is a GCC features
580583
gcov:
@@ -651,9 +654,9 @@ build-tci:
651654
build-without-defaults:
652655
extends: .native_build_job_template
653656
needs:
654-
job: amd64-centos8-container
657+
job: amd64-centos9-container
655658
variables:
656-
IMAGE: centos8
659+
IMAGE: centos9
657660
CONFIGURE_ARGS:
658661
--without-default-devices
659662
--without-default-features

.gitlab-ci.d/cirrus.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ x64-freebsd-13-build:
5757
CIRRUS_VM_RAM: 8G
5858
UPDATE_COMMAND: pkg update; pkg upgrade -y
5959
INSTALL_COMMAND: pkg install -y
60+
CONFIGURE_ARGS: --target-list-exclude=arm-softmmu,i386-softmmu,microblaze-softmmu,mips64el-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4eb-softmmu,xtensa-softmmu
6061
TEST_TARGETS: check
6162

6263
aarch64-macos-13-base-build:
@@ -72,6 +73,7 @@ aarch64-macos-13-base-build:
7273
INSTALL_COMMAND: brew install
7374
PATH_EXTRA: /opt/homebrew/ccache/libexec:/opt/homebrew/gettext/bin
7475
PKG_CONFIG_PATH: /opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig
76+
CONFIGURE_ARGS: --target-list-exclude=arm-softmmu,i386-softmmu,microblazeel-softmmu,mips64-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4-softmmu,xtensaeb-softmmu
7577
TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
7678

7779
aarch64-macos-14-base-build:

.gitlab-ci.d/container-core.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
include:
22
- local: '/.gitlab-ci.d/container-template.yml'
33

4-
amd64-centos8-container:
4+
amd64-centos9-container:
55
extends: .container_job_template
66
variables:
7-
NAME: centos8
7+
NAME: centos9
88

99
amd64-fedora-container:
1010
extends: .container_job_template

.gitlab-ci.d/windows.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
msys2-64bit:
22
extends: .base_job_template
33
tags:
4-
- shared-windows
5-
- windows
6-
- windows-1809
4+
- saas-windows-medium-amd64
75
cache:
86
key: "$CI_JOB_NAME"
97
paths:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.0.0
1+
9.0.2

accel/tcg/tb-maint.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static void tb_record(TranslationBlock *tb)
712712
tb_page_addr_t paddr0 = tb_page_addr0(tb);
713713
tb_page_addr_t paddr1 = tb_page_addr1(tb);
714714
tb_page_addr_t pindex0 = paddr0 >> TARGET_PAGE_BITS;
715-
tb_page_addr_t pindex1 = paddr0 >> TARGET_PAGE_BITS;
715+
tb_page_addr_t pindex1 = paddr1 >> TARGET_PAGE_BITS;
716716

717717
assert(paddr0 != -1);
718718
if (unlikely(paddr1 != -1) && pindex0 != pindex1) {
@@ -744,7 +744,7 @@ static void tb_remove(TranslationBlock *tb)
744744
tb_page_addr_t paddr0 = tb_page_addr0(tb);
745745
tb_page_addr_t paddr1 = tb_page_addr1(tb);
746746
tb_page_addr_t pindex0 = paddr0 >> TARGET_PAGE_BITS;
747-
tb_page_addr_t pindex1 = paddr0 >> TARGET_PAGE_BITS;
747+
tb_page_addr_t pindex1 = paddr1 >> TARGET_PAGE_BITS;
748748

749749
assert(paddr0 != -1);
750750
if (unlikely(paddr1 != -1) && pindex0 != pindex1) {

backends/cryptodev-builtin.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "qemu/osdep.h"
2525
#include "sysemu/cryptodev.h"
26+
#include "qemu/error-report.h"
2627
#include "qapi/error.h"
2728
#include "standard-headers/linux/virtio_crypto.h"
2829
#include "crypto/cipher.h"
@@ -396,8 +397,8 @@ static int cryptodev_builtin_create_session(
396397
case VIRTIO_CRYPTO_HASH_CREATE_SESSION:
397398
case VIRTIO_CRYPTO_MAC_CREATE_SESSION:
398399
default:
399-
error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
400-
sess_info->op_code);
400+
error_report("Unsupported opcode :%" PRIu32 "",
401+
sess_info->op_code);
401402
return -VIRTIO_CRYPTO_NOTSUPP;
402403
}
403404

@@ -554,8 +555,8 @@ static int cryptodev_builtin_operation(
554555

555556
if (op_info->session_id >= MAX_NUM_SESSIONS ||
556557
builtin->sessions[op_info->session_id] == NULL) {
557-
error_setg(&local_error, "Cannot find a valid session id: %" PRIu64 "",
558-
op_info->session_id);
558+
error_report("Cannot find a valid session id: %" PRIu64 "",
559+
op_info->session_id);
559560
return -VIRTIO_CRYPTO_INVSESS;
560561
}
561562

block.c

Lines changed: 57 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
8686
BlockDriverState *parent,
8787
const BdrvChildClass *child_class,
8888
BdrvChildRole child_role,
89+
bool parse_filename,
8990
Error **errp);
9091

9192
static bool bdrv_recurse_has_child(BlockDriverState *bs,
@@ -2058,7 +2059,8 @@ static void parse_json_protocol(QDict *options, const char **pfilename,
20582059
* block driver has been specified explicitly.
20592060
*/
20602061
static int bdrv_fill_options(QDict **options, const char *filename,
2061-
int *flags, Error **errp)
2062+
int *flags, bool allow_parse_filename,
2063+
Error **errp)
20622064
{
20632065
const char *drvname;
20642066
bool protocol = *flags & BDRV_O_PROTOCOL;
@@ -2100,7 +2102,7 @@ static int bdrv_fill_options(QDict **options, const char *filename,
21002102
if (protocol && filename) {
21012103
if (!qdict_haskey(*options, "filename")) {
21022104
qdict_put_str(*options, "filename", filename);
2103-
parse_filename = true;
2105+
parse_filename = allow_parse_filename;
21042106
} else {
21052107
error_setg(errp, "Can't specify 'file' and 'filename' options at "
21062108
"the same time");
@@ -3663,7 +3665,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
36633665
}
36643666

36653667
backing_hd = bdrv_open_inherit(backing_filename, reference, options, 0, bs,
3666-
&child_of_bds, bdrv_backing_role(bs), errp);
3668+
&child_of_bds, bdrv_backing_role(bs), true,
3669+
errp);
36673670
if (!backing_hd) {
36683671
bs->open_flags |= BDRV_O_NO_BACKING;
36693672
error_prepend(errp, "Could not open backing file: ");
@@ -3697,7 +3700,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
36973700
static BlockDriverState *
36983701
bdrv_open_child_bs(const char *filename, QDict *options, const char *bdref_key,
36993702
BlockDriverState *parent, const BdrvChildClass *child_class,
3700-
BdrvChildRole child_role, bool allow_none, Error **errp)
3703+
BdrvChildRole child_role, bool allow_none,
3704+
bool parse_filename, Error **errp)
37013705
{
37023706
BlockDriverState *bs = NULL;
37033707
QDict *image_options;
@@ -3728,7 +3732,8 @@ bdrv_open_child_bs(const char *filename, QDict *options, const char *bdref_key,
37283732
}
37293733

37303734
bs = bdrv_open_inherit(filename, reference, image_options, 0,
3731-
parent, child_class, child_role, errp);
3735+
parent, child_class, child_role, parse_filename,
3736+
errp);
37323737
if (!bs) {
37333738
goto done;
37343739
}
@@ -3738,6 +3743,33 @@ bdrv_open_child_bs(const char *filename, QDict *options, const char *bdref_key,
37383743
return bs;
37393744
}
37403745

3746+
static BdrvChild *bdrv_open_child_common(const char *filename,
3747+
QDict *options, const char *bdref_key,
3748+
BlockDriverState *parent,
3749+
const BdrvChildClass *child_class,
3750+
BdrvChildRole child_role,
3751+
bool allow_none, bool parse_filename,
3752+
Error **errp)
3753+
{
3754+
BlockDriverState *bs;
3755+
BdrvChild *child;
3756+
3757+
GLOBAL_STATE_CODE();
3758+
3759+
bs = bdrv_open_child_bs(filename, options, bdref_key, parent, child_class,
3760+
child_role, allow_none, parse_filename, errp);
3761+
if (bs == NULL) {
3762+
return NULL;
3763+
}
3764+
3765+
bdrv_graph_wrlock();
3766+
child = bdrv_attach_child(parent, bs, bdref_key, child_class, child_role,
3767+
errp);
3768+
bdrv_graph_wrunlock();
3769+
3770+
return child;
3771+
}
3772+
37413773
/*
37423774
* Opens a disk image whose options are given as BlockdevRef in another block
37433775
* device's options.
@@ -3761,27 +3793,15 @@ BdrvChild *bdrv_open_child(const char *filename,
37613793
BdrvChildRole child_role,
37623794
bool allow_none, Error **errp)
37633795
{
3764-
BlockDriverState *bs;
3765-
BdrvChild *child;
3766-
3767-
GLOBAL_STATE_CODE();
3768-
3769-
bs = bdrv_open_child_bs(filename, options, bdref_key, parent, child_class,
3770-
child_role, allow_none, errp);
3771-
if (bs == NULL) {
3772-
return NULL;
3773-
}
3774-
3775-
bdrv_graph_wrlock();
3776-
child = bdrv_attach_child(parent, bs, bdref_key, child_class, child_role,
3777-
errp);
3778-
bdrv_graph_wrunlock();
3779-
3780-
return child;
3796+
return bdrv_open_child_common(filename, options, bdref_key, parent,
3797+
child_class, child_role, allow_none, false,
3798+
errp);
37813799
}
37823800

37833801
/*
3784-
* Wrapper on bdrv_open_child() for most popular case: open primary child of bs.
3802+
* This does mostly the same as bdrv_open_child(), but for opening the primary
3803+
* child of a node. A notable difference from bdrv_open_child() is that it
3804+
* enables filename parsing for protocol names (including json:).
37853805
*
37863806
* @parent can move to a different AioContext in this function.
37873807
*/
@@ -3796,8 +3816,8 @@ int bdrv_open_file_child(const char *filename,
37963816
role = parent->drv->is_filter ?
37973817
(BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY) : BDRV_CHILD_IMAGE;
37983818

3799-
if (!bdrv_open_child(filename, options, bdref_key, parent,
3800-
&child_of_bds, role, false, errp))
3819+
if (!bdrv_open_child_common(filename, options, bdref_key, parent,
3820+
&child_of_bds, role, false, true, errp))
38013821
{
38023822
return -EINVAL;
38033823
}
@@ -3842,7 +3862,8 @@ BlockDriverState *bdrv_open_blockdev_ref(BlockdevRef *ref, Error **errp)
38423862

38433863
}
38443864

3845-
bs = bdrv_open_inherit(NULL, reference, qdict, 0, NULL, NULL, 0, errp);
3865+
bs = bdrv_open_inherit(NULL, reference, qdict, 0, NULL, NULL, 0, false,
3866+
errp);
38463867
obj = NULL;
38473868
qobject_unref(obj);
38483869
visit_free(v);
@@ -3932,7 +3953,7 @@ static BlockDriverState * no_coroutine_fn
39323953
bdrv_open_inherit(const char *filename, const char *reference, QDict *options,
39333954
int flags, BlockDriverState *parent,
39343955
const BdrvChildClass *child_class, BdrvChildRole child_role,
3935-
Error **errp)
3956+
bool parse_filename, Error **errp)
39363957
{
39373958
int ret;
39383959
BlockBackend *file = NULL;
@@ -3980,9 +4001,11 @@ bdrv_open_inherit(const char *filename, const char *reference, QDict *options,
39804001
}
39814002

39824003
/* json: syntax counts as explicit options, as if in the QDict */
3983-
parse_json_protocol(options, &filename, &local_err);
3984-
if (local_err) {
3985-
goto fail;
4004+
if (parse_filename) {
4005+
parse_json_protocol(options, &filename, &local_err);
4006+
if (local_err) {
4007+
goto fail;
4008+
}
39864009
}
39874010

39884011
bs->explicit_options = qdict_clone_shallow(options);
@@ -4007,7 +4030,8 @@ bdrv_open_inherit(const char *filename, const char *reference, QDict *options,
40074030
parent->open_flags, parent->options);
40084031
}
40094032

4010-
ret = bdrv_fill_options(&options, filename, &flags, &local_err);
4033+
ret = bdrv_fill_options(&options, filename, &flags, parse_filename,
4034+
&local_err);
40114035
if (ret < 0) {
40124036
goto fail;
40134037
}
@@ -4076,7 +4100,7 @@ bdrv_open_inherit(const char *filename, const char *reference, QDict *options,
40764100

40774101
file_bs = bdrv_open_child_bs(filename, options, "file", bs,
40784102
&child_of_bds, BDRV_CHILD_IMAGE,
4079-
true, &local_err);
4103+
true, true, &local_err);
40804104
if (local_err) {
40814105
goto fail;
40824106
}
@@ -4225,7 +4249,7 @@ BlockDriverState *bdrv_open(const char *filename, const char *reference,
42254249
GLOBAL_STATE_CODE();
42264250

42274251
return bdrv_open_inherit(filename, reference, options, flags, NULL,
4228-
NULL, 0, errp);
4252+
NULL, 0, true, errp);
42294253
}
42304254

42314255
/* Return true if the NULL-terminated @list contains @str */

block/qcow2.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,22 @@ qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,
16361636
goto fail;
16371637
}
16381638

1639-
if (open_data_file) {
1639+
if (open_data_file && (flags & BDRV_O_NO_IO)) {
1640+
/*
1641+
* Don't open the data file for 'qemu-img info' so that it can be used
1642+
* to verify that an untrusted qcow2 image doesn't refer to external
1643+
* files.
1644+
*
1645+
* Note: This still makes has_data_file() return true.
1646+
*/
1647+
if (s->incompatible_features & QCOW2_INCOMPAT_DATA_FILE) {
1648+
s->data_file = NULL;
1649+
} else {
1650+
s->data_file = bs->file;
1651+
}
1652+
qdict_extract_subqdict(options, NULL, "data-file.");
1653+
qdict_del(options, "data-file");
1654+
} else if (open_data_file) {
16401655
/* Open external data file */
16411656
bdrv_graph_co_rdunlock();
16421657
s->data_file = bdrv_co_open_child(NULL, options, "data-file", bs,

0 commit comments

Comments
 (0)