Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_virtio_block.c
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | static struct virtio_consts vtblk_vi_consts = { | ||||
VTBLK_S_HOSTCAPS, /* our capabilities */ | VTBLK_S_HOSTCAPS, /* our capabilities */ | ||||
}; | }; | ||||
static void | static void | ||||
pci_vtblk_reset(void *vsc) | pci_vtblk_reset(void *vsc) | ||||
{ | { | ||||
struct pci_vtblk_softc *sc = vsc; | struct pci_vtblk_softc *sc = vsc; | ||||
DPRINTF(("vtblk: device reset requested !\n")); | DPRINTF(("vtblk: device reset requested !\n\r")); | ||||
vi_reset_dev(&sc->vbsc_vs); | vi_reset_dev(&sc->vbsc_vs); | ||||
} | } | ||||
static void | static void | ||||
pci_vtblk_done(struct blockif_req *br, int err) | pci_vtblk_done(struct blockif_req *br, int err) | ||||
{ | { | ||||
struct pci_vtblk_ioreq *io = br->br_param; | struct pci_vtblk_ioreq *io = br->br_param; | ||||
struct pci_vtblk_softc *sc = io->io_sc; | struct pci_vtblk_softc *sc = io->io_sc; | ||||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) | ||||
struct blockif_ctxt *bctxt; | struct blockif_ctxt *bctxt; | ||||
MD5_CTX mdctx; | MD5_CTX mdctx; | ||||
u_char digest[16]; | u_char digest[16]; | ||||
struct pci_vtblk_softc *sc; | struct pci_vtblk_softc *sc; | ||||
off_t size; | off_t size; | ||||
int i, sectsz, sts, sto; | int i, sectsz, sts, sto; | ||||
if (opts == NULL) { | if (opts == NULL) { | ||||
printf("virtio-block: backing device required\n"); | WPRINTF(("virtio-block: backing device required\n\r")); | ||||
return (1); | return (1); | ||||
} | } | ||||
/* | /* | ||||
* The supplied backing file has to exist | * The supplied backing file has to exist | ||||
*/ | */ | ||||
snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); | snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); | ||||
bctxt = blockif_open(opts, bident); | bctxt = blockif_open(opts, bident); | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |