4 * Copyright IBM, Corp. 2012
5 * Copyright Red Hat, Inc. 2012
6 * Copyright SUSE LINUX Products GmbH 2013
9 * Anthony Liguori <aliguori@us.ibm.com>
10 * Paolo Bonzini <pbonzini@redhat.com>
11 * Andreas Färber <afaerber@suse.de>
13 * This work is licensed under the terms of the GNU GPL, version 2 or later.
14 * See the COPYING file in the top-level directory.
20 typedef struct QTestState QTestState
;
22 extern QTestState
*global_qtest
;
26 * @fmt...: Format for creating other arguments to pass to QEMU, formatted
29 * Start QEMU and return the resulting #QTestState (but unlike qtest_start(),
30 * #global_qtest is left at NULL).
32 * Returns: #QTestState instance.
34 QTestState
*qtest_startf(const char *fmt
, ...) GCC_FMT_ATTR(1, 2);
38 * @fmt: Format for creating other arguments to pass to QEMU, formatted
40 * @ap: Format arguments.
42 * Start QEMU and return the resulting #QTestState (but unlike qtest_start(),
43 * #global_qtest is left at NULL).
45 * Returns: #QTestState instance.
47 QTestState
*qtest_vstartf(const char *fmt
, va_list ap
) GCC_FMT_ATTR(1, 0);
51 * @extra_args: other arguments to pass to QEMU.
53 * Returns: #QTestState instance.
55 QTestState
*qtest_init(const char *extra_args
);
58 * qtest_init_without_qmp_handshake:
59 * @use_oob: true to have the server advertise OOB support
60 * @extra_args: other arguments to pass to QEMU. CAUTION: these
61 * arguments are subject to word splitting and shell evaluation.
63 * Returns: #QTestState instance.
65 QTestState
*qtest_init_without_qmp_handshake(bool use_oob
,
66 const char *extra_args
);
70 * @s: #QTestState instance to operate on.
72 * Shut down the QEMU process associated to @s.
74 void qtest_quit(QTestState
*s
);
78 * @s: #QTestState instance to operate on.
79 * @fmt...: QMP message to send to qemu, formatted like
80 * qobject_from_jsonf_nofail(). See parse_escape() for what's
81 * supported after '%'.
83 * Sends a QMP message to QEMU and returns the response.
85 QDict
*qtest_qmp(QTestState
*s
, const char *fmt
, ...);
89 * @s: #QTestState instance to operate on.
90 * @fmt...: QMP message to send to qemu, formatted like
91 * qobject_from_jsonf_nofail(). See parse_escape() for what's
92 * supported after '%'.
94 * Sends a QMP message to QEMU and leaves the response in the stream.
96 void qtest_qmp_send(QTestState
*s
, const char *fmt
, ...);
100 * @s: #QTestState instance to operate on.
101 * @fmt: QMP message to send to QEMU, formatted like
102 * qobject_from_jsonf_nofail(). See parse_escape() for what's
103 * supported after '%'.
104 * @ap: QMP message arguments
106 * Sends a QMP message to QEMU and returns the response.
108 QDict
*qtest_qmpv(QTestState
*s
, const char *fmt
, va_list ap
);
112 * @s: #QTestState instance to operate on.
113 * @fmt: QMP message to send to QEMU, formatted like
114 * qobject_from_jsonf_nofail(). See parse_escape() for what's
115 * supported after '%'.
116 * @ap: QMP message arguments
118 * Sends a QMP message to QEMU and leaves the response in the stream.
120 void qtest_qmp_vsend(QTestState
*s
, const char *fmt
, va_list ap
);
124 * @s: #QTestState instance to operate on.
126 * Reads a QMP message from QEMU and returns the response.
128 QDict
*qtest_qmp_receive(QTestState
*s
);
131 * qtest_qmp_eventwait:
132 * @s: #QTestState instance to operate on.
133 * @s: #event event to wait for.
135 * Continuously polls for QMP responses until it receives the desired event.
137 void qtest_qmp_eventwait(QTestState
*s
, const char *event
);
140 * qtest_qmp_eventwait_ref:
141 * @s: #QTestState instance to operate on.
142 * @s: #event event to wait for.
144 * Continuously polls for QMP responses until it receives the desired event.
145 * Returns a copy of the event for further investigation.
147 QDict
*qtest_qmp_eventwait_ref(QTestState
*s
, const char *event
);
150 * qtest_qmp_receive_success:
151 * @s: #QTestState instance to operate on
152 * @event_cb: Event callback
153 * @opaque: Argument for @event_cb
155 * Poll QMP messages until a command success response is received.
156 * If @event_cb, call it for each event received, passing @opaque,
157 * the event's name and data.
158 * Return the success response's "return" member.
160 QDict
*qtest_qmp_receive_success(QTestState
*s
,
161 void (*event_cb
)(void *opaque
,
168 * @s: #QTestState instance to operate on.
169 * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
171 * Send HMP command to QEMU via QMP's human-monitor-command.
172 * QMP events are discarded.
174 * Returns: the command's output. The caller should g_free() it.
176 char *qtest_hmp(QTestState
*s
, const char *fmt
, ...) GCC_FMT_ATTR(2, 3);
180 * @s: #QTestState instance to operate on.
181 * @fmt: HMP command to send to QEMU, formats arguments like vsprintf().
182 * @ap: HMP command arguments
184 * Send HMP command to QEMU via QMP's human-monitor-command.
185 * QMP events are discarded.
187 * Returns: the command's output. The caller should g_free() it.
189 char *qtest_hmpv(QTestState
*s
, const char *fmt
, va_list ap
)
194 * @s: #QTestState instance to operate on.
195 * @num: Interrupt to observe.
197 * Returns: The level of the @num interrupt.
199 bool qtest_get_irq(QTestState
*s
, int num
);
202 * qtest_irq_intercept_in:
203 * @s: #QTestState instance to operate on.
204 * @string: QOM path of a device.
206 * Associate qtest irqs with the GPIO-in pins of the device
207 * whose path is specified by @string.
209 void qtest_irq_intercept_in(QTestState
*s
, const char *string
);
212 * qtest_irq_intercept_out:
213 * @s: #QTestState instance to operate on.
214 * @string: QOM path of a device.
216 * Associate qtest irqs with the GPIO-out pins of the device
217 * whose path is specified by @string.
219 void qtest_irq_intercept_out(QTestState
*s
, const char *string
);
223 * @s: #QTestState instance to operate on.
224 * @addr: I/O port to write to.
225 * @value: Value being written.
227 * Write an 8-bit value to an I/O port.
229 void qtest_outb(QTestState
*s
, uint16_t addr
, uint8_t value
);
233 * @s: #QTestState instance to operate on.
234 * @addr: I/O port to write to.
235 * @value: Value being written.
237 * Write a 16-bit value to an I/O port.
239 void qtest_outw(QTestState
*s
, uint16_t addr
, uint16_t value
);
243 * @s: #QTestState instance to operate on.
244 * @addr: I/O port to write to.
245 * @value: Value being written.
247 * Write a 32-bit value to an I/O port.
249 void qtest_outl(QTestState
*s
, uint16_t addr
, uint32_t value
);
253 * @s: #QTestState instance to operate on.
254 * @addr: I/O port to read from.
256 * Returns an 8-bit value from an I/O port.
258 uint8_t qtest_inb(QTestState
*s
, uint16_t addr
);
262 * @s: #QTestState instance to operate on.
263 * @addr: I/O port to read from.
265 * Returns a 16-bit value from an I/O port.
267 uint16_t qtest_inw(QTestState
*s
, uint16_t addr
);
271 * @s: #QTestState instance to operate on.
272 * @addr: I/O port to read from.
274 * Returns a 32-bit value from an I/O port.
276 uint32_t qtest_inl(QTestState
*s
, uint16_t addr
);
280 * @s: #QTestState instance to operate on.
281 * @addr: Guest address to write to.
282 * @value: Value being written.
284 * Writes an 8-bit value to memory.
286 void qtest_writeb(QTestState
*s
, uint64_t addr
, uint8_t value
);
290 * @s: #QTestState instance to operate on.
291 * @addr: Guest address to write to.
292 * @value: Value being written.
294 * Writes a 16-bit value to memory.
296 void qtest_writew(QTestState
*s
, uint64_t addr
, uint16_t value
);
300 * @s: #QTestState instance to operate on.
301 * @addr: Guest address to write to.
302 * @value: Value being written.
304 * Writes a 32-bit value to memory.
306 void qtest_writel(QTestState
*s
, uint64_t addr
, uint32_t value
);
310 * @s: #QTestState instance to operate on.
311 * @addr: Guest address to write to.
312 * @value: Value being written.
314 * Writes a 64-bit value to memory.
316 void qtest_writeq(QTestState
*s
, uint64_t addr
, uint64_t value
);
320 * @s: #QTestState instance to operate on.
321 * @addr: Guest address to read from.
323 * Reads an 8-bit value from memory.
325 * Returns: Value read.
327 uint8_t qtest_readb(QTestState
*s
, uint64_t addr
);
331 * @s: #QTestState instance to operate on.
332 * @addr: Guest address to read from.
334 * Reads a 16-bit value from memory.
336 * Returns: Value read.
338 uint16_t qtest_readw(QTestState
*s
, uint64_t addr
);
342 * @s: #QTestState instance to operate on.
343 * @addr: Guest address to read from.
345 * Reads a 32-bit value from memory.
347 * Returns: Value read.
349 uint32_t qtest_readl(QTestState
*s
, uint64_t addr
);
353 * @s: #QTestState instance to operate on.
354 * @addr: Guest address to read from.
356 * Reads a 64-bit value from memory.
358 * Returns: Value read.
360 uint64_t qtest_readq(QTestState
*s
, uint64_t addr
);
364 * @s: #QTestState instance to operate on.
365 * @addr: Guest address to read from.
366 * @data: Pointer to where memory contents will be stored.
367 * @size: Number of bytes to read.
369 * Read guest memory into a buffer.
371 void qtest_memread(QTestState
*s
, uint64_t addr
, void *data
, size_t size
);
375 * @s: #QTestState instance to operate on.
376 * @name: name of the command to call.
377 * @nargs: Number of args.
378 * @args: Guest address to read args from.
379 * @nret: Number of return value.
380 * @ret: Guest address to write return values to.
382 * Call an RTAS function
384 uint64_t qtest_rtas_call(QTestState
*s
, const char *name
,
385 uint32_t nargs
, uint64_t args
,
386 uint32_t nret
, uint64_t ret
);
390 * @s: #QTestState instance to operate on.
391 * @addr: Guest address to read from.
392 * @data: Pointer to where memory contents will be stored.
393 * @size: Number of bytes to read.
395 * Read guest memory into a buffer and receive using a base64 encoding.
397 void qtest_bufread(QTestState
*s
, uint64_t addr
, void *data
, size_t size
);
401 * @s: #QTestState instance to operate on.
402 * @addr: Guest address to write to.
403 * @data: Pointer to the bytes that will be written to guest memory.
404 * @size: Number of bytes to write.
406 * Write a buffer to guest memory.
408 void qtest_memwrite(QTestState
*s
, uint64_t addr
, const void *data
, size_t size
);
412 * @s: #QTestState instance to operate on.
413 * @addr: Guest address to write to.
414 * @data: Pointer to the bytes that will be written to guest memory.
415 * @size: Number of bytes to write.
417 * Write a buffer to guest memory and transmit using a base64 encoding.
419 void qtest_bufwrite(QTestState
*s
, uint64_t addr
,
420 const void *data
, size_t size
);
424 * @s: #QTestState instance to operate on.
425 * @addr: Guest address to write to.
426 * @patt: Byte pattern to fill the guest memory region with.
427 * @size: Number of bytes to write.
429 * Write a pattern to guest memory.
431 void qtest_memset(QTestState
*s
, uint64_t addr
, uint8_t patt
, size_t size
);
434 * qtest_clock_step_next:
435 * @s: #QTestState instance to operate on.
437 * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.
439 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
441 int64_t qtest_clock_step_next(QTestState
*s
);
445 * @s: QTestState instance to operate on.
446 * @step: Number of nanoseconds to advance the clock by.
448 * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds.
450 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
452 int64_t qtest_clock_step(QTestState
*s
, int64_t step
);
456 * @s: QTestState instance to operate on.
457 * @val: Nanoseconds value to advance the clock to.
459 * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched.
461 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
463 int64_t qtest_clock_set(QTestState
*s
, int64_t val
);
467 * @s: QTestState instance to operate on.
469 * Returns: True if the architecture under test has a big endian configuration.
471 bool qtest_big_endian(QTestState
*s
);
476 * Returns: The architecture for the QEMU executable under test.
478 const char *qtest_get_arch(void);
482 * @str: Test case path.
483 * @fn: Test case function
485 * Add a GTester testcase with the given name and function.
486 * The path is prefixed with the architecture under test, as
487 * returned by qtest_get_arch().
489 void qtest_add_func(const char *str
, void (*fn
)(void));
492 * qtest_add_data_func:
493 * @str: Test case path.
494 * @data: Test case data
495 * @fn: Test case function
497 * Add a GTester testcase with the given name, data and function.
498 * The path is prefixed with the architecture under test, as
499 * returned by qtest_get_arch().
501 void qtest_add_data_func(const char *str
, const void *data
,
502 void (*fn
)(const void *));
505 * qtest_add_data_func_full:
506 * @str: Test case path.
507 * @data: Test case data
508 * @fn: Test case function
509 * @data_free_func: GDestroyNotify for data
511 * Add a GTester testcase with the given name, data and function.
512 * The path is prefixed with the architecture under test, as
513 * returned by qtest_get_arch().
515 * @data is passed to @data_free_func() on test completion.
517 void qtest_add_data_func_full(const char *str
, void *data
,
518 void (*fn
)(const void *),
519 GDestroyNotify data_free_func
);
523 * @testpath: Test case path
524 * @Fixture: Fixture type
525 * @tdata: Test case data
526 * @fsetup: Test case setup function
527 * @ftest: Test case function
528 * @fteardown: Test case teardown function
530 * Add a GTester testcase with the given name, data and functions.
531 * The path is prefixed with the architecture under test, as
532 * returned by qtest_get_arch().
534 #define qtest_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
536 char *path = g_strdup_printf("/%s/%s", qtest_get_arch(), testpath); \
537 g_test_add(path, Fixture, tdata, fsetup, ftest, fteardown); \
541 void qtest_add_abrt_handler(GHookFunc fn
, const void *data
);
545 * @args: other arguments to pass to QEMU
547 * Start QEMU and assign the resulting #QTestState to a global variable.
548 * The global variable is used by "shortcut" functions documented below.
550 * Returns: #QTestState instance.
552 static inline QTestState
*qtest_start(const char *args
)
554 global_qtest
= qtest_init(args
);
561 * Shut down the QEMU process started by qtest_start().
563 static inline void qtest_end(void)
565 qtest_quit(global_qtest
);
571 * @fmt...: QMP message to send to qemu, formatted like
572 * qobject_from_jsonf_nofail(). See parse_escape() for what's
573 * supported after '%'.
575 * Sends a QMP message to QEMU and returns the response.
577 QDict
*qmp(const char *fmt
, ...);
581 * @fmt...: QMP message to send to qemu, formatted like
582 * qobject_from_jsonf_nofail(). See parse_escape() for what's
583 * supported after '%'.
585 * Sends a QMP message to QEMU and leaves the response in the stream.
587 void qmp_send(const char *fmt
, ...);
592 * Reads a QMP message from QEMU and returns the response.
594 static inline QDict
*qmp_receive(void)
596 return qtest_qmp_receive(global_qtest
);
601 * @s: #event event to wait for.
603 * Continuously polls for QMP responses until it receives the desired event.
605 static inline void qmp_eventwait(const char *event
)
607 return qtest_qmp_eventwait(global_qtest
, event
);
612 * @s: #event event to wait for.
614 * Continuously polls for QMP responses until it receives the desired event.
615 * Returns a copy of the event for further investigation.
617 static inline QDict
*qmp_eventwait_ref(const char *event
)
619 return qtest_qmp_eventwait_ref(global_qtest
, event
);
624 * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
626 * Send HMP command to QEMU via QMP's human-monitor-command.
628 * Returns: the command's output. The caller should g_free() it.
630 char *hmp(const char *fmt
, ...) GCC_FMT_ATTR(1, 2);
634 * @num: Interrupt to observe.
636 * Returns: The level of the @num interrupt.
638 static inline bool get_irq(int num
)
640 return qtest_get_irq(global_qtest
, num
);
645 * @string: QOM path of a device.
647 * Associate qtest irqs with the GPIO-in pins of the device
648 * whose path is specified by @string.
650 static inline void irq_intercept_in(const char *string
)
652 qtest_irq_intercept_in(global_qtest
, string
);
656 * qtest_irq_intercept_out:
657 * @string: QOM path of a device.
659 * Associate qtest irqs with the GPIO-out pins of the device
660 * whose path is specified by @string.
662 static inline void irq_intercept_out(const char *string
)
664 qtest_irq_intercept_out(global_qtest
, string
);
669 * @addr: I/O port to write to.
670 * @value: Value being written.
672 * Write an 8-bit value to an I/O port.
674 static inline void outb(uint16_t addr
, uint8_t value
)
676 qtest_outb(global_qtest
, addr
, value
);
681 * @addr: I/O port to write to.
682 * @value: Value being written.
684 * Write a 16-bit value to an I/O port.
686 static inline void outw(uint16_t addr
, uint16_t value
)
688 qtest_outw(global_qtest
, addr
, value
);
693 * @addr: I/O port to write to.
694 * @value: Value being written.
696 * Write a 32-bit value to an I/O port.
698 static inline void outl(uint16_t addr
, uint32_t value
)
700 qtest_outl(global_qtest
, addr
, value
);
705 * @addr: I/O port to read from.
707 * Reads an 8-bit value from an I/O port.
709 * Returns: Value read.
711 static inline uint8_t inb(uint16_t addr
)
713 return qtest_inb(global_qtest
, addr
);
718 * @addr: I/O port to read from.
720 * Reads a 16-bit value from an I/O port.
722 * Returns: Value read.
724 static inline uint16_t inw(uint16_t addr
)
726 return qtest_inw(global_qtest
, addr
);
731 * @addr: I/O port to read from.
733 * Reads a 32-bit value from an I/O port.
735 * Returns: Value read.
737 static inline uint32_t inl(uint16_t addr
)
739 return qtest_inl(global_qtest
, addr
);
744 * @addr: Guest address to write to.
745 * @value: Value being written.
747 * Writes an 8-bit value to guest memory.
749 static inline void writeb(uint64_t addr
, uint8_t value
)
751 qtest_writeb(global_qtest
, addr
, value
);
756 * @addr: Guest address to write to.
757 * @value: Value being written.
759 * Writes a 16-bit value to guest memory.
761 static inline void writew(uint64_t addr
, uint16_t value
)
763 qtest_writew(global_qtest
, addr
, value
);
768 * @addr: Guest address to write to.
769 * @value: Value being written.
771 * Writes a 32-bit value to guest memory.
773 static inline void writel(uint64_t addr
, uint32_t value
)
775 qtest_writel(global_qtest
, addr
, value
);
780 * @addr: Guest address to write to.
781 * @value: Value being written.
783 * Writes a 64-bit value to guest memory.
785 static inline void writeq(uint64_t addr
, uint64_t value
)
787 qtest_writeq(global_qtest
, addr
, value
);
792 * @addr: Guest address to read from.
794 * Reads an 8-bit value from guest memory.
796 * Returns: Value read.
798 static inline uint8_t readb(uint64_t addr
)
800 return qtest_readb(global_qtest
, addr
);
805 * @addr: Guest address to read from.
807 * Reads a 16-bit value from guest memory.
809 * Returns: Value read.
811 static inline uint16_t readw(uint64_t addr
)
813 return qtest_readw(global_qtest
, addr
);
818 * @addr: Guest address to read from.
820 * Reads a 32-bit value from guest memory.
822 * Returns: Value read.
824 static inline uint32_t readl(uint64_t addr
)
826 return qtest_readl(global_qtest
, addr
);
831 * @addr: Guest address to read from.
833 * Reads a 64-bit value from guest memory.
835 * Returns: Value read.
837 static inline uint64_t readq(uint64_t addr
)
839 return qtest_readq(global_qtest
, addr
);
844 * @addr: Guest address to read from.
845 * @data: Pointer to where memory contents will be stored.
846 * @size: Number of bytes to read.
848 * Read guest memory into a buffer.
850 static inline void memread(uint64_t addr
, void *data
, size_t size
)
852 qtest_memread(global_qtest
, addr
, data
, size
);
857 * @addr: Guest address to read from.
858 * @data: Pointer to where memory contents will be stored.
859 * @size: Number of bytes to read.
861 * Read guest memory into a buffer, receive using a base64 encoding.
863 static inline void bufread(uint64_t addr
, void *data
, size_t size
)
865 qtest_bufread(global_qtest
, addr
, data
, size
);
870 * @addr: Guest address to write to.
871 * @data: Pointer to the bytes that will be written to guest memory.
872 * @size: Number of bytes to write.
874 * Write a buffer to guest memory.
876 static inline void memwrite(uint64_t addr
, const void *data
, size_t size
)
878 qtest_memwrite(global_qtest
, addr
, data
, size
);
883 * @addr: Guest address to write to.
884 * @data: Pointer to the bytes that will be written to guest memory.
885 * @size: Number of bytes to write.
887 * Write a buffer to guest memory, transmit using a base64 encoding.
889 static inline void bufwrite(uint64_t addr
, const void *data
, size_t size
)
891 qtest_bufwrite(global_qtest
, addr
, data
, size
);
896 * @addr: Guest address to write to.
897 * @patt: Byte pattern to fill the guest memory region with.
898 * @size: Number of bytes to write.
900 * Write a pattern to guest memory.
902 static inline void qmemset(uint64_t addr
, uint8_t patt
, size_t size
)
904 qtest_memset(global_qtest
, addr
, patt
, size
);
910 * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.
912 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
914 static inline int64_t clock_step_next(void)
916 return qtest_clock_step_next(global_qtest
);
921 * @step: Number of nanoseconds to advance the clock by.
923 * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds.
925 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
927 static inline int64_t clock_step(int64_t step
)
929 return qtest_clock_step(global_qtest
, step
);
934 * @val: Nanoseconds value to advance the clock to.
936 * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched.
938 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
940 static inline int64_t clock_set(int64_t val
)
942 return qtest_clock_set(global_qtest
, val
);
945 QDict
*qmp_fd_receive(int fd
);
946 void qmp_fd_vsend(int fd
, const char *fmt
, va_list ap
);
947 void qmp_fd_send(int fd
, const char *fmt
, ...);
948 QDict
*qmp_fdv(int fd
, const char *fmt
, va_list ap
);
949 QDict
*qmp_fd(int fd
, const char *fmt
, ...);
952 * qtest_cb_for_every_machine:
953 * @cb: Pointer to the callback function
955 * Call a callback function for every name of all available machines.
957 void qtest_cb_for_every_machine(void (*cb
)(const char *machine
));
960 * qtest_qmp_device_add:
961 * @driver: Name of the device that should be added
962 * @id: Identification string
963 * @fmt...: QMP message to send to qemu, formatted like
964 * qobject_from_jsonf_nofail(). See parse_escape() for what's
965 * supported after '%'.
967 * Generic hot-plugging test via the device_add QMP command.
969 void qtest_qmp_device_add(const char *driver
, const char *id
, const char *fmt
,
970 ...) GCC_FMT_ATTR(3, 4);
973 * qtest_qmp_device_del:
974 * @id: Identification string
976 * Generic hot-unplugging test via the device_del QMP command.
978 void qtest_qmp_device_del(const char *id
);
982 * @rsp: QMP response to check for error
984 * Test @rsp for error and discard @rsp.
985 * Returns 'true' if there is error in @rsp and 'false' otherwise.
987 bool qmp_rsp_is_err(QDict
*rsp
);