summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-11-29 13:55:34 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-11-29 13:55:34 +0000
commit5bd69a46872b00494ec4038c64e640bf42e8643c (patch)
tree9bca8aee2b7464031df826a98b9c52fd9ef3f2d7
parent7539cd6cb98b76ea7d43f70e70ee1e5a740fa5bf (diff)
Don't expose the xen_softc pointer in the XenStore transaction struct
-rw-r--r--sys/dev/pv/xen.c6
-rw-r--r--sys/dev/pv/xenstore.c18
-rw-r--r--sys/dev/pv/xenvar.h4
3 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c
index 602984d5905..d5a60e0edec 100644
--- a/sys/dev/pv/xen.c
+++ b/sys/dev/pv/xen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xen.c,v 1.64 2016/10/06 17:00:25 mikeb Exp $ */
+/* $OpenBSD: xen.c,v 1.65 2016/11/29 13:55:33 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -202,7 +202,7 @@ xen_control(void *arg)
memset(&xst, 0, sizeof(xst));
xst.xst_id = 0;
- xst.xst_sc = sc->sc_xs;
+ xst.xst_cookie = sc->sc_xs;
error = xs_getprop(sc, "control", "shutdown", action, sizeof(action));
if (error) {
@@ -1280,7 +1280,7 @@ xen_probe_devices(struct xen_softc *sc)
memset(&xst, 0, sizeof(xst));
xst.xst_id = 0;
- xst.xst_sc = sc->sc_xs;
+ xst.xst_cookie = sc->sc_xs;
xst.xst_flags |= XST_POLL;
if ((error = xs_cmd(&xst, XS_LIST, "device", &iovp1, &iov1_cnt)) != 0)
diff --git a/sys/dev/pv/xenstore.c b/sys/dev/pv/xenstore.c
index 135db321d75..2ea8e63156e 100644
--- a/sys/dev/pv/xenstore.c
+++ b/sys/dev/pv/xenstore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xenstore.c,v 1.30 2016/11/29 12:12:29 mikeb Exp $ */
+/* $OpenBSD: xenstore.c,v 1.31 2016/11/29 13:55:33 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -326,7 +326,7 @@ xs_ring_avail(struct xs_ring *xsr, int req)
int
xs_output(struct xs_transaction *xst, uint8_t *bp, int len)
{
- struct xs_softc *xs = xst->xst_sc;
+ struct xs_softc *xs = xst->xst_cookie;
int chunk, s;
while (len > 0) {
@@ -367,7 +367,7 @@ int
xs_start(struct xs_transaction *xst, struct xs_msg *xsm, struct iovec *iov,
int iov_cnt)
{
- struct xs_softc *xs = xst->xst_sc;
+ struct xs_softc *xs = xst->xst_cookie;
int i;
rw_enter_write(&xs->xs_rnglck);
@@ -404,7 +404,7 @@ xs_start(struct xs_transaction *xst, struct xs_msg *xsm, struct iovec *iov,
struct xs_msg *
xs_reply(struct xs_transaction *xst, uint rid)
{
- struct xs_softc *xs = xst->xst_sc;
+ struct xs_softc *xs = xst->xst_cookie;
struct xs_msg *xsm;
int s;
@@ -703,7 +703,7 @@ int
xs_cmd(struct xs_transaction *xst, int cmd, const char *path,
struct iovec **iov, int *iov_cnt)
{
- struct xs_softc *xs = xst->xst_sc;
+ struct xs_softc *xs = xst->xst_cookie;
struct xs_msg *xsm;
struct iovec ov[10]; /* output vector */
int datalen = XS_ERR_PAYLOAD;
@@ -811,7 +811,7 @@ xs_watch(struct xen_softc *sc, const char *path, const char *property,
memset(&xst, 0, sizeof(xst));
xst.xst_id = 0;
- xst.xst_sc = sc->sc_xs;
+ xst.xst_cookie = sc->sc_xs;
if (cold)
xst.xst_flags = XST_POLL;
@@ -869,7 +869,7 @@ xs_getprop(struct xen_softc *sc, const char *path, const char *property,
memset(&xst, 0, sizeof(xst));
xst.xst_id = 0;
- xst.xst_sc = sc->sc_xs;
+ xst.xst_cookie = sc->sc_xs;
if (cold)
xst.xst_flags = XST_POLL;
@@ -905,7 +905,7 @@ xs_setprop(struct xen_softc *sc, const char *path, const char *property,
memset(&xst, 0, sizeof(xst));
xst.xst_id = 0;
- xst.xst_sc = sc->sc_xs;
+ xst.xst_cookie = sc->sc_xs;
if (cold)
xst.xst_flags = XST_POLL;
@@ -952,7 +952,7 @@ xs_kvop(void *arg, int op, char *key, char *value, size_t valuelen)
memset(&xst, 0, sizeof(xst));
xst.xst_id = 0;
- xst.xst_sc = sc->sc_xs;
+ xst.xst_cookie = sc->sc_xs;
if ((error = xs_cmd(&xst, cmd, key, &iovp, &iov_cnt)) != 0)
return (error);
diff --git a/sys/dev/pv/xenvar.h b/sys/dev/pv/xenvar.h
index a0786b7f531..c10d67caf58 100644
--- a/sys/dev/pv/xenvar.h
+++ b/sys/dev/pv/xenvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xenvar.h,v 1.39 2016/10/06 17:00:25 mikeb Exp $ */
+/* $OpenBSD: xenvar.h,v 1.40 2016/11/29 13:55:33 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -140,7 +140,7 @@ struct xs_transaction {
uint32_t xst_id;
uint32_t xst_flags;
#define XST_POLL 0x0001
- struct xs_softc *xst_sc;
+ void *xst_cookie;
};
static __inline void