* THE SOFTWARE.
*/
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
+#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
+#include "qapi/qmp/qdict.h"
#include "qemu-common.h"
+/* TODO actually test the results and get rid of this */
+#define qmp_discard_response(...) qobject_unref(qmp(__VA_ARGS__))
+
#define TEST_IMAGE_SIZE 1440 * 1024
#define FLOPPY_BASE 0x3f0
/* Insert media in drive. DSKCHK should not be reset until a step pulse
* is sent. */
- qmp_discard_response("{'execute':'change', 'arguments':{"
- " 'device':'floppy0', 'target': %s, 'arg': 'raw' }}",
+ qmp_discard_response("{'execute':'blockdev-change-medium', 'arguments':{"
+ " 'id':'floppy0', 'filename': %s, 'format': 'raw' }}",
test_image);
dir = inb(FLOPPY_BASE + reg_dir);
/* Eject the floppy and check that DSKCHG is set. Reading it out doesn't
* reset the bit. */
qmp_discard_response("{'execute':'eject', 'arguments':{"
- " 'device':'floppy0' }}");
+ " 'id':'floppy0' }}");
dir = inb(FLOPPY_BASE + reg_dir);
assert_bit_set(dir, DSKCHG);
/* Run the tests */
g_test_init(&argc, &argv, NULL);
- qtest_start(NULL);
+ qtest_start("-device floppy,id=floppy0");
qtest_irq_intercept_in(global_qtest, "ioapic");
qtest_add_func("/fdc/cmos", test_cmos);
qtest_add_func("/fdc/no_media_on_start", test_no_media_on_start);