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 * Convenience wrapper around qtest_start().
31 * Returns: #QTestState instance.
33 QTestState
*qtest_initf(const char *fmt
, ...) GCC_FMT_ATTR(1, 2);
37 * @fmt: Format for creating other arguments to pass to QEMU, formatted
39 * @ap: Format arguments.
41 * Convenience wrapper around qtest_start().
43 * Returns: #QTestState instance.
45 QTestState
*qtest_vinitf(const char *fmt
, va_list ap
) GCC_FMT_ATTR(1, 0);
49 * @extra_args: other arguments to pass to QEMU. CAUTION: these
50 * arguments are subject to word splitting and shell evaluation.
52 * Returns: #QTestState instance.
54 QTestState
*qtest_init(const char *extra_args
);
57 * qtest_init_without_qmp_handshake:
58 * @use_oob: true to have the server advertise OOB support
59 * @extra_args: other arguments to pass to QEMU. CAUTION: these
60 * arguments are subject to word splitting and shell evaluation.
62 * Returns: #QTestState instance.
64 QTestState
*qtest_init_without_qmp_handshake(bool use_oob
,
65 const char *extra_args
);
69 * @s: #QTestState instance to operate on.
71 * Shut down the QEMU process associated to @s.
73 void qtest_quit(QTestState
*s
);
77 * @s: #QTestState instance to operate on.
78 * @fmt...: QMP message to send to qemu, formatted like
79 * qobject_from_jsonf_nofail(). See parse_escape() for what's
80 * supported after '%'.
82 * Sends a QMP message to QEMU and returns the response.
84 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
, ...)
101 * @s: #QTestState instance to operate on.
102 * @fmt: QMP message to send to QEMU, formatted like
103 * qobject_from_jsonf_nofail(). See parse_escape() for what's
104 * supported after '%'.
105 * @ap: QMP message arguments
107 * Sends a QMP message to QEMU and returns the response.
109 QDict
*qtest_vqmp(QTestState
*s
, const char *fmt
, va_list ap
)
114 * @s: #QTestState instance to operate on.
115 * @fmt: QMP message to send to QEMU, formatted like
116 * qobject_from_jsonf_nofail(). See parse_escape() for what's
117 * supported after '%'.
118 * @ap: QMP message arguments
120 * Sends a QMP message to QEMU and leaves the response in the stream.
122 void qtest_qmp_vsend(QTestState
*s
, const char *fmt
, va_list ap
)
127 * @s: #QTestState instance to operate on.
129 * Reads a QMP message from QEMU and returns the response.
131 QDict
*qtest_qmp_receive(QTestState
*s
);
134 * qtest_qmp_eventwait:
135 * @s: #QTestState instance to operate on.
136 * @s: #event event to wait for.
138 * Continuously polls for QMP responses until it receives the desired event.
140 void qtest_qmp_eventwait(QTestState
*s
, const char *event
);
143 * qtest_qmp_eventwait_ref:
144 * @s: #QTestState instance to operate on.
145 * @s: #event event to wait for.
147 * Continuously polls for QMP responses until it receives the desired event.
148 * Returns a copy of the event for further investigation.
150 QDict
*qtest_qmp_eventwait_ref(QTestState
*s
, const char *event
);
153 * qtest_qmp_receive_success:
154 * @s: #QTestState instance to operate on
155 * @event_cb: Event callback
156 * @opaque: Argument for @event_cb
158 * Poll QMP messages until a command success response is received.
159 * If @event_cb, call it for each event received, passing @opaque,
160 * the event's name and data.
161 * Return the success response's "return" member.
163 QDict
*qtest_qmp_receive_success(QTestState
*s
,
164 void (*event_cb
)(void *opaque
,
171 * @s: #QTestState instance to operate on.
172 * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
174 * Send HMP command to QEMU via QMP's human-monitor-command.
175 * QMP events are discarded.
177 * Returns: the command's output. The caller should g_free() it.
179 char *qtest_hmp(QTestState
*s
, const char *fmt
, ...) GCC_FMT_ATTR(2, 3);
183 * @s: #QTestState instance to operate on.
184 * @fmt: HMP command to send to QEMU, formats arguments like vsprintf().
185 * @ap: HMP command arguments
187 * Send HMP command to QEMU via QMP's human-monitor-command.
188 * QMP events are discarded.
190 * Returns: the command's output. The caller should g_free() it.
192 char *qtest_vhmp(QTestState
*s
, const char *fmt
, va_list ap
)
197 * @s: #QTestState instance to operate on.
198 * @num: Interrupt to observe.
200 * Returns: The level of the @num interrupt.
202 bool qtest_get_irq(QTestState
*s
, int num
);
205 * qtest_irq_intercept_in:
206 * @s: #QTestState instance to operate on.
207 * @string: QOM path of a device.
209 * Associate qtest irqs with the GPIO-in pins of the device
210 * whose path is specified by @string.
212 void qtest_irq_intercept_in(QTestState
*s
, const char *string
);
215 * qtest_irq_intercept_out:
216 * @s: #QTestState instance to operate on.
217 * @string: QOM path of a device.
219 * Associate qtest irqs with the GPIO-out pins of the device
220 * whose path is specified by @string.
222 void qtest_irq_intercept_out(QTestState
*s
, const char *string
);
226 * @s: #QTestState instance to operate on.
227 * @addr: I/O port to write to.
228 * @value: Value being written.
230 * Write an 8-bit value to an I/O port.
232 void qtest_outb(QTestState
*s
, uint16_t addr
, uint8_t value
);
236 * @s: #QTestState instance to operate on.
237 * @addr: I/O port to write to.
238 * @value: Value being written.
240 * Write a 16-bit value to an I/O port.
242 void qtest_outw(QTestState
*s
, uint16_t addr
, uint16_t value
);
246 * @s: #QTestState instance to operate on.
247 * @addr: I/O port to write to.
248 * @value: Value being written.
250 * Write a 32-bit value to an I/O port.
252 void qtest_outl(QTestState
*s
, uint16_t addr
, uint32_t value
);
256 * @s: #QTestState instance to operate on.
257 * @addr: I/O port to read from.
259 * Returns an 8-bit value from an I/O port.
261 uint8_t qtest_inb(QTestState
*s
, uint16_t addr
);
265 * @s: #QTestState instance to operate on.
266 * @addr: I/O port to read from.
268 * Returns a 16-bit value from an I/O port.
270 uint16_t qtest_inw(QTestState
*s
, uint16_t addr
);
274 * @s: #QTestState instance to operate on.
275 * @addr: I/O port to read from.
277 * Returns a 32-bit value from an I/O port.
279 uint32_t qtest_inl(QTestState
*s
, uint16_t addr
);
283 * @s: #QTestState instance to operate on.
284 * @addr: Guest address to write to.
285 * @value: Value being written.
287 * Writes an 8-bit value to memory.
289 void qtest_writeb(QTestState
*s
, uint64_t addr
, uint8_t value
);
293 * @s: #QTestState instance to operate on.
294 * @addr: Guest address to write to.
295 * @value: Value being written.
297 * Writes a 16-bit value to memory.
299 void qtest_writew(QTestState
*s
, uint64_t addr
, uint16_t value
);
303 * @s: #QTestState instance to operate on.
304 * @addr: Guest address to write to.
305 * @value: Value being written.
307 * Writes a 32-bit value to memory.
309 void qtest_writel(QTestState
*s
, uint64_t addr
, uint32_t value
);
313 * @s: #QTestState instance to operate on.
314 * @addr: Guest address to write to.
315 * @value: Value being written.
317 * Writes a 64-bit value to memory.
319 void qtest_writeq(QTestState
*s
, uint64_t addr
, uint64_t value
);
323 * @s: #QTestState instance to operate on.
324 * @addr: Guest address to read from.
326 * Reads an 8-bit value from memory.
328 * Returns: Value read.
330 uint8_t qtest_readb(QTestState
*s
, uint64_t addr
);
334 * @s: #QTestState instance to operate on.
335 * @addr: Guest address to read from.
337 * Reads a 16-bit value from memory.
339 * Returns: Value read.
341 uint16_t qtest_readw(QTestState
*s
, uint64_t addr
);
345 * @s: #QTestState instance to operate on.
346 * @addr: Guest address to read from.
348 * Reads a 32-bit value from memory.
350 * Returns: Value read.
352 uint32_t qtest_readl(QTestState
*s
, uint64_t addr
);
356 * @s: #QTestState instance to operate on.
357 * @addr: Guest address to read from.
359 * Reads a 64-bit value from memory.
361 * Returns: Value read.
363 uint64_t qtest_readq(QTestState
*s
, uint64_t addr
);
367 * @s: #QTestState instance to operate on.
368 * @addr: Guest address to read from.
369 * @data: Pointer to where memory contents will be stored.
370 * @size: Number of bytes to read.
372 * Read guest memory into a buffer.
374 void qtest_memread(QTestState
*s
, uint64_t addr
, void *data
, size_t size
);
378 * @s: #QTestState instance to operate on.
379 * @name: name of the command to call.
380 * @nargs: Number of args.
381 * @args: Guest address to read args from.
382 * @nret: Number of return value.
383 * @ret: Guest address to write return values to.
385 * Call an RTAS function
387 uint64_t qtest_rtas_call(QTestState
*s
, const char *name
,
388 uint32_t nargs
, uint64_t args
,
389 uint32_t nret
, uint64_t ret
);
393 * @s: #QTestState instance to operate on.
394 * @addr: Guest address to read from.
395 * @data: Pointer to where memory contents will be stored.
396 * @size: Number of bytes to read.
398 * Read guest memory into a buffer and receive using a base64 encoding.
400 void qtest_bufread(QTestState
*s
, uint64_t addr
, void *data
, size_t size
);
404 * @s: #QTestState instance to operate on.
405 * @addr: Guest address to write to.
406 * @data: Pointer to the bytes that will be written to guest memory.
407 * @size: Number of bytes to write.
409 * Write a buffer to guest memory.
411 void qtest_memwrite(QTestState
*s
, uint64_t addr
, const void *data
, size_t size
);
415 * @s: #QTestState instance to operate on.
416 * @addr: Guest address to write to.
417 * @data: Pointer to the bytes that will be written to guest memory.
418 * @size: Number of bytes to write.
420 * Write a buffer to guest memory and transmit using a base64 encoding.
422 void qtest_bufwrite(QTestState
*s
, uint64_t addr
,
423 const void *data
, size_t size
);
427 * @s: #QTestState instance to operate on.
428 * @addr: Guest address to write to.
429 * @patt: Byte pattern to fill the guest memory region with.
430 * @size: Number of bytes to write.
432 * Write a pattern to guest memory.
434 void qtest_memset(QTestState
*s
, uint64_t addr
, uint8_t patt
, size_t size
);
437 * qtest_clock_step_next:
438 * @s: #QTestState instance to operate on.
440 * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.
442 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
444 int64_t qtest_clock_step_next(QTestState
*s
);
448 * @s: QTestState instance to operate on.
449 * @step: Number of nanoseconds to advance the clock by.
451 * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds.
453 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
455 int64_t qtest_clock_step(QTestState
*s
, int64_t step
);
459 * @s: QTestState instance to operate on.
460 * @val: Nanoseconds value to advance the clock to.
462 * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched.
464 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
466 int64_t qtest_clock_set(QTestState
*s
, int64_t val
);
470 * @s: QTestState instance to operate on.
472 * Returns: True if the architecture under test has a big endian configuration.
474 bool qtest_big_endian(QTestState
*s
);
479 * Returns: The architecture for the QEMU executable under test.
481 const char *qtest_get_arch(void);
485 * @str: Test case path.
486 * @fn: Test case function
488 * Add a GTester testcase with the given name and function.
489 * The path is prefixed with the architecture under test, as
490 * returned by qtest_get_arch().
492 void qtest_add_func(const char *str
, void (*fn
)(void));
495 * qtest_add_data_func:
496 * @str: Test case path.
497 * @data: Test case data
498 * @fn: Test case function
500 * Add a GTester testcase with the given name, data and function.
501 * The path is prefixed with the architecture under test, as
502 * returned by qtest_get_arch().
504 void qtest_add_data_func(const char *str
, const void *data
,
505 void (*fn
)(const void *));
508 * qtest_add_data_func_full:
509 * @str: Test case path.
510 * @data: Test case data
511 * @fn: Test case function
512 * @data_free_func: GDestroyNotify for data
514 * Add a GTester testcase with the given name, data and function.
515 * The path is prefixed with the architecture under test, as
516 * returned by qtest_get_arch().
518 * @data is passed to @data_free_func() on test completion.
520 void qtest_add_data_func_full(const char *str
, void *data
,
521 void (*fn
)(const void *),
522 GDestroyNotify data_free_func
);
526 * @testpath: Test case path
527 * @Fixture: Fixture type
528 * @tdata: Test case data
529 * @fsetup: Test case setup function
530 * @ftest: Test case function
531 * @fteardown: Test case teardown function
533 * Add a GTester testcase with the given name, data and functions.
534 * The path is prefixed with the architecture under test, as
535 * returned by qtest_get_arch().
537 #define qtest_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
539 char *path = g_strdup_printf("/%s/%s", qtest_get_arch(), testpath); \
540 g_test_add(path, Fixture, tdata, fsetup, ftest, fteardown); \
544 void qtest_add_abrt_handler(GHookFunc fn
, const void *data
);
548 * @args: other arguments to pass to QEMU
550 * Start QEMU and assign the resulting #QTestState to a global variable.
551 * The global variable is used by "shortcut" functions documented below.
553 * Returns: #QTestState instance.
555 static inline QTestState
*qtest_start(const char *args
)
557 global_qtest
= qtest_init(args
);
564 * Shut down the QEMU process started by qtest_start().
566 static inline void qtest_end(void)
568 qtest_quit(global_qtest
);
574 * @fmt...: QMP message to send to qemu, formatted like
575 * qobject_from_jsonf_nofail(). See parse_escape() for what's
576 * supported after '%'.
578 * Sends a QMP message to QEMU and returns the response.
580 QDict
*qmp(const char *fmt
, ...) GCC_FMT_ATTR(1, 2);
584 * @fmt...: QMP message to send to qemu, formatted like
585 * qobject_from_jsonf_nofail(). See parse_escape() for what's
586 * supported after '%'.
588 * Sends a QMP message to QEMU and leaves the response in the stream.
590 void qmp_send(const char *fmt
, ...) GCC_FMT_ATTR(1, 2);
595 * Reads a QMP message from QEMU and returns the response.
597 static inline QDict
*qmp_receive(void)
599 return qtest_qmp_receive(global_qtest
);
604 * @s: #event event to wait for.
606 * Continuously polls for QMP responses until it receives the desired event.
608 static inline void qmp_eventwait(const char *event
)
610 return qtest_qmp_eventwait(global_qtest
, event
);
615 * @s: #event event to wait for.
617 * Continuously polls for QMP responses until it receives the desired event.
618 * Returns a copy of the event for further investigation.
620 static inline QDict
*qmp_eventwait_ref(const char *event
)
622 return qtest_qmp_eventwait_ref(global_qtest
, event
);
627 * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
629 * Send HMP command to QEMU via QMP's human-monitor-command.
631 * Returns: the command's output. The caller should g_free() it.
633 char *hmp(const char *fmt
, ...) GCC_FMT_ATTR(1, 2);
637 * @num: Interrupt to observe.
639 * Returns: The level of the @num interrupt.
641 static inline bool get_irq(int num
)
643 return qtest_get_irq(global_qtest
, num
);
648 * @string: QOM path of a device.
650 * Associate qtest irqs with the GPIO-in pins of the device
651 * whose path is specified by @string.
653 static inline void irq_intercept_in(const char *string
)
655 qtest_irq_intercept_in(global_qtest
, string
);
659 * qtest_irq_intercept_out:
660 * @string: QOM path of a device.
662 * Associate qtest irqs with the GPIO-out pins of the device
663 * whose path is specified by @string.
665 static inline void irq_intercept_out(const char *string
)
667 qtest_irq_intercept_out(global_qtest
, string
);
672 * @addr: I/O port to write to.
673 * @value: Value being written.
675 * Write an 8-bit value to an I/O port.
677 static inline void outb(uint16_t addr
, uint8_t value
)
679 qtest_outb(global_qtest
, addr
, value
);
684 * @addr: I/O port to write to.
685 * @value: Value being written.
687 * Write a 16-bit value to an I/O port.
689 static inline void outw(uint16_t addr
, uint16_t value
)
691 qtest_outw(global_qtest
, addr
, value
);
696 * @addr: I/O port to write to.
697 * @value: Value being written.
699 * Write a 32-bit value to an I/O port.
701 static inline void outl(uint16_t addr
, uint32_t value
)
703 qtest_outl(global_qtest
, addr
, value
);
708 * @addr: I/O port to read from.
710 * Reads an 8-bit value from an I/O port.
712 * Returns: Value read.
714 static inline uint8_t inb(uint16_t addr
)
716 return qtest_inb(global_qtest
, addr
);
721 * @addr: I/O port to read from.
723 * Reads a 16-bit value from an I/O port.
725 * Returns: Value read.
727 static inline uint16_t inw(uint16_t addr
)
729 return qtest_inw(global_qtest
, addr
);
734 * @addr: I/O port to read from.
736 * Reads a 32-bit value from an I/O port.
738 * Returns: Value read.
740 static inline uint32_t inl(uint16_t addr
)
742 return qtest_inl(global_qtest
, addr
);
747 * @addr: Guest address to write to.
748 * @value: Value being written.
750 * Writes an 8-bit value to guest memory.
752 static inline void writeb(uint64_t addr
, uint8_t value
)
754 qtest_writeb(global_qtest
, addr
, value
);
759 * @addr: Guest address to write to.
760 * @value: Value being written.
762 * Writes a 16-bit value to guest memory.
764 static inline void writew(uint64_t addr
, uint16_t value
)
766 qtest_writew(global_qtest
, addr
, value
);
771 * @addr: Guest address to write to.
772 * @value: Value being written.
774 * Writes a 32-bit value to guest memory.
776 static inline void writel(uint64_t addr
, uint32_t value
)
778 qtest_writel(global_qtest
, addr
, value
);
783 * @addr: Guest address to write to.
784 * @value: Value being written.
786 * Writes a 64-bit value to guest memory.
788 static inline void writeq(uint64_t addr
, uint64_t value
)
790 qtest_writeq(global_qtest
, addr
, value
);
795 * @addr: Guest address to read from.
797 * Reads an 8-bit value from guest memory.
799 * Returns: Value read.
801 static inline uint8_t readb(uint64_t addr
)
803 return qtest_readb(global_qtest
, addr
);
808 * @addr: Guest address to read from.
810 * Reads a 16-bit value from guest memory.
812 * Returns: Value read.
814 static inline uint16_t readw(uint64_t addr
)
816 return qtest_readw(global_qtest
, addr
);
821 * @addr: Guest address to read from.
823 * Reads a 32-bit value from guest memory.
825 * Returns: Value read.
827 static inline uint32_t readl(uint64_t addr
)
829 return qtest_readl(global_qtest
, addr
);
834 * @addr: Guest address to read from.
836 * Reads a 64-bit value from guest memory.
838 * Returns: Value read.
840 static inline uint64_t readq(uint64_t addr
)
842 return qtest_readq(global_qtest
, addr
);
847 * @addr: Guest address to read from.
848 * @data: Pointer to where memory contents will be stored.
849 * @size: Number of bytes to read.
851 * Read guest memory into a buffer.
853 static inline void memread(uint64_t addr
, void *data
, size_t size
)
855 qtest_memread(global_qtest
, addr
, data
, size
);
860 * @addr: Guest address to read from.
861 * @data: Pointer to where memory contents will be stored.
862 * @size: Number of bytes to read.
864 * Read guest memory into a buffer, receive using a base64 encoding.
866 static inline void bufread(uint64_t addr
, void *data
, size_t size
)
868 qtest_bufread(global_qtest
, addr
, data
, size
);
873 * @addr: Guest address to write to.
874 * @data: Pointer to the bytes that will be written to guest memory.
875 * @size: Number of bytes to write.
877 * Write a buffer to guest memory.
879 static inline void memwrite(uint64_t addr
, const void *data
, size_t size
)
881 qtest_memwrite(global_qtest
, addr
, data
, size
);
886 * @addr: Guest address to write to.
887 * @data: Pointer to the bytes that will be written to guest memory.
888 * @size: Number of bytes to write.
890 * Write a buffer to guest memory, transmit using a base64 encoding.
892 static inline void bufwrite(uint64_t addr
, const void *data
, size_t size
)
894 qtest_bufwrite(global_qtest
, addr
, data
, size
);
899 * @addr: Guest address to write to.
900 * @patt: Byte pattern to fill the guest memory region with.
901 * @size: Number of bytes to write.
903 * Write a pattern to guest memory.
905 static inline void qmemset(uint64_t addr
, uint8_t patt
, size_t size
)
907 qtest_memset(global_qtest
, addr
, patt
, size
);
913 * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.
915 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
917 static inline int64_t clock_step_next(void)
919 return qtest_clock_step_next(global_qtest
);
924 * @step: Number of nanoseconds to advance the clock by.
926 * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds.
928 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
930 static inline int64_t clock_step(int64_t step
)
932 return qtest_clock_step(global_qtest
, step
);
937 * @val: Nanoseconds value to advance the clock to.
939 * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched.
941 * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
943 static inline int64_t clock_set(int64_t val
)
945 return qtest_clock_set(global_qtest
, val
);
948 QDict
*qmp_fd_receive(int fd
);
949 void qmp_fd_vsend(int fd
, const char *fmt
, va_list ap
) GCC_FMT_ATTR(2, 0);
950 void qmp_fd_send(int fd
, const char *fmt
, ...) GCC_FMT_ATTR(2, 3);
951 QDict
*qmp_fdv(int fd
, const char *fmt
, va_list ap
) GCC_FMT_ATTR(2, 0);
952 QDict
*qmp_fd(int fd
, const char *fmt
, ...) GCC_FMT_ATTR(2, 3);
955 * qtest_cb_for_every_machine:
956 * @cb: Pointer to the callback function
957 * @skip_old_versioned: true if versioned old machine types should be skipped
959 * Call a callback function for every name of all available machines.
961 void qtest_cb_for_every_machine(void (*cb
)(const char *machine
),
962 bool skip_old_versioned
);
965 * qtest_qmp_device_add:
966 * @driver: Name of the device that should be added
967 * @id: Identification string
968 * @fmt...: QMP message to send to qemu, formatted like
969 * qobject_from_jsonf_nofail(). See parse_escape() for what's
970 * supported after '%'.
972 * Generic hot-plugging test via the device_add QMP command.
974 void qtest_qmp_device_add(const char *driver
, const char *id
, const char *fmt
,
975 ...) GCC_FMT_ATTR(3, 4);
978 * qtest_qmp_device_del:
979 * @id: Identification string
981 * Generic hot-unplugging test via the device_del QMP command.
983 void qtest_qmp_device_del(const char *id
);
987 * @rsp: QMP response to check for error
989 * Test @rsp for error and discard @rsp.
990 * Returns 'true' if there is error in @rsp and 'false' otherwise.
992 bool qmp_rsp_is_err(QDict
*rsp
);