提交 bc66d6cb 编写于 作者: F Fei Li 提交者: Cornelia Huck

s390x/flic: cache flic in s390_get_flic

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: NFei Li <sherrylf@linux.vnet.ibm.com>
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
上级 c572d3f3
...@@ -21,11 +21,14 @@ ...@@ -21,11 +21,14 @@
S390FLICState *s390_get_flic(void) S390FLICState *s390_get_flic(void)
{ {
S390FLICState *fs; static S390FLICState *fs;
fs = S390_FLIC_COMMON(object_resolve_path(TYPE_KVM_S390_FLIC, NULL));
if (!fs) { 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; return fs;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册