From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsOBp-0003CB-3q for qemu-devel@nongnu.org; Wed, 22 Aug 2018 04:08:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsOBk-0007uV-8Q for qemu-devel@nongnu.org; Wed, 22 Aug 2018 04:08:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59428 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsOBj-0007tA-QX for qemu-devel@nongnu.org; Wed, 22 Aug 2018 04:08:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D599E87A82 for ; Wed, 22 Aug 2018 08:08:21 +0000 (UTC) From: Juan Quintela Date: Wed, 22 Aug 2018 10:07:46 +0200 Message-Id: <20180822080751.11307-15-quintela@redhat.com> In-Reply-To: <20180822080751.11307-1-quintela@redhat.com> References: <20180822080751.11307-1-quintela@redhat.com> Subject: [Qemu-devel] [PULL 14/19] check: Only test pvpanic when it is compiled in List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com It was not possible to compile out pvpanic. Use the same trick than applesmc. Signed-off-by: Juan Quintela Reviewed-by: Thomas Huth --- hw/misc/pvpanic.c | 11 ----------- include/hw/misc/pvpanic.h | 11 ++++++++++- tests/Makefile.include | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index b26250dec9..9d8961ba0c 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -99,17 +99,6 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp) isa_register_ioport(d, &s->io, s->ioport); } -#define PVPANIC_IOPORT_PROP "ioport" - -uint16_t pvpanic_port(void) -{ - Object *o = object_resolve_path_type("", TYPE_PVPANIC, NULL); - if (!o) { - return 0; - } - return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL); -} - static Property pvpanic_isa_properties[] = { DEFINE_PROP_UINT16(PVPANIC_IOPORT_PROP, PVPanicState, ioport, 0x505), DEFINE_PROP_END_OF_LIST(), diff --git a/include/hw/misc/pvpanic.h b/include/hw/misc/pvpanic.h index 36a54e270c..1ee071a703 100644 --- a/include/hw/misc/pvpanic.h +++ b/include/hw/misc/pvpanic.h @@ -16,6 +16,15 @@ #define TYPE_PVPANIC "pvpanic" -uint16_t pvpanic_port(void); +#define PVPANIC_IOPORT_PROP "ioport" + +static inline uint16_t pvpanic_port(void) +{ + Object *o = object_resolve_path_type("", TYPE_PVPANIC, NULL); + if (!o) { + return 0; + } + return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL); +} #endif diff --git a/tests/Makefile.include b/tests/Makefile.include index da153ac566..5d50bf1074 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -276,8 +276,8 @@ check-qtest-i386-$(CONFIG_VMXNET3_PCI) += tests/vmxnet3-test$(EXESUF) gcov-files-i386-$(CONFIG_VMXNET3_PCI) += hw/net/vmxnet3.c gcov-files-i386-y += hw/net/net_rx_pkt.c gcov-files-i386-y += hw/net/net_tx_pkt.c -check-qtest-i386-y += tests/pvpanic-test$(EXESUF) -gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c +check-qtest-i386-$(CONFIG_PVPANIC) += tests/pvpanic-test$(EXESUF) +gcov-files-i386-$(CONFIG_PVPANIC) += i386-softmmu/hw/misc/pvpanic.c check-qtest-i386-$(CONFIG_I82801B11) += tests/i82801b11-test$(EXESUF) gcov-files-i386-$(CONFIG_I82801B11) += hw/pci-bridge/i82801b11.c check-qtest-i386-$(CONFIG_IOH3420) += tests/ioh3420-test$(EXESUF) -- 2.17.1