Skip to content

Commit 04ea2ed

Browse files
authored
Merge pull request #79 from AFLplusplus/update_qemu_9_0_2
Update to QEMU v9.0.2
2 parents 3079919 + 5782c01 commit 04ea2ed

File tree

41 files changed

+315
-232
lines changed

Some content is hidden

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

41 files changed

+315
-232
lines changed

.gitlab-ci.d/buildtest.yml

Lines changed: 8 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
@@ -654,9 +654,9 @@ build-tci:
654654
build-without-defaults:
655655
extends: .native_build_job_template
656656
needs:
657-
job: amd64-centos8-container
657+
job: amd64-centos9-container
658658
variables:
659-
IMAGE: centos8
659+
IMAGE: centos9
660660
CONFIGURE_ARGS:
661661
--without-default-devices
662662
--without-default-features

.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

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.0.1
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) {

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,

chardev/char-stdio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
/* init terminal so that we can grab keys */
4242
static struct termios oldtty;
4343
static int old_fd0_flags;
44+
static int old_fd1_flags;
4445
static bool stdio_in_use;
4546
static bool stdio_allow_signal;
4647
static bool stdio_echo_state;
@@ -50,6 +51,8 @@ static void term_exit(void)
5051
if (stdio_in_use) {
5152
tcsetattr(0, TCSANOW, &oldtty);
5253
fcntl(0, F_SETFL, old_fd0_flags);
54+
fcntl(1, F_SETFL, old_fd1_flags);
55+
stdio_in_use = false;
5356
}
5457
}
5558

@@ -102,6 +105,7 @@ static void qemu_chr_open_stdio(Chardev *chr,
102105

103106
stdio_in_use = true;
104107
old_fd0_flags = fcntl(0, F_GETFL);
108+
old_fd1_flags = fcntl(1, F_GETFL);
105109
tcgetattr(0, &oldtty);
106110
if (!g_unix_set_fd_nonblocking(0, true, NULL)) {
107111
error_setg_errno(errp, errno, "Failed to set FD nonblocking");

docs/sphinx/qapidoc.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ def _nodes_for_enum_values(self, doc):
219219
section += dlnode
220220
return [section]
221221

222-
def _nodes_for_arguments(self, doc, boxed_arg_type):
222+
def _nodes_for_arguments(self, doc, arg_type):
223223
"""Return list of doctree nodes for the arguments section"""
224-
if boxed_arg_type:
224+
if arg_type and not arg_type.is_implicit():
225225
assert not doc.args
226226
section = self._make_section('Arguments')
227227
dlnode = nodes.definition_list()
228228
dlnode += self._make_dlitem(
229229
[nodes.Text('The members of '),
230-
nodes.literal('', boxed_arg_type.name)],
230+
nodes.literal('', arg_type.name)],
231231
None)
232232
section += dlnode
233233
return [section]
@@ -331,17 +331,15 @@ def visit_command(self, name, info, ifcond, features, arg_type,
331331
allow_preconfig, coroutine):
332332
doc = self._cur_doc
333333
self._add_doc('Command',
334-
self._nodes_for_arguments(doc,
335-
arg_type if boxed else None)
334+
self._nodes_for_arguments(doc, arg_type)
336335
+ self._nodes_for_features(doc)
337336
+ self._nodes_for_sections(doc)
338337
+ self._nodes_for_if_section(ifcond))
339338

340339
def visit_event(self, name, info, ifcond, features, arg_type, boxed):
341340
doc = self._cur_doc
342341
self._add_doc('Event',
343-
self._nodes_for_arguments(doc,
344-
arg_type if boxed else None)
342+
self._nodes_for_arguments(doc, arg_type)
345343
+ self._nodes_for_features(doc)
346344
+ self._nodes_for_sections(doc)
347345
+ self._nodes_for_if_section(ifcond))

hw/audio/virtio-snd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static void virtio_snd_get_qemu_audsettings(audsettings *as,
401401
as->nchannels = MIN(AUDIO_MAX_CHANNELS, params->channels);
402402
as->fmt = virtio_snd_get_qemu_format(params->format);
403403
as->freq = virtio_snd_get_qemu_freq(params->rate);
404-
as->endianness = target_words_bigendian() ? 1 : 0;
404+
as->endianness = 0; /* Conforming to VIRTIO 1.0: always little endian. */
405405
}
406406

407407
/*

0 commit comments

Comments
 (0)