return ret;
}
+static int
+bhyveProbeCapsLPC_Bootrom(unsigned int *caps, char *binary)
+{
+ char *error;
+ virCommandPtr cmd = NULL;
+ int ret = -1, exit;
+
+ cmd = virCommandNew(binary);
+ virCommandAddArgList(cmd, "-l", "bootrom", NULL);
+ virCommandSetErrorBuffer(cmd, &error);
+ if (virCommandRun(cmd, &exit) < 0)
+ goto cleanup;
+
+ if (strstr(error, "bhyve: invalid lpc device configuration 'bootrom'") == NULL)
+ *caps |= BHYVE_CAP_LPC_BOOTROM;
+
+ ret = 0;
+ cleanup:
+ VIR_FREE(error);
+ virCommandFree(cmd);
+ return ret;
+}
+
int
virBhyveProbeCaps(unsigned int *caps)
{
if ((ret = bhyveProbeCapsNetE1000(caps, binary)))
goto out;
+ if ((ret = bhyveProbeCapsLPC_Bootrom(caps, binary)))
+ goto out;
+
out:
VIR_FREE(binary);
return ret;
BHYVE_CAP_RTC_UTC = 1 << 0,
BHYVE_CAP_AHCI32SLOT = 1 << 1,
BHYVE_CAP_NET_E1000 = 1 << 2,
+ BHYVE_CAP_LPC_BOOTROM = 1 << 3,
} virBhyveCapsFlags;
int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps);