diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2015-12-09 01:24:07 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2015-12-09 01:24:07 +0000 |
commit | a4b5be06227e1022f15e446a073edafcb3251c1e (patch) | |
tree | 87c6fa7e0b0f704b1829503376ad3a67748a10e3 /sys/dev | |
parent | dfeda80ed72b1f0c40cb2f5f3b71f44a28a4fc2f (diff) |
Don't expose XenStore ops we don't know how to deal with
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pv/xen.c | 4 | ||||
-rw-r--r-- | sys/dev/pv/xenstore.c | 8 | ||||
-rw-r--r-- | sys/dev/pv/xenvar.h | 32 |
3 files changed, 11 insertions, 33 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c index 7f2a5964a66..22405c896b6 100644 --- a/sys/dev/pv/xen.c +++ b/sys/dev/pv/xen.c @@ -732,7 +732,7 @@ xen_probe_devices(struct xen_softc *sc) xst.xst_sc = sc->sc_xs; xst.xst_flags |= XST_POLL; - if ((error = xs_cmd(&xst, XS_DIRECTORY, "device", &iovp1, + if ((error = xs_cmd(&xst, XS_LIST, "device", &iovp1, &iov1_cnt)) != 0) return (error); @@ -750,7 +750,7 @@ xen_probe_devices(struct xen_softc *sc) } snprintf(path, sizeof(path), "device/%s", (char *)iovp1[i].iov_base); - if ((error = xs_cmd(&xst, XS_DIRECTORY, path, &iovp2, + if ((error = xs_cmd(&xst, XS_LIST, path, &iovp2, &iov2_cnt)) != 0) { xs_resfree(&xst, iovp1, iov1_cnt); return (error); diff --git a/sys/dev/pv/xenstore.c b/sys/dev/pv/xenstore.c index 18696dc6648..2d7955d5c9d 100644 --- a/sys/dev/pv/xenstore.c +++ b/sys/dev/pv/xenstore.c @@ -701,16 +701,12 @@ xs_cmd(struct xs_transaction *xst, int cmd, const char *path, return (-1); switch (cmd) { - case XS_TRANSACTION_START: + case XS_TOPEN: ov[0].iov_base = ""; ov[0].iov_len = 1; ov_cnt++; break; - case XS_TRANSACTION_END: - mode = WRITE; - break; - case XS_MKDIR: - case XS_RM: + case XS_TCLOSE: case XS_WRITE: mode = WRITE; /* FALLTHROUGH */ diff --git a/sys/dev/pv/xenvar.h b/sys/dev/pv/xenvar.h index 0e62dd9a8d6..cd7082dd251 100644 --- a/sys/dev/pv/xenvar.h +++ b/sys/dev/pv/xenvar.h @@ -90,31 +90,13 @@ void xen_intr_enable(void); /* * XenStore */ -enum { - XS_DEBUG, - XS_DIRECTORY, - XS_READ, - XS_GET_PERMS, - XS_WATCH, - XS_UNWATCH, - XS_TRANSACTION_START, - XS_TRANSACTION_END, - XS_INTRODUCE, - XS_RELEASE, - XS_GET_DOMAIN_PATH, - XS_WRITE, - XS_MKDIR, - XS_RM, - XS_SET_PERMS, - XS_WATCH_EVENT, - XS_ERROR, - XS_IS_DOMAIN_INTRODUCED, - XS_RESUME, - XS_SET_TARGET, - XS_RESTRICT, - XS_RESET_WATCHES, - XS_MAX -}; +#define XS_LIST 0x01 +#define XS_READ 0x02 +#define XS_TOPEN 0x06 +#define XS_TCLOSE 0x07 +#define XS_WRITE 0x0b +#define XS_ERROR 0x10 +#define XS_MAX 0x16 struct xs_transaction { uint32_t xst_id; |