static void test_plug_with_device_add_x86(gconstpointer data) { const PlugTestData *td = data; char *args; unsigned int s, c, t; args = g_strdup_printf("-machine %s -cpu %s " "-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u", td->machine, td->cpu_model, td->sockets, td->cores, td->threads, td->maxcpus); qtest_start(args); for (s = 1; s < td->sockets; s++) { for (c = 0; c < td->cores; c++) { for (t = 0; t < td->threads; t++) { char *id = g_strdup_printf("id-%i-%i-%i", s, c, t); qtest_qmp_device_add(td->device_model, id, "{'socket-id':%u, 'core-id':%u," " 'thread-id':%u}", s, c, t); g_free(id); } } } qtest_end(); g_free(args); }
static void virtio_serial_hotplug(void) { global_qtest = qtest_initf("-device virtio-serial-ccw"); qtest_qmp_device_add("virtserialport", "hp-port", "{}"); qtest_qmp_device_del("hp-port"); qtest_end(); }
static void virtio_scsi_hotplug(void) { global_qtest = qtest_initf("-drive if=none,id=drv0,file=null-co://,format=raw " "-drive if=none,id=drv1,file=null-co://,format=raw " "-device virtio-scsi-ccw " "-device scsi-hd,drive=drv0"); qtest_qmp_device_add("scsi-hd", "scsihd", "{'drive': 'drv1'}"); qtest_qmp_device_del("scsihd"); qtest_end(); }
static void test_ivshmem_hotplug(void) { const char *arch = qtest_get_arch(); qtest_start("-object memory-backend-ram,size=1M,id=mb1"); qtest_qmp_device_add("ivshmem-plain", "iv1", "{'addr': %s, 'memdev': 'mb1'}", stringify(PCI_SLOT_HP)); if (strcmp(arch, "ppc64") != 0) { qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP); } qtest_end(); }
static void test_plug_with_device_add_coreid(gconstpointer data) { const PlugTestData *td = data; char *args; unsigned int c; args = g_strdup_printf("-machine %s -cpu %s " "-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u", td->machine, td->cpu_model, td->sockets, td->cores, td->threads, td->maxcpus); qtest_start(args); for (c = 1; c < td->cores; c++) { char *id = g_strdup_printf("id-%i", c); qtest_qmp_device_add(td->device_model, id, "{'core-id':%u}", c); g_free(id); } qtest_end(); g_free(args); }
static void hotplug(void) { qtest_qmp_device_add("virtserialport", "hp-port", NULL); qtest_qmp_device_del("hp-port"); }
static void hotplug(void *obj, void *data, QGuestAllocator *alloc) { qtest_qmp_device_add("scsi-hd", "scsihd", "{'drive': 'drv1'}"); qtest_qmp_device_del("scsihd"); }