mirror of https://github.com/xemu-project/xemu.git
vl: skip init accelerator if it's not available
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
baeddded5f
commit
e3c66d9394
16
vl.c
16
vl.c
|
@ -2577,18 +2577,18 @@ static int configure_accelerator(void)
|
||||||
p = get_opt_name(buf, sizeof (buf), p, ':');
|
p = get_opt_name(buf, sizeof (buf), p, ':');
|
||||||
for (i = 0; i < ARRAY_SIZE(accel_list); i++) {
|
for (i = 0; i < ARRAY_SIZE(accel_list); i++) {
|
||||||
if (strcmp(accel_list[i].opt_name, buf) == 0) {
|
if (strcmp(accel_list[i].opt_name, buf) == 0) {
|
||||||
|
if (!accel_list[i].available()) {
|
||||||
|
printf("%s not supported for this target\n",
|
||||||
|
accel_list[i].name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
*(accel_list[i].allowed) = 1;
|
*(accel_list[i].allowed) = 1;
|
||||||
ret = accel_list[i].init();
|
ret = accel_list[i].init();
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
init_failed = 1;
|
init_failed = 1;
|
||||||
if (!accel_list[i].available()) {
|
fprintf(stderr, "failed to initialize %s: %s\n",
|
||||||
printf("%s not supported for this target\n",
|
accel_list[i].name,
|
||||||
accel_list[i].name);
|
strerror(-ret));
|
||||||
} else {
|
|
||||||
fprintf(stderr, "failed to initialize %s: %s\n",
|
|
||||||
accel_list[i].name,
|
|
||||||
strerror(-ret));
|
|
||||||
}
|
|
||||||
*(accel_list[i].allowed) = 0;
|
*(accel_list[i].allowed) = 0;
|
||||||
} else {
|
} else {
|
||||||
accel_initialised = 1;
|
accel_initialised = 1;
|
||||||
|
|
Loading…
Reference in New Issue