diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2015-12-09 14:20:07 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2015-12-09 14:20:07 +0000 |
commit | 464a88ebe2b0eb49b49162c458230afce2a7ea02 (patch) | |
tree | 839723eba47cb5762266adcb02af192b1f02d70b /sys/dev | |
parent | d977e12ce0c402c694abe27d4fed821d4aed114d (diff) |
Store the backend node in the attach argument structure
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pv/xen.c | 12 | ||||
-rw-r--r-- | sys/dev/pv/xenvar.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c index de39685bc88..1819d0b707d 100644 --- a/sys/dev/pv/xen.c +++ b/sys/dev/pv/xen.c @@ -723,9 +723,9 @@ xen_probe_devices(struct xen_softc *sc) { struct xen_attach_args xa; struct xs_transaction xst; - struct iovec *iovp1, *iovp2; - int error = 0, iov1_cnt, iov2_cnt, i, j; - char path[64]; + struct iovec *iovp1, *iovp2, *iovp3; + int i, j, error = 0, iov1_cnt, iov2_cnt, iov3_cnt; + char path[128]; memset(&xst, 0, sizeof(xst)); xst.xst_id = 0; @@ -762,6 +762,12 @@ xen_probe_devices(struct xen_softc *sc) snprintf(xa.xa_node, sizeof(xa.xa_node), "device/%s/%s", (char *)iovp1[i].iov_base, (char *)iovp2[j].iov_base); + snprintf(path, sizeof(path), "%s/backend", xa.xa_node); + if (!xs_cmd(&xst, XS_READ, path, &iovp3, &iov3_cnt)) { + strlcpy(xa.xa_backend, (char *)iovp3->iov_base, + sizeof(xa.xa_backend)); + xs_resfree(&xst, iovp3, iov3_cnt); + } config_found((struct device *)sc, &xa, xen_attach_print); } diff --git a/sys/dev/pv/xenvar.h b/sys/dev/pv/xenvar.h index cd7082dd251..936247ebe86 100644 --- a/sys/dev/pv/xenvar.h +++ b/sys/dev/pv/xenvar.h @@ -61,6 +61,7 @@ struct xen_attach_args { void *xa_parent; char xa_name[16]; char xa_node[64]; + char xa_backend[128]; }; /* |