[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/11] s390x/flic: cache flic in s390_get_flic
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 09/11] s390x/flic: cache flic in s390_get_flic |
Date: |
Fri, 21 Apr 2017 09:40:36 +0200 |
From: Fei Li <address@hidden>
s390_get_flic() is called many times to obtain the flic. This wastes a
lot of time as it calls object_resolve_path() every time. Let's cache
S390FLICState by defining it as static.
Signed-off-by: Fei Li <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/intc/s390_flic.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
index bef4caf980..711c11454f 100644
--- a/hw/intc/s390_flic.c
+++ b/hw/intc/s390_flic.c
@@ -21,11 +21,14 @@
S390FLICState *s390_get_flic(void)
{
- S390FLICState *fs;
+ static S390FLICState *fs;
- fs = S390_FLIC_COMMON(object_resolve_path(TYPE_KVM_S390_FLIC, NULL));
if (!fs) {
- fs = S390_FLIC_COMMON(object_resolve_path(TYPE_QEMU_S390_FLIC, NULL));
+ fs = S390_FLIC_COMMON(object_resolve_path(TYPE_KVM_S390_FLIC, NULL));
+ if (!fs) {
+ fs = S390_FLIC_COMMON(object_resolve_path(TYPE_QEMU_S390_FLIC,
+ NULL));
+ }
}
return fs;
}
--
2.11.0
- [Qemu-devel] [PULL 00/11] s390x patches for 2.10, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 01/11] s390x: introduce 2.10 compat machine, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 02/11] s390x/kvm: make printf always compile in debug output, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 03/11] s390x/pci: make printf always compile in debug output, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 07/11] s390x: use enum for adapter type and standardize its naming, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 04/11] s390x/css: introduce read-only property type for device ids, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 06/11] s390x/css: consolidate the devno property for ccw devices, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 10/11] s390x: register I/O adapters per ISC during init, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 05/11] s390x/css: provide introspection for virtual subchannel and device busid, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 08/11] s390x: initialize flic before I/O subsystems, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 09/11] s390x/flic: cache flic in s390_get_flic,
Cornelia Huck <=
- [Qemu-devel] [PULL 11/11] s390x: Drop useless casts, Cornelia Huck, 2017/04/21
- Re: [Qemu-devel] [PULL 00/11] s390x patches for 2.10, Peter Maydell, 2017/04/21