From nobody Sun Feb 8 22:07:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1549542516910827.703089680237; Thu, 7 Feb 2019 04:28:36 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC7EC806B6; Thu, 7 Feb 2019 12:28:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 942177C82B; Thu, 7 Feb 2019 12:28:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 35FE2180BAAC; Thu, 7 Feb 2019 12:28:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x17CSNUQ014347 for ; Thu, 7 Feb 2019 07:28:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 81F7816909; Thu, 7 Feb 2019 12:28:23 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08CE260C65 for ; Thu, 7 Feb 2019 12:28:22 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 7 Feb 2019 13:28:10 +0100 Message-Id: <8f58ae88fb15b384ee56e141448c5eb6a12704de.1549542308.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/10] tests: qemuhotplug: Remove leftovers for non-event testing X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 07 Feb 2019 12:28:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" DO_TEST_ATTACH and DO_TEST_ATTACH_EVENT now do the same thing so we can remove the latter including the infrastructure. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuhotplugtest.c | 56 ++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 3318931b9b..cdec25fca3 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -58,8 +58,7 @@ struct qemuHotplugTestData { static int qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, virDomainObjPtr *vm, - const char *domxml, - bool event ATTRIBUTE_UNUSED) + const char *domxml) { int ret =3D -1; qemuDomainObjPrivatePtr priv =3D NULL; @@ -273,8 +272,7 @@ testQemuHotplug(const void *data) goto cleanup; } } else { - if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml, - test->deviceDeletedEvent) < 0) + if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml) < 0) goto cleanup; } @@ -427,7 +425,7 @@ testQemuHotplugCpuPrepare(const char *test, if (virTestLoadFile(data->file_xml_dom, &data->xml_dom) < 0) goto error; - if (qemuHotplugCreateObjects(driver.xmlopt, &data->vm, data->xml_dom, = true) < 0) + if (qemuHotplugCreateObjects(driver.xmlopt, &data->vm, data->xml_dom) = < 0) goto error; if (!(caps =3D virQEMUDriverGetCapabilities(&driver, false))) @@ -622,7 +620,7 @@ mymain(void) /* wait only 100ms for DEVICE_DELETED event */ qemuDomainRemoveDeviceWaitTime =3D 100; -#define DO_TEST(file, ACTION, dev, event, fial, kep, ...) \ +#define DO_TEST(file, ACTION, dev, fial, kep, ...) \ do { \ const char *my_mon[] =3D { __VA_ARGS__, NULL}; \ const char *name =3D file " " #ACTION " " dev; \ @@ -632,22 +630,18 @@ mymain(void) data.fail =3D fial; \ data.mon =3D my_mon; \ data.keep =3D kep; \ - data.deviceDeletedEvent =3D event; \ if (virTestRun(name, testQemuHotplug, &data) < 0) \ ret =3D -1; \ } while (0) #define DO_TEST_ATTACH(file, dev, fial, kep, ...) \ - DO_TEST(file, ATTACH, dev, false, fial, kep, __VA_ARGS__) + DO_TEST(file, ATTACH, dev, fial, kep, __VA_ARGS__) #define DO_TEST_DETACH(file, dev, fial, kep, ...) \ - DO_TEST(file, DETACH, dev, false, fial, kep, __VA_ARGS__) - -#define DO_TEST_ATTACH_EVENT(file, dev, fial, kep, ...) \ - DO_TEST(file, ATTACH, dev, true, fial, kep, __VA_ARGS__) + DO_TEST(file, DETACH, dev, fial, kep, __VA_ARGS__) #define DO_TEST_UPDATE(file, dev, fial, kep, ...) \ - DO_TEST(file, UPDATE, dev, false, fial, kep, __VA_ARGS__) + DO_TEST(file, UPDATE, dev, fial, kep, __VA_ARGS__) #define QMP_OK "{\"return\": {}}" @@ -685,9 +679,9 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("console1") QMP_OK, "chardev-remove", QMP_OK); - DO_TEST_ATTACH_EVENT("base-live", "disk-virtio", false, true, - "human-monitor-command", HMP("OK\\r\\n"), - "device_add", QMP_OK); + DO_TEST_ATTACH("base-live", "disk-virtio", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); DO_TEST_DETACH("base-live", "disk-virtio", true, true, "device_del", QMP_OK, "human-monitor-command", HMP("")); @@ -695,9 +689,9 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("virtio-disk4") QMP_OK, "human-monitor-command", HMP("")); - DO_TEST_ATTACH_EVENT("base-live", "disk-usb", false, true, - "human-monitor-command", HMP("OK\\r\\n"), - "device_add", QMP_OK); + DO_TEST_ATTACH("base-live", "disk-usb", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); DO_TEST_DETACH("base-live", "disk-usb", true, true, "device_del", QMP_OK, "human-monitor-command", HMP("")); @@ -705,9 +699,9 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("usb-disk16") QMP_OK, "human-monitor-command", HMP("")); - DO_TEST_ATTACH_EVENT("base-live", "disk-scsi", false, true, - "human-monitor-command", HMP("OK\\r\\n"), - "device_add", QMP_OK); + DO_TEST_ATTACH("base-live", "disk-scsi", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); DO_TEST_DETACH("base-live", "disk-scsi", true, true, "device_del", QMP_OK, "human-monitor-command", HMP("")); @@ -715,15 +709,15 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("scsi0-0-0-5") QMP_OK, "human-monitor-command", HMP("")); - DO_TEST_ATTACH_EVENT("base-without-scsi-controller-live", "disk-scsi-2= ", false, true, - /* Four controllers added */ - "device_add", QMP_OK, - "device_add", QMP_OK, - "device_add", QMP_OK, - "device_add", QMP_OK, - "human-monitor-command", HMP("OK\\r\\n"), - /* Disk added */ - "device_add", QMP_OK); + DO_TEST_ATTACH("base-without-scsi-controller-live", "disk-scsi-2", fal= se, true, + /* Four controllers added */ + "device_add", QMP_OK, + "device_add", QMP_OK, + "device_add", QMP_OK, + "device_add", QMP_OK, + "human-monitor-command", HMP("OK\\r\\n"), + /* Disk added */ + "device_add", QMP_OK); DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", true, = true, "device_del", QMP_OK, "human-monitor-command", HMP("")); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list