struct rumpxenbus_data_common *const dc = &d->dc;
int err;
- DPRINTF(("/dev/xen/xenbus: write...\n"));
+ DPRINTF(("/dev/xen/xenbus[%p,dd=%p]: write...\n",dc,d));
if (uio->uio_offset < 0)
return EINVAL;
size_t org_resid = uio->uio_resid;
int err;
- DPRINTF(("/dev/xen/xenbus: read...\n"));
+ DPRINTF(("/dev/xen/xenbus[%p,dd=%p:"
+ " read (nonblock=%d)...\n",
+ dc,d, !(fp->f_flag & FNONBLOCK)));
mutex_enter(&d->lock);
for (;;) {
d->rmsg = rumpxenbus_next_event_msg(&d->dc,
!err_if_block,
&d->rmsg_free);
-
+ DPRINTF(("/dev/xen/xenbus: read... rmsg=%p (eib=%d)\n",
+ d->rmsg, err_if_block));
if (!d->rmsg) {
if (uio->uio_resid != org_resid)
/* Done something, claim success. */
void rumpxenbus_dev_xb_wakeup(struct rumpxenbus_data_common *dc)
{
- DPRINTF(("/dev/xen/xenbus: wakeup\n"));
struct rumpxenbus_data_dev *d =
container_of(dc, struct rumpxenbus_data_dev, dc);
+ DPRINTF(("/dev/xen/xenbus[%p,dd=%p]: wakeup\n",d,dc));
selnotify(&d->selinfo, RBITS, NOTE_SUBMIT);
}
{
struct rumpxenbus_data_dev *d = fp->f_data;
- DPRINTF(("/dev/xen/xenbus: restart!\n"));
+ DPRINTF(("/dev/xen/xenbus[dd=%p]: restart!\n",d));
mutex_enter(&d->lock);
d->want_restart |= 1;
struct rumpxenbus_data_common *const dc = &d->dc;
int revents = 0;
- DPRINTF(("/dev/xen/xenbus: poll events=0%o...\n", events));
+ DPRINTF(("/dev/xen/xenbus[%p,dd=%p]: poll events=0%o...\n",
+ dc,d,events));
mutex_enter(&d->lock);
{
struct rumpxenbus_data_dev *d = fp->f_data;
- DPRINTF(("/dev/xen/xenbus: close...\n"));
+ DPRINTF(("/dev/xen/xenbus[dd=%p]: close...\n",d));
/* Not neeeded against concurrent access (we assume!)
* but next_event_msg will want to unlock and relock it */
struct rumpxenbus_data_dev *d;
int err;
+ DPRINTF(("/dev/xen/xenbus: open: entry...\n"));
+
d = xbd_malloc(sizeof(*d));
if (!d)
return ENOMEM;
d->dc.du = 0;
+ DPRINTF(("/dev/xen/xenbus[%p,du=%p]: open: alloc...\n",&d->dc,d));
+
err = rumpxenbus_dev_user_open(&d->dc);
if (err) {
xbd_free(d);
selinit(&d->selinfo);
*fdata_r = d;
+
+ DPRINTF(("/dev/xen/xenbus[%p,dd=%p,du=%p]: opened.\n",
+ &d->dc, d, d->dc.du));
+
return 0;
}
const char *wpath, *wtoken;
int err;
- DPRINTF(("/dev/xen/xenbus: request, type=%d\n",
- d->wbuf.msg.type));
+ DPRINTF(("/dev/xen/xenbus[%p,du=%p]: request, type=%d\n",
+ d,du, d->wbuf.msg.type));
req = xbd_malloc(sizeof(*req));
if (!req) {
* one from xenstored (a) isn't visible to us here and (b)
* anyway has the wrong token in it. */
- DPRINTF(("/dev/xen/xenbus: watch event,"
+ DPRINTF(("/dev/xen/xenbus[%p]: watch event,"
" wpath=%s user_token=%s epath=%s xb.token=%s\n",
+ d,
watch->path, watch->user_token,
event->path, watch->xb.token));
_Bool error = msg->type == XS_ERROR;
KASSERT(error || msg->type == req->req_type);
- DPRINTF(("/dev/xen/xenbus: response, req_type=%d msg->type=%d\n",
- req->req_type, msg->type));
+ DPRINTF(("/dev/xen/xenbus[%p,du=%p]:"
+ " response, req_type=%d msg->type=%d\n",
+ d,du, req->req_type, msg->type));
switch (req->req_type) {
if (!block)
goto fail;
- DPRINTF(("/dev/xen/xenbus: about to block\n"));
+ DPRINTF(("/dev/xen/xenbus[%p,du=%p]: about to block\n",dc,d));
minios_add_waiter(w, d->replies.waitq);
spin_unlock(&xenbus_req_lock);
/* called with req_lock held */
struct rumpxenbus_data_user *d =
container_of(queue, struct rumpxenbus_data_user, replies);
+ DPRINTF(("/dev/xen/xenbus[queue=%p,du=%p]: wakeup...\n",queue,d));
minios_wake_up(&d->replies.waitq);
rumpxenbus_dev_xb_wakeup(d->c);
}
{
struct rumpxenbus_data_user *d = dc->du;
for (;;) {
- DPRINTF(("/dev/xen/xenbus: close loop\n"));
+ DPRINTF(("/dev/xen/xenbus[%p,du=%p]: close loop\n",dc,d));
/* We need to go round this again and again because
* there might be requests in flight. Eg if the
* user has an XS_WATCH in flight we have to wait for it
if (!d)
return ENOMEM;
+ DPRINTF(("/dev/xen/xenbus[%p,dd=%p]: open: user...\n",dc,d));
+
d->c = dc;
d->outstanding_requests = 0;
LIST_INIT(&d->transactions);