Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/tpm_device.c
Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | tpm_device_create(struct tpm_device **const new_dev, struct vmctx *const vm_ctx, | ||||
return (0); | return (0); | ||||
err_out: | err_out: | ||||
tpm_device_destroy(dev); | tpm_device_destroy(dev); | ||||
return (error); | return (error); | ||||
} | } | ||||
static struct tpm_device *lpc_tpm; | |||||
int | |||||
init_tpm(struct vmctx *ctx) | |||||
{ | |||||
nvlist_t *nvl; | |||||
int error; | |||||
nvl = find_config_node("tpm"); | |||||
if (nvl == NULL) | |||||
return (0); | |||||
error = tpm_device_create(&lpc_tpm, ctx, nvl); | |||||
if (error) { | |||||
warnx("%s: unable to create a TPM device (%d)", | |||||
__func__, error); | |||||
return (error); | |||||
} | |||||
return (0); | |||||
} |