1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
peripherals: 0.982
virtual: 0.981
debug: 0.979
assembly: 0.977
architecture: 0.974
hypervisor: 0.974
risc-v: 0.974
arm: 0.974
performance: 0.973
ppc: 0.972
semantic: 0.972
i386: 0.970
permissions: 0.969
PID: 0.968
x86: 0.967
socket: 0.967
TCG: 0.967
graphic: 0.965
boot: 0.963
register: 0.961
user-level: 0.961
vnc: 0.960
files: 0.959
VMM: 0.959
device: 0.958
KVM: 0.957
network: 0.956
kernel: 0.955
mistranslation: 0.950
assertion failed when using "-usb" option
SUMMARY:
----------
Description: Latest 'master' makes it impossible to use "-usb" command line on any target
Host platform: Linux x86-64
Guest platform: probably all (at least x86-64, i386, arm and ppc)
REPRODUCE:
----------
How to reproduce:
1. Run the following command:
$ qemu-system-x86_64 -usb
Expected result:
Starting virtual machine with empty configuration
Actual result:
Qemu crashes with following message:
qemu-system-x86_64: /home/mplucinski/Developer/Open_Source/qemu/qemu.git/util/qemu-option.c:387: qemu_opt_get_bool_helper: Assertion `opt->desc && opt->desc->type == QEMU_OPT_BOOL' failed.
Aborted
MORE INFORMATION:
----------
Same happens when trying to run other target, e.g.
$ qemu-system-i386 -usb
$ qemu-system-arm -machine kmz -usb
First commit where the issue occurs (bisection result): 49d2e648e8087d154d8bf8b91f27c8e05e79d5a6
Also, very similar symptoms are described in #1406706, so it is possible that they are related.
Could you test this?
Signed-off-by: Tiejun Chen <email address hidden>
---
util/qemu-option.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/qemu-option.c b/util/qemu-option.c
index a708241..7cb3601 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -377,7 +377,7 @@ static bool qemu_opt_get_bool_helper(QemuOpts *opts, const char *name,
}
opt = qemu_opt_find(opts, name);
- if (opt == NULL) {
+ if ((opt == NULL) || !opt->desc) {
const QemuOptDesc *desc = find_desc_by_name(opts->list->desc, name);
if (desc && desc->def_value_str) {
parse_option_bool(name, desc->def_value_str, &ret, &error_abort);
--
On Mon, Jan 5, 2015 at 5:48 AM, Tiejun Chen <email address hidden> wrote:
> Could you test this?
>
> Signed-off-by: Tiejun Chen <email address hidden>
> ---
> util/qemu-option.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/util/qemu-option.c b/util/qemu-option.c
> index a708241..7cb3601 100644
> --- a/util/qemu-option.c
> +++ b/util/qemu-option.c
> @@ -377,7 +377,7 @@ static bool qemu_opt_get_bool_helper(QemuOpts *opts, const char *name,
> }
>
> opt = qemu_opt_find(opts, name);
> - if (opt == NULL) {
> + if ((opt == NULL) || !opt->desc) {
> const QemuOptDesc *desc = find_desc_by_name(opts->list->desc, name);
> if (desc && desc->def_value_str) {
> parse_option_bool(name, desc->def_value_str, &ret, &error_abort);
This doesn't work because it discards the usb=on|off value that was
set on the command-line.
I will send a fix.
Stefan
This no longer asserts; I think Stefan fixed this and that fix is now in a release.
|