root / qmp.c @ cba933b2
History | View | Annotate | Download (16 kB)
1 | 48a32bed | Anthony Liguori | /*
|
---|---|---|---|
2 | 48a32bed | Anthony Liguori | * QEMU Management Protocol
|
3 | 48a32bed | Anthony Liguori | *
|
4 | 48a32bed | Anthony Liguori | * Copyright IBM, Corp. 2011
|
5 | 48a32bed | Anthony Liguori | *
|
6 | 48a32bed | Anthony Liguori | * Authors:
|
7 | 48a32bed | Anthony Liguori | * Anthony Liguori <aliguori@us.ibm.com>
|
8 | 48a32bed | Anthony Liguori | *
|
9 | 48a32bed | Anthony Liguori | * This work is licensed under the terms of the GNU GPL, version 2. See
|
10 | 48a32bed | Anthony Liguori | * the COPYING file in the top-level directory.
|
11 | 48a32bed | Anthony Liguori | *
|
12 | 6b620ca3 | Paolo Bonzini | * Contributions after 2012-01-13 are licensed under the terms of the
|
13 | 6b620ca3 | Paolo Bonzini | * GNU GPL, version 2 or (at your option) any later version.
|
14 | 48a32bed | Anthony Liguori | */
|
15 | 48a32bed | Anthony Liguori | |
16 | 48a32bed | Anthony Liguori | #include "qemu-common.h" |
17 | 9c17d615 | Paolo Bonzini | #include "sysemu/sysemu.h" |
18 | 48a32bed | Anthony Liguori | #include "qmp-commands.h" |
19 | dccfcd0e | Paolo Bonzini | #include "sysemu/char.h" |
20 | fbf796fd | Luiz Capitulino | #include "ui/qemu-spice.h" |
21 | fbf796fd | Luiz Capitulino | #include "ui/vnc.h" |
22 | 9c17d615 | Paolo Bonzini | #include "sysemu/kvm.h" |
23 | 9c17d615 | Paolo Bonzini | #include "sysemu/arch_init.h" |
24 | b4b12c62 | Anthony Liguori | #include "hw/qdev.h" |
25 | 9c17d615 | Paolo Bonzini | #include "sysemu/blockdev.h" |
26 | 14cccb61 | Paolo Bonzini | #include "qom/qom-qobject.h" |
27 | cff8b2c6 | Paolo Bonzini | #include "qapi/qmp/qobject.h" |
28 | cff8b2c6 | Paolo Bonzini | #include "qapi/qmp-input-visitor.h" |
29 | 69ca3ea5 | Igor Mammedov | #include "hw/boards.h" |
30 | 269e09f3 | Igor Mammedov | #include "qom/object_interfaces.h" |
31 | 48a32bed | Anthony Liguori | |
32 | 48a32bed | Anthony Liguori | NameInfo *qmp_query_name(Error **errp) |
33 | 48a32bed | Anthony Liguori | { |
34 | 48a32bed | Anthony Liguori | NameInfo *info = g_malloc0(sizeof(*info));
|
35 | 48a32bed | Anthony Liguori | |
36 | 48a32bed | Anthony Liguori | if (qemu_name) {
|
37 | 48a32bed | Anthony Liguori | info->has_name = true;
|
38 | 48a32bed | Anthony Liguori | info->name = g_strdup(qemu_name); |
39 | 48a32bed | Anthony Liguori | } |
40 | 48a32bed | Anthony Liguori | |
41 | 48a32bed | Anthony Liguori | return info;
|
42 | 48a32bed | Anthony Liguori | } |
43 | b9c15f16 | Luiz Capitulino | |
44 | b9c15f16 | Luiz Capitulino | VersionInfo *qmp_query_version(Error **err) |
45 | b9c15f16 | Luiz Capitulino | { |
46 | b9c15f16 | Luiz Capitulino | VersionInfo *info = g_malloc0(sizeof(*info));
|
47 | b9c15f16 | Luiz Capitulino | const char *version = QEMU_VERSION; |
48 | b9c15f16 | Luiz Capitulino | char *tmp;
|
49 | b9c15f16 | Luiz Capitulino | |
50 | b9c15f16 | Luiz Capitulino | info->qemu.major = strtol(version, &tmp, 10);
|
51 | b9c15f16 | Luiz Capitulino | tmp++; |
52 | b9c15f16 | Luiz Capitulino | info->qemu.minor = strtol(tmp, &tmp, 10);
|
53 | b9c15f16 | Luiz Capitulino | tmp++; |
54 | b9c15f16 | Luiz Capitulino | info->qemu.micro = strtol(tmp, &tmp, 10);
|
55 | b9c15f16 | Luiz Capitulino | info->package = g_strdup(QEMU_PKGVERSION); |
56 | b9c15f16 | Luiz Capitulino | |
57 | b9c15f16 | Luiz Capitulino | return info;
|
58 | b9c15f16 | Luiz Capitulino | } |
59 | 292a2602 | Luiz Capitulino | |
60 | 292a2602 | Luiz Capitulino | KvmInfo *qmp_query_kvm(Error **errp) |
61 | 292a2602 | Luiz Capitulino | { |
62 | 292a2602 | Luiz Capitulino | KvmInfo *info = g_malloc0(sizeof(*info));
|
63 | 292a2602 | Luiz Capitulino | |
64 | 292a2602 | Luiz Capitulino | info->enabled = kvm_enabled(); |
65 | 292a2602 | Luiz Capitulino | info->present = kvm_available(); |
66 | 292a2602 | Luiz Capitulino | |
67 | 292a2602 | Luiz Capitulino | return info;
|
68 | 292a2602 | Luiz Capitulino | } |
69 | 292a2602 | Luiz Capitulino | |
70 | efab767e | Luiz Capitulino | UuidInfo *qmp_query_uuid(Error **errp) |
71 | efab767e | Luiz Capitulino | { |
72 | efab767e | Luiz Capitulino | UuidInfo *info = g_malloc0(sizeof(*info));
|
73 | efab767e | Luiz Capitulino | char uuid[64]; |
74 | efab767e | Luiz Capitulino | |
75 | efab767e | Luiz Capitulino | snprintf(uuid, sizeof(uuid), UUID_FMT, qemu_uuid[0], qemu_uuid[1], |
76 | efab767e | Luiz Capitulino | qemu_uuid[2], qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], |
77 | efab767e | Luiz Capitulino | qemu_uuid[6], qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], |
78 | efab767e | Luiz Capitulino | qemu_uuid[10], qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], |
79 | efab767e | Luiz Capitulino | qemu_uuid[14], qemu_uuid[15]); |
80 | efab767e | Luiz Capitulino | |
81 | efab767e | Luiz Capitulino | info->UUID = g_strdup(uuid); |
82 | efab767e | Luiz Capitulino | return info;
|
83 | efab767e | Luiz Capitulino | } |
84 | efab767e | Luiz Capitulino | |
85 | 7a7f325e | Luiz Capitulino | void qmp_quit(Error **err)
|
86 | 7a7f325e | Luiz Capitulino | { |
87 | 7a7f325e | Luiz Capitulino | no_shutdown = 0;
|
88 | 7a7f325e | Luiz Capitulino | qemu_system_shutdown_request(); |
89 | 7a7f325e | Luiz Capitulino | } |
90 | 7a7f325e | Luiz Capitulino | |
91 | 5f158f21 | Luiz Capitulino | void qmp_stop(Error **errp)
|
92 | 5f158f21 | Luiz Capitulino | { |
93 | 1e998146 | Paolo Bonzini | if (runstate_check(RUN_STATE_INMIGRATE)) {
|
94 | 1e998146 | Paolo Bonzini | autostart = 0;
|
95 | 1e998146 | Paolo Bonzini | } else {
|
96 | 1e998146 | Paolo Bonzini | vm_stop(RUN_STATE_PAUSED); |
97 | 1e998146 | Paolo Bonzini | } |
98 | 5f158f21 | Luiz Capitulino | } |
99 | 5f158f21 | Luiz Capitulino | |
100 | 38d22653 | Luiz Capitulino | void qmp_system_reset(Error **errp)
|
101 | 38d22653 | Luiz Capitulino | { |
102 | 38d22653 | Luiz Capitulino | qemu_system_reset_request(); |
103 | 38d22653 | Luiz Capitulino | } |
104 | 5bc465e4 | Luiz Capitulino | |
105 | 5bc465e4 | Luiz Capitulino | void qmp_system_powerdown(Error **erp)
|
106 | 5bc465e4 | Luiz Capitulino | { |
107 | 5bc465e4 | Luiz Capitulino | qemu_system_powerdown_request(); |
108 | 5bc465e4 | Luiz Capitulino | } |
109 | 755f1968 | Luiz Capitulino | |
110 | 755f1968 | Luiz Capitulino | void qmp_cpu(int64_t index, Error **errp)
|
111 | 755f1968 | Luiz Capitulino | { |
112 | 755f1968 | Luiz Capitulino | /* Just do nothing */
|
113 | 755f1968 | Luiz Capitulino | } |
114 | 2b54aa87 | Luiz Capitulino | |
115 | 69ca3ea5 | Igor Mammedov | void qmp_cpu_add(int64_t id, Error **errp)
|
116 | 69ca3ea5 | Igor Mammedov | { |
117 | 69ca3ea5 | Igor Mammedov | if (current_machine->hot_add_cpu) {
|
118 | 69ca3ea5 | Igor Mammedov | current_machine->hot_add_cpu(id, errp); |
119 | 69ca3ea5 | Igor Mammedov | } else {
|
120 | 69ca3ea5 | Igor Mammedov | error_setg(errp, "Not supported");
|
121 | 69ca3ea5 | Igor Mammedov | } |
122 | 69ca3ea5 | Igor Mammedov | } |
123 | 69ca3ea5 | Igor Mammedov | |
124 | 2b54aa87 | Luiz Capitulino | #ifndef CONFIG_VNC
|
125 | 2b54aa87 | Luiz Capitulino | /* If VNC support is enabled, the "true" query-vnc command is
|
126 | 2b54aa87 | Luiz Capitulino | defined in the VNC subsystem */
|
127 | 2b54aa87 | Luiz Capitulino | VncInfo *qmp_query_vnc(Error **errp) |
128 | 2b54aa87 | Luiz Capitulino | { |
129 | 2b54aa87 | Luiz Capitulino | error_set(errp, QERR_FEATURE_DISABLED, "vnc");
|
130 | 2b54aa87 | Luiz Capitulino | return NULL; |
131 | 2b54aa87 | Luiz Capitulino | }; |
132 | 2b54aa87 | Luiz Capitulino | #endif
|
133 | d1f29646 | Luiz Capitulino | |
134 | d1f29646 | Luiz Capitulino | #ifndef CONFIG_SPICE
|
135 | d1f29646 | Luiz Capitulino | /* If SPICE support is enabled, the "true" query-spice command is
|
136 | d1f29646 | Luiz Capitulino | defined in the SPICE subsystem. Also note that we use a small
|
137 | d1f29646 | Luiz Capitulino | trick to maintain query-spice's original behavior, which is not
|
138 | d1f29646 | Luiz Capitulino | to be available in the namespace if SPICE is not compiled in */
|
139 | d1f29646 | Luiz Capitulino | SpiceInfo *qmp_query_spice(Error **errp) |
140 | d1f29646 | Luiz Capitulino | { |
141 | d1f29646 | Luiz Capitulino | error_set(errp, QERR_COMMAND_NOT_FOUND, "query-spice");
|
142 | d1f29646 | Luiz Capitulino | return NULL; |
143 | d1f29646 | Luiz Capitulino | }; |
144 | d1f29646 | Luiz Capitulino | #endif
|
145 | e42e818b | Luiz Capitulino | |
146 | e42e818b | Luiz Capitulino | static void iostatus_bdrv_it(void *opaque, BlockDriverState *bs) |
147 | e42e818b | Luiz Capitulino | { |
148 | e42e818b | Luiz Capitulino | bdrv_iostatus_reset(bs); |
149 | e42e818b | Luiz Capitulino | } |
150 | e42e818b | Luiz Capitulino | |
151 | e42e818b | Luiz Capitulino | static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs) |
152 | e42e818b | Luiz Capitulino | { |
153 | e42e818b | Luiz Capitulino | Error **err = opaque; |
154 | e42e818b | Luiz Capitulino | |
155 | e42e818b | Luiz Capitulino | if (!error_is_set(err) && bdrv_key_required(bs)) {
|
156 | 903a8814 | Luiz Capitulino | error_set(err, QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs), |
157 | 903a8814 | Luiz Capitulino | bdrv_get_encrypted_filename(bs)); |
158 | e42e818b | Luiz Capitulino | } |
159 | e42e818b | Luiz Capitulino | } |
160 | e42e818b | Luiz Capitulino | |
161 | e42e818b | Luiz Capitulino | void qmp_cont(Error **errp)
|
162 | e42e818b | Luiz Capitulino | { |
163 | e42e818b | Luiz Capitulino | Error *local_err = NULL;
|
164 | e42e818b | Luiz Capitulino | |
165 | ede085b3 | Hu Tao | if (runstate_needs_reset()) {
|
166 | e42e818b | Luiz Capitulino | error_set(errp, QERR_RESET_REQUIRED); |
167 | e42e818b | Luiz Capitulino | return;
|
168 | ad02b96a | Luiz Capitulino | } else if (runstate_check(RUN_STATE_SUSPENDED)) { |
169 | ad02b96a | Luiz Capitulino | return;
|
170 | e42e818b | Luiz Capitulino | } |
171 | e42e818b | Luiz Capitulino | |
172 | e42e818b | Luiz Capitulino | bdrv_iterate(iostatus_bdrv_it, NULL);
|
173 | e42e818b | Luiz Capitulino | bdrv_iterate(encrypted_bdrv_it, &local_err); |
174 | e42e818b | Luiz Capitulino | if (local_err) {
|
175 | e42e818b | Luiz Capitulino | error_propagate(errp, local_err); |
176 | e42e818b | Luiz Capitulino | return;
|
177 | e42e818b | Luiz Capitulino | } |
178 | e42e818b | Luiz Capitulino | |
179 | 1e998146 | Paolo Bonzini | if (runstate_check(RUN_STATE_INMIGRATE)) {
|
180 | 1e998146 | Paolo Bonzini | autostart = 1;
|
181 | 1e998146 | Paolo Bonzini | } else {
|
182 | 1e998146 | Paolo Bonzini | vm_start(); |
183 | 1e998146 | Paolo Bonzini | } |
184 | e42e818b | Luiz Capitulino | } |
185 | b4b12c62 | Anthony Liguori | |
186 | 9b9df25a | Gerd Hoffmann | void qmp_system_wakeup(Error **errp)
|
187 | 9b9df25a | Gerd Hoffmann | { |
188 | 9b9df25a | Gerd Hoffmann | qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER); |
189 | 9b9df25a | Gerd Hoffmann | } |
190 | 9b9df25a | Gerd Hoffmann | |
191 | 57c9fafe | Anthony Liguori | ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp) |
192 | b4b12c62 | Anthony Liguori | { |
193 | 57c9fafe | Anthony Liguori | Object *obj; |
194 | b4b12c62 | Anthony Liguori | bool ambiguous = false; |
195 | 57c9fafe | Anthony Liguori | ObjectPropertyInfoList *props = NULL;
|
196 | 57c9fafe | Anthony Liguori | ObjectProperty *prop; |
197 | b4b12c62 | Anthony Liguori | |
198 | 57c9fafe | Anthony Liguori | obj = object_resolve_path(path, &ambiguous); |
199 | 57c9fafe | Anthony Liguori | if (obj == NULL) { |
200 | b4b12c62 | Anthony Liguori | error_set(errp, QERR_DEVICE_NOT_FOUND, path); |
201 | b4b12c62 | Anthony Liguori | return NULL; |
202 | b4b12c62 | Anthony Liguori | } |
203 | b4b12c62 | Anthony Liguori | |
204 | 57c9fafe | Anthony Liguori | QTAILQ_FOREACH(prop, &obj->properties, node) { |
205 | 57c9fafe | Anthony Liguori | ObjectPropertyInfoList *entry = g_malloc0(sizeof(*entry));
|
206 | b4b12c62 | Anthony Liguori | |
207 | 57c9fafe | Anthony Liguori | entry->value = g_malloc0(sizeof(ObjectPropertyInfo));
|
208 | b4b12c62 | Anthony Liguori | entry->next = props; |
209 | b4b12c62 | Anthony Liguori | props = entry; |
210 | b4b12c62 | Anthony Liguori | |
211 | b4b12c62 | Anthony Liguori | entry->value->name = g_strdup(prop->name); |
212 | b4b12c62 | Anthony Liguori | entry->value->type = g_strdup(prop->type); |
213 | b4b12c62 | Anthony Liguori | } |
214 | b4b12c62 | Anthony Liguori | |
215 | b4b12c62 | Anthony Liguori | return props;
|
216 | b4b12c62 | Anthony Liguori | } |
217 | eb6e8ea5 | Anthony Liguori | |
218 | eb6e8ea5 | Anthony Liguori | /* FIXME: teach qapi about how to pass through Visitors */
|
219 | eb6e8ea5 | Anthony Liguori | int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject **ret) |
220 | eb6e8ea5 | Anthony Liguori | { |
221 | eb6e8ea5 | Anthony Liguori | const char *path = qdict_get_str(qdict, "path"); |
222 | eb6e8ea5 | Anthony Liguori | const char *property = qdict_get_str(qdict, "property"); |
223 | eb6e8ea5 | Anthony Liguori | QObject *value = qdict_get(qdict, "value");
|
224 | eb6e8ea5 | Anthony Liguori | Error *local_err = NULL;
|
225 | 57c9fafe | Anthony Liguori | Object *obj; |
226 | eb6e8ea5 | Anthony Liguori | |
227 | 57c9fafe | Anthony Liguori | obj = object_resolve_path(path, NULL);
|
228 | 57c9fafe | Anthony Liguori | if (!obj) {
|
229 | eb6e8ea5 | Anthony Liguori | error_set(&local_err, QERR_DEVICE_NOT_FOUND, path); |
230 | eb6e8ea5 | Anthony Liguori | goto out;
|
231 | eb6e8ea5 | Anthony Liguori | } |
232 | eb6e8ea5 | Anthony Liguori | |
233 | 9f5f1350 | Paolo Bonzini | object_property_set_qobject(obj, value, property, &local_err); |
234 | eb6e8ea5 | Anthony Liguori | |
235 | eb6e8ea5 | Anthony Liguori | out:
|
236 | eb6e8ea5 | Anthony Liguori | if (local_err) {
|
237 | eb6e8ea5 | Anthony Liguori | qerror_report_err(local_err); |
238 | eb6e8ea5 | Anthony Liguori | error_free(local_err); |
239 | eb6e8ea5 | Anthony Liguori | return -1; |
240 | eb6e8ea5 | Anthony Liguori | } |
241 | eb6e8ea5 | Anthony Liguori | |
242 | eb6e8ea5 | Anthony Liguori | return 0; |
243 | eb6e8ea5 | Anthony Liguori | } |
244 | eb6e8ea5 | Anthony Liguori | |
245 | eb6e8ea5 | Anthony Liguori | int qmp_qom_get(Monitor *mon, const QDict *qdict, QObject **ret) |
246 | eb6e8ea5 | Anthony Liguori | { |
247 | eb6e8ea5 | Anthony Liguori | const char *path = qdict_get_str(qdict, "path"); |
248 | eb6e8ea5 | Anthony Liguori | const char *property = qdict_get_str(qdict, "property"); |
249 | eb6e8ea5 | Anthony Liguori | Error *local_err = NULL;
|
250 | 57c9fafe | Anthony Liguori | Object *obj; |
251 | eb6e8ea5 | Anthony Liguori | |
252 | 57c9fafe | Anthony Liguori | obj = object_resolve_path(path, NULL);
|
253 | 57c9fafe | Anthony Liguori | if (!obj) {
|
254 | eb6e8ea5 | Anthony Liguori | error_set(&local_err, QERR_DEVICE_NOT_FOUND, path); |
255 | eb6e8ea5 | Anthony Liguori | goto out;
|
256 | eb6e8ea5 | Anthony Liguori | } |
257 | eb6e8ea5 | Anthony Liguori | |
258 | 9f5f1350 | Paolo Bonzini | *ret = object_property_get_qobject(obj, property, &local_err); |
259 | eb6e8ea5 | Anthony Liguori | |
260 | eb6e8ea5 | Anthony Liguori | out:
|
261 | eb6e8ea5 | Anthony Liguori | if (local_err) {
|
262 | eb6e8ea5 | Anthony Liguori | qerror_report_err(local_err); |
263 | eb6e8ea5 | Anthony Liguori | error_free(local_err); |
264 | eb6e8ea5 | Anthony Liguori | return -1; |
265 | eb6e8ea5 | Anthony Liguori | } |
266 | eb6e8ea5 | Anthony Liguori | |
267 | eb6e8ea5 | Anthony Liguori | return 0; |
268 | eb6e8ea5 | Anthony Liguori | } |
269 | fbf796fd | Luiz Capitulino | |
270 | fbf796fd | Luiz Capitulino | void qmp_set_password(const char *protocol, const char *password, |
271 | fbf796fd | Luiz Capitulino | bool has_connected, const char *connected, Error **errp) |
272 | fbf796fd | Luiz Capitulino | { |
273 | fbf796fd | Luiz Capitulino | int disconnect_if_connected = 0; |
274 | fbf796fd | Luiz Capitulino | int fail_if_connected = 0; |
275 | fbf796fd | Luiz Capitulino | int rc;
|
276 | fbf796fd | Luiz Capitulino | |
277 | fbf796fd | Luiz Capitulino | if (has_connected) {
|
278 | fbf796fd | Luiz Capitulino | if (strcmp(connected, "fail") == 0) { |
279 | fbf796fd | Luiz Capitulino | fail_if_connected = 1;
|
280 | fbf796fd | Luiz Capitulino | } else if (strcmp(connected, "disconnect") == 0) { |
281 | fbf796fd | Luiz Capitulino | disconnect_if_connected = 1;
|
282 | fbf796fd | Luiz Capitulino | } else if (strcmp(connected, "keep") == 0) { |
283 | fbf796fd | Luiz Capitulino | /* nothing */
|
284 | fbf796fd | Luiz Capitulino | } else {
|
285 | fbf796fd | Luiz Capitulino | error_set(errp, QERR_INVALID_PARAMETER, "connected");
|
286 | fbf796fd | Luiz Capitulino | return;
|
287 | fbf796fd | Luiz Capitulino | } |
288 | fbf796fd | Luiz Capitulino | } |
289 | fbf796fd | Luiz Capitulino | |
290 | fbf796fd | Luiz Capitulino | if (strcmp(protocol, "spice") == 0) { |
291 | fbf796fd | Luiz Capitulino | if (!using_spice) {
|
292 | fbf796fd | Luiz Capitulino | /* correct one? spice isn't a device ,,, */
|
293 | fbf796fd | Luiz Capitulino | error_set(errp, QERR_DEVICE_NOT_ACTIVE, "spice");
|
294 | fbf796fd | Luiz Capitulino | return;
|
295 | fbf796fd | Luiz Capitulino | } |
296 | fbf796fd | Luiz Capitulino | rc = qemu_spice_set_passwd(password, fail_if_connected, |
297 | fbf796fd | Luiz Capitulino | disconnect_if_connected); |
298 | fbf796fd | Luiz Capitulino | if (rc != 0) { |
299 | fbf796fd | Luiz Capitulino | error_set(errp, QERR_SET_PASSWD_FAILED); |
300 | fbf796fd | Luiz Capitulino | } |
301 | fbf796fd | Luiz Capitulino | return;
|
302 | fbf796fd | Luiz Capitulino | } |
303 | fbf796fd | Luiz Capitulino | |
304 | fbf796fd | Luiz Capitulino | if (strcmp(protocol, "vnc") == 0) { |
305 | fbf796fd | Luiz Capitulino | if (fail_if_connected || disconnect_if_connected) {
|
306 | fbf796fd | Luiz Capitulino | /* vnc supports "connected=keep" only */
|
307 | fbf796fd | Luiz Capitulino | error_set(errp, QERR_INVALID_PARAMETER, "connected");
|
308 | fbf796fd | Luiz Capitulino | return;
|
309 | fbf796fd | Luiz Capitulino | } |
310 | fbf796fd | Luiz Capitulino | /* Note that setting an empty password will not disable login through
|
311 | fbf796fd | Luiz Capitulino | * this interface. */
|
312 | fbf796fd | Luiz Capitulino | rc = vnc_display_password(NULL, password);
|
313 | fbf796fd | Luiz Capitulino | if (rc < 0) { |
314 | fbf796fd | Luiz Capitulino | error_set(errp, QERR_SET_PASSWD_FAILED); |
315 | fbf796fd | Luiz Capitulino | } |
316 | fbf796fd | Luiz Capitulino | return;
|
317 | fbf796fd | Luiz Capitulino | } |
318 | fbf796fd | Luiz Capitulino | |
319 | fbf796fd | Luiz Capitulino | error_set(errp, QERR_INVALID_PARAMETER, "protocol");
|
320 | fbf796fd | Luiz Capitulino | } |
321 | 9ad5372d | Luiz Capitulino | |
322 | 9ad5372d | Luiz Capitulino | void qmp_expire_password(const char *protocol, const char *whenstr, |
323 | 9ad5372d | Luiz Capitulino | Error **errp) |
324 | 9ad5372d | Luiz Capitulino | { |
325 | 9ad5372d | Luiz Capitulino | time_t when; |
326 | 9ad5372d | Luiz Capitulino | int rc;
|
327 | 9ad5372d | Luiz Capitulino | |
328 | 9ad5372d | Luiz Capitulino | if (strcmp(whenstr, "now") == 0) { |
329 | 9ad5372d | Luiz Capitulino | when = 0;
|
330 | 9ad5372d | Luiz Capitulino | } else if (strcmp(whenstr, "never") == 0) { |
331 | 9ad5372d | Luiz Capitulino | when = TIME_MAX; |
332 | 9ad5372d | Luiz Capitulino | } else if (whenstr[0] == '+') { |
333 | 9ad5372d | Luiz Capitulino | when = time(NULL) + strtoull(whenstr+1, NULL, 10); |
334 | 9ad5372d | Luiz Capitulino | } else {
|
335 | 9ad5372d | Luiz Capitulino | when = strtoull(whenstr, NULL, 10); |
336 | 9ad5372d | Luiz Capitulino | } |
337 | 9ad5372d | Luiz Capitulino | |
338 | 9ad5372d | Luiz Capitulino | if (strcmp(protocol, "spice") == 0) { |
339 | 9ad5372d | Luiz Capitulino | if (!using_spice) {
|
340 | 9ad5372d | Luiz Capitulino | /* correct one? spice isn't a device ,,, */
|
341 | 9ad5372d | Luiz Capitulino | error_set(errp, QERR_DEVICE_NOT_ACTIVE, "spice");
|
342 | 9ad5372d | Luiz Capitulino | return;
|
343 | 9ad5372d | Luiz Capitulino | } |
344 | 9ad5372d | Luiz Capitulino | rc = qemu_spice_set_pw_expire(when); |
345 | 9ad5372d | Luiz Capitulino | if (rc != 0) { |
346 | 9ad5372d | Luiz Capitulino | error_set(errp, QERR_SET_PASSWD_FAILED); |
347 | 9ad5372d | Luiz Capitulino | } |
348 | 9ad5372d | Luiz Capitulino | return;
|
349 | 9ad5372d | Luiz Capitulino | } |
350 | 9ad5372d | Luiz Capitulino | |
351 | 9ad5372d | Luiz Capitulino | if (strcmp(protocol, "vnc") == 0) { |
352 | 9ad5372d | Luiz Capitulino | rc = vnc_display_pw_expire(NULL, when);
|
353 | 9ad5372d | Luiz Capitulino | if (rc != 0) { |
354 | 9ad5372d | Luiz Capitulino | error_set(errp, QERR_SET_PASSWD_FAILED); |
355 | 9ad5372d | Luiz Capitulino | } |
356 | 9ad5372d | Luiz Capitulino | return;
|
357 | 9ad5372d | Luiz Capitulino | } |
358 | 9ad5372d | Luiz Capitulino | |
359 | 9ad5372d | Luiz Capitulino | error_set(errp, QERR_INVALID_PARAMETER, "protocol");
|
360 | 9ad5372d | Luiz Capitulino | } |
361 | 270b243f | Luiz Capitulino | |
362 | 333a96ec | Luiz Capitulino | #ifdef CONFIG_VNC
|
363 | 270b243f | Luiz Capitulino | void qmp_change_vnc_password(const char *password, Error **errp) |
364 | 270b243f | Luiz Capitulino | { |
365 | 270b243f | Luiz Capitulino | if (vnc_display_password(NULL, password) < 0) { |
366 | 270b243f | Luiz Capitulino | error_set(errp, QERR_SET_PASSWD_FAILED); |
367 | 270b243f | Luiz Capitulino | } |
368 | 270b243f | Luiz Capitulino | } |
369 | 333a96ec | Luiz Capitulino | |
370 | 007fcd3e | Paolo Bonzini | static void qmp_change_vnc_listen(const char *target, Error **errp) |
371 | 333a96ec | Luiz Capitulino | { |
372 | 007fcd3e | Paolo Bonzini | vnc_display_open(NULL, target, errp);
|
373 | 333a96ec | Luiz Capitulino | } |
374 | 333a96ec | Luiz Capitulino | |
375 | 333a96ec | Luiz Capitulino | static void qmp_change_vnc(const char *target, bool has_arg, const char *arg, |
376 | 333a96ec | Luiz Capitulino | Error **errp) |
377 | 333a96ec | Luiz Capitulino | { |
378 | 333a96ec | Luiz Capitulino | if (strcmp(target, "passwd") == 0 || strcmp(target, "password") == 0) { |
379 | 333a96ec | Luiz Capitulino | if (!has_arg) {
|
380 | 333a96ec | Luiz Capitulino | error_set(errp, QERR_MISSING_PARAMETER, "password");
|
381 | 333a96ec | Luiz Capitulino | } else {
|
382 | 333a96ec | Luiz Capitulino | qmp_change_vnc_password(arg, errp); |
383 | 333a96ec | Luiz Capitulino | } |
384 | 333a96ec | Luiz Capitulino | } else {
|
385 | 333a96ec | Luiz Capitulino | qmp_change_vnc_listen(target, errp); |
386 | 333a96ec | Luiz Capitulino | } |
387 | 333a96ec | Luiz Capitulino | } |
388 | 333a96ec | Luiz Capitulino | #else
|
389 | 333a96ec | Luiz Capitulino | void qmp_change_vnc_password(const char *password, Error **errp) |
390 | 333a96ec | Luiz Capitulino | { |
391 | 333a96ec | Luiz Capitulino | error_set(errp, QERR_FEATURE_DISABLED, "vnc");
|
392 | 333a96ec | Luiz Capitulino | } |
393 | 333a96ec | Luiz Capitulino | static void qmp_change_vnc(const char *target, bool has_arg, const char *arg, |
394 | 333a96ec | Luiz Capitulino | Error **errp) |
395 | 333a96ec | Luiz Capitulino | { |
396 | 333a96ec | Luiz Capitulino | error_set(errp, QERR_FEATURE_DISABLED, "vnc");
|
397 | 333a96ec | Luiz Capitulino | } |
398 | 333a96ec | Luiz Capitulino | #endif /* !CONFIG_VNC */ |
399 | 333a96ec | Luiz Capitulino | |
400 | 333a96ec | Luiz Capitulino | void qmp_change(const char *device, const char *target, |
401 | 333a96ec | Luiz Capitulino | bool has_arg, const char *arg, Error **err) |
402 | 333a96ec | Luiz Capitulino | { |
403 | 333a96ec | Luiz Capitulino | if (strcmp(device, "vnc") == 0) { |
404 | 333a96ec | Luiz Capitulino | qmp_change_vnc(target, has_arg, arg, err); |
405 | 333a96ec | Luiz Capitulino | } else {
|
406 | 314f7ea7 | Marc-Andrรฉ Lureau | qmp_change_blockdev(device, target, arg, err); |
407 | 333a96ec | Luiz Capitulino | } |
408 | 333a96ec | Luiz Capitulino | } |
409 | 5eeee3fa | Anthony Liguori | |
410 | 5eeee3fa | Anthony Liguori | static void qom_list_types_tramp(ObjectClass *klass, void *data) |
411 | 5eeee3fa | Anthony Liguori | { |
412 | 5eeee3fa | Anthony Liguori | ObjectTypeInfoList *e, **pret = data; |
413 | 5eeee3fa | Anthony Liguori | ObjectTypeInfo *info; |
414 | 5eeee3fa | Anthony Liguori | |
415 | 5eeee3fa | Anthony Liguori | info = g_malloc0(sizeof(*info));
|
416 | 5eeee3fa | Anthony Liguori | info->name = g_strdup(object_class_get_name(klass)); |
417 | 5eeee3fa | Anthony Liguori | |
418 | 5eeee3fa | Anthony Liguori | e = g_malloc0(sizeof(*e));
|
419 | 5eeee3fa | Anthony Liguori | e->value = info; |
420 | 5eeee3fa | Anthony Liguori | e->next = *pret; |
421 | 5eeee3fa | Anthony Liguori | *pret = e; |
422 | 5eeee3fa | Anthony Liguori | } |
423 | 5eeee3fa | Anthony Liguori | |
424 | 5eeee3fa | Anthony Liguori | ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
|
425 | 5eeee3fa | Anthony Liguori | const char *implements, |
426 | 5eeee3fa | Anthony Liguori | bool has_abstract,
|
427 | 5eeee3fa | Anthony Liguori | bool abstract,
|
428 | 5eeee3fa | Anthony Liguori | Error **errp) |
429 | 5eeee3fa | Anthony Liguori | { |
430 | 5eeee3fa | Anthony Liguori | ObjectTypeInfoList *ret = NULL;
|
431 | 5eeee3fa | Anthony Liguori | |
432 | 5eeee3fa | Anthony Liguori | object_class_foreach(qom_list_types_tramp, implements, abstract, &ret); |
433 | 5eeee3fa | Anthony Liguori | |
434 | 5eeee3fa | Anthony Liguori | return ret;
|
435 | 5eeee3fa | Anthony Liguori | } |
436 | 1daa31b9 | Anthony Liguori | |
437 | 1daa31b9 | Anthony Liguori | DevicePropertyInfoList *qmp_device_list_properties(const char *typename, |
438 | 1daa31b9 | Anthony Liguori | Error **errp) |
439 | 1daa31b9 | Anthony Liguori | { |
440 | 1daa31b9 | Anthony Liguori | ObjectClass *klass; |
441 | 1daa31b9 | Anthony Liguori | Property *prop; |
442 | 1daa31b9 | Anthony Liguori | DevicePropertyInfoList *prop_list = NULL;
|
443 | 1daa31b9 | Anthony Liguori | |
444 | 1daa31b9 | Anthony Liguori | klass = object_class_by_name(typename); |
445 | 1daa31b9 | Anthony Liguori | if (klass == NULL) { |
446 | 1daa31b9 | Anthony Liguori | error_set(errp, QERR_DEVICE_NOT_FOUND, typename); |
447 | 1daa31b9 | Anthony Liguori | return NULL; |
448 | 1daa31b9 | Anthony Liguori | } |
449 | 1daa31b9 | Anthony Liguori | |
450 | 1daa31b9 | Anthony Liguori | klass = object_class_dynamic_cast(klass, TYPE_DEVICE); |
451 | 1daa31b9 | Anthony Liguori | if (klass == NULL) { |
452 | 1daa31b9 | Anthony Liguori | error_set(errp, QERR_INVALID_PARAMETER_VALUE, |
453 | 1daa31b9 | Anthony Liguori | "name", TYPE_DEVICE);
|
454 | 1daa31b9 | Anthony Liguori | return NULL; |
455 | 1daa31b9 | Anthony Liguori | } |
456 | 1daa31b9 | Anthony Liguori | |
457 | 1daa31b9 | Anthony Liguori | do {
|
458 | 1daa31b9 | Anthony Liguori | for (prop = DEVICE_CLASS(klass)->props; prop && prop->name; prop++) {
|
459 | 1daa31b9 | Anthony Liguori | DevicePropertyInfoList *entry; |
460 | 1daa31b9 | Anthony Liguori | DevicePropertyInfo *info; |
461 | 1daa31b9 | Anthony Liguori | |
462 | 1daa31b9 | Anthony Liguori | /*
|
463 | 1daa31b9 | Anthony Liguori | * TODO Properties without a parser are just for dirty hacks.
|
464 | 1daa31b9 | Anthony Liguori | * qdev_prop_ptr is the only such PropertyInfo. It's marked
|
465 | 1daa31b9 | Anthony Liguori | * for removal. This conditional should be removed along with
|
466 | 1daa31b9 | Anthony Liguori | * it.
|
467 | 1daa31b9 | Anthony Liguori | */
|
468 | 1daa31b9 | Anthony Liguori | if (!prop->info->set) {
|
469 | 1daa31b9 | Anthony Liguori | continue; /* no way to set it, don't show */ |
470 | 1daa31b9 | Anthony Liguori | } |
471 | 1daa31b9 | Anthony Liguori | |
472 | 1daa31b9 | Anthony Liguori | info = g_malloc0(sizeof(*info));
|
473 | 1daa31b9 | Anthony Liguori | info->name = g_strdup(prop->name); |
474 | 1daa31b9 | Anthony Liguori | info->type = g_strdup(prop->info->legacy_name ?: prop->info->name); |
475 | 1daa31b9 | Anthony Liguori | |
476 | 1daa31b9 | Anthony Liguori | entry = g_malloc0(sizeof(*entry));
|
477 | 1daa31b9 | Anthony Liguori | entry->value = info; |
478 | 1daa31b9 | Anthony Liguori | entry->next = prop_list; |
479 | 1daa31b9 | Anthony Liguori | prop_list = entry; |
480 | 1daa31b9 | Anthony Liguori | } |
481 | 1daa31b9 | Anthony Liguori | klass = object_class_get_parent(klass); |
482 | 1daa31b9 | Anthony Liguori | } while (klass != object_class_by_name(TYPE_DEVICE));
|
483 | 1daa31b9 | Anthony Liguori | |
484 | 1daa31b9 | Anthony Liguori | return prop_list;
|
485 | 1daa31b9 | Anthony Liguori | } |
486 | e4e31c63 | Anthony Liguori | |
487 | 76b64a7a | Anthony Liguori | CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) |
488 | 76b64a7a | Anthony Liguori | { |
489 | 76b64a7a | Anthony Liguori | return arch_query_cpu_definitions(errp);
|
490 | 76b64a7a | Anthony Liguori | } |
491 | 76b64a7a | Anthony Liguori | |
492 | b224e5e2 | Luiz Capitulino | void qmp_add_client(const char *protocol, const char *fdname, |
493 | b224e5e2 | Luiz Capitulino | bool has_skipauth, bool skipauth, bool has_tls, bool tls, |
494 | b224e5e2 | Luiz Capitulino | Error **errp) |
495 | b224e5e2 | Luiz Capitulino | { |
496 | b224e5e2 | Luiz Capitulino | CharDriverState *s; |
497 | b224e5e2 | Luiz Capitulino | int fd;
|
498 | b224e5e2 | Luiz Capitulino | |
499 | b224e5e2 | Luiz Capitulino | fd = monitor_get_fd(cur_mon, fdname, errp); |
500 | b224e5e2 | Luiz Capitulino | if (fd < 0) { |
501 | b224e5e2 | Luiz Capitulino | return;
|
502 | b224e5e2 | Luiz Capitulino | } |
503 | b224e5e2 | Luiz Capitulino | |
504 | b224e5e2 | Luiz Capitulino | if (strcmp(protocol, "spice") == 0) { |
505 | b224e5e2 | Luiz Capitulino | if (!using_spice) {
|
506 | b224e5e2 | Luiz Capitulino | error_set(errp, QERR_DEVICE_NOT_ACTIVE, "spice");
|
507 | b224e5e2 | Luiz Capitulino | close(fd); |
508 | b224e5e2 | Luiz Capitulino | return;
|
509 | b224e5e2 | Luiz Capitulino | } |
510 | b224e5e2 | Luiz Capitulino | skipauth = has_skipauth ? skipauth : false;
|
511 | b224e5e2 | Luiz Capitulino | tls = has_tls ? tls : false;
|
512 | b224e5e2 | Luiz Capitulino | if (qemu_spice_display_add_client(fd, skipauth, tls) < 0) { |
513 | b224e5e2 | Luiz Capitulino | error_setg(errp, "spice failed to add client");
|
514 | b224e5e2 | Luiz Capitulino | close(fd); |
515 | b224e5e2 | Luiz Capitulino | } |
516 | b224e5e2 | Luiz Capitulino | return;
|
517 | b224e5e2 | Luiz Capitulino | #ifdef CONFIG_VNC
|
518 | b224e5e2 | Luiz Capitulino | } else if (strcmp(protocol, "vnc") == 0) { |
519 | b224e5e2 | Luiz Capitulino | skipauth = has_skipauth ? skipauth : false;
|
520 | b224e5e2 | Luiz Capitulino | vnc_display_add_client(NULL, fd, skipauth);
|
521 | b224e5e2 | Luiz Capitulino | return;
|
522 | b224e5e2 | Luiz Capitulino | #endif
|
523 | b224e5e2 | Luiz Capitulino | } else if ((s = qemu_chr_find(protocol)) != NULL) { |
524 | b224e5e2 | Luiz Capitulino | if (qemu_chr_add_client(s, fd) < 0) { |
525 | b224e5e2 | Luiz Capitulino | error_setg(errp, "failed to add client");
|
526 | b224e5e2 | Luiz Capitulino | close(fd); |
527 | b224e5e2 | Luiz Capitulino | return;
|
528 | b224e5e2 | Luiz Capitulino | } |
529 | b224e5e2 | Luiz Capitulino | return;
|
530 | b224e5e2 | Luiz Capitulino | } |
531 | b224e5e2 | Luiz Capitulino | |
532 | b224e5e2 | Luiz Capitulino | error_setg(errp, "protocol '%s' is invalid", protocol);
|
533 | b224e5e2 | Luiz Capitulino | close(fd); |
534 | b224e5e2 | Luiz Capitulino | } |
535 | ab2d0531 | Paolo Bonzini | |
536 | cff8b2c6 | Paolo Bonzini | void object_add(const char *type, const char *id, const QDict *qdict, |
537 | cff8b2c6 | Paolo Bonzini | Visitor *v, Error **errp) |
538 | cff8b2c6 | Paolo Bonzini | { |
539 | cff8b2c6 | Paolo Bonzini | Object *obj; |
540 | cff8b2c6 | Paolo Bonzini | const QDictEntry *e;
|
541 | cff8b2c6 | Paolo Bonzini | Error *local_err = NULL;
|
542 | cff8b2c6 | Paolo Bonzini | |
543 | cff8b2c6 | Paolo Bonzini | if (!object_class_by_name(type)) {
|
544 | cff8b2c6 | Paolo Bonzini | error_setg(errp, "invalid class name");
|
545 | cff8b2c6 | Paolo Bonzini | return;
|
546 | cff8b2c6 | Paolo Bonzini | } |
547 | cff8b2c6 | Paolo Bonzini | |
548 | cff8b2c6 | Paolo Bonzini | obj = object_new(type); |
549 | cff8b2c6 | Paolo Bonzini | if (qdict) {
|
550 | cff8b2c6 | Paolo Bonzini | for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) {
|
551 | cff8b2c6 | Paolo Bonzini | object_property_set(obj, v, e->key, &local_err); |
552 | cff8b2c6 | Paolo Bonzini | if (local_err) {
|
553 | 69252c04 | Igor Mammedov | goto out;
|
554 | cff8b2c6 | Paolo Bonzini | } |
555 | cff8b2c6 | Paolo Bonzini | } |
556 | cff8b2c6 | Paolo Bonzini | } |
557 | cff8b2c6 | Paolo Bonzini | |
558 | 269e09f3 | Igor Mammedov | if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) {
|
559 | 269e09f3 | Igor Mammedov | error_setg(&local_err, "object '%s' isn't supported by object-add",
|
560 | 269e09f3 | Igor Mammedov | id); |
561 | 269e09f3 | Igor Mammedov | goto out;
|
562 | 269e09f3 | Igor Mammedov | } |
563 | 269e09f3 | Igor Mammedov | |
564 | 269e09f3 | Igor Mammedov | user_creatable_complete(obj, &local_err); |
565 | 269e09f3 | Igor Mammedov | if (local_err) {
|
566 | 269e09f3 | Igor Mammedov | goto out;
|
567 | 269e09f3 | Igor Mammedov | } |
568 | 269e09f3 | Igor Mammedov | |
569 | cff8b2c6 | Paolo Bonzini | object_property_add_child(container_get(object_get_root(), "/objects"),
|
570 | 69252c04 | Igor Mammedov | id, obj, &local_err); |
571 | 69252c04 | Igor Mammedov | out:
|
572 | 69252c04 | Igor Mammedov | if (local_err) {
|
573 | 69252c04 | Igor Mammedov | error_propagate(errp, local_err); |
574 | 69252c04 | Igor Mammedov | } |
575 | cff8b2c6 | Paolo Bonzini | object_unref(obj); |
576 | cff8b2c6 | Paolo Bonzini | } |
577 | cff8b2c6 | Paolo Bonzini | |
578 | cff8b2c6 | Paolo Bonzini | int qmp_object_add(Monitor *mon, const QDict *qdict, QObject **ret) |
579 | cff8b2c6 | Paolo Bonzini | { |
580 | cff8b2c6 | Paolo Bonzini | const char *type = qdict_get_str(qdict, "qom-type"); |
581 | cff8b2c6 | Paolo Bonzini | const char *id = qdict_get_str(qdict, "id"); |
582 | cff8b2c6 | Paolo Bonzini | QObject *props = qdict_get(qdict, "props");
|
583 | cff8b2c6 | Paolo Bonzini | const QDict *pdict = NULL; |
584 | cff8b2c6 | Paolo Bonzini | Error *local_err = NULL;
|
585 | cff8b2c6 | Paolo Bonzini | QmpInputVisitor *qiv; |
586 | cff8b2c6 | Paolo Bonzini | |
587 | cff8b2c6 | Paolo Bonzini | if (props) {
|
588 | cff8b2c6 | Paolo Bonzini | pdict = qobject_to_qdict(props); |
589 | cff8b2c6 | Paolo Bonzini | if (!pdict) {
|
590 | cff8b2c6 | Paolo Bonzini | error_set(&local_err, QERR_INVALID_PARAMETER_TYPE, "props", "dict"); |
591 | cff8b2c6 | Paolo Bonzini | goto out;
|
592 | cff8b2c6 | Paolo Bonzini | } |
593 | cff8b2c6 | Paolo Bonzini | } |
594 | cff8b2c6 | Paolo Bonzini | |
595 | cff8b2c6 | Paolo Bonzini | qiv = qmp_input_visitor_new(props); |
596 | cff8b2c6 | Paolo Bonzini | object_add(type, id, pdict, qmp_input_get_visitor(qiv), &local_err); |
597 | cff8b2c6 | Paolo Bonzini | qmp_input_visitor_cleanup(qiv); |
598 | cff8b2c6 | Paolo Bonzini | |
599 | cff8b2c6 | Paolo Bonzini | out:
|
600 | cff8b2c6 | Paolo Bonzini | if (local_err) {
|
601 | cff8b2c6 | Paolo Bonzini | qerror_report_err(local_err); |
602 | cff8b2c6 | Paolo Bonzini | error_free(local_err); |
603 | cff8b2c6 | Paolo Bonzini | return -1; |
604 | cff8b2c6 | Paolo Bonzini | } |
605 | cff8b2c6 | Paolo Bonzini | |
606 | cff8b2c6 | Paolo Bonzini | return 0; |
607 | cff8b2c6 | Paolo Bonzini | } |
608 | cff8b2c6 | Paolo Bonzini | |
609 | ab2d0531 | Paolo Bonzini | void qmp_object_del(const char *id, Error **errp) |
610 | ab2d0531 | Paolo Bonzini | { |
611 | ab2d0531 | Paolo Bonzini | Object *container; |
612 | ab2d0531 | Paolo Bonzini | Object *obj; |
613 | ab2d0531 | Paolo Bonzini | |
614 | ab2d0531 | Paolo Bonzini | container = container_get(object_get_root(), "/objects");
|
615 | ab2d0531 | Paolo Bonzini | obj = object_resolve_path_component(container, id); |
616 | ab2d0531 | Paolo Bonzini | if (!obj) {
|
617 | ab2d0531 | Paolo Bonzini | error_setg(errp, "object id not found");
|
618 | ab2d0531 | Paolo Bonzini | return;
|
619 | ab2d0531 | Paolo Bonzini | } |
620 | ab2d0531 | Paolo Bonzini | object_unparent(obj); |
621 | ab2d0531 | Paolo Bonzini | } |