I have a question regarding event channels. This is a
simplified version of the code I'm using to set up an
event channel between two domains (domU and dom0):
Code in domU (kernel space)
--------------------------------------------------
==alloc a page for shared memory:
p=__get_free_page(GFP_KERNEL);
machine_address = virt_to_machine(p);
mfn = machine_address >> PAGE_SHIFT;
==alloc an event channel HYPERVISOR_event_channel_op
==pass the values to dom0 using xenbus_write (mfn and
channel_port)
--------------------------------------------------
Code in dom0 (user space, using libxenstore and
libxenctrl)
---------------------------------------------
==watch on xenbus, then read the values mfn and
channel_port:
th = xs_transaction_start(xs)
xs_read(xs, th, mfn , &len);
xs_read(xs, th, chan , &len2);
xs_transaction_end(xs, th, 1);
==bind an interdomain event channel with
HYPERVISOR_event_channel_op:
evtchn_op_t op = {
.cmd = EVTCHNOP_bind_interdomain,
.u.bind_interdomain.remote_dom = otherdomain_id,
.u.bind_interdomain.remote_port = chan_port,
};
--------------------------------------------------
After the channel is established I don't understand
how to use it to send notification from domU to dom0.
I'd like also dom0 to acknowledge back domU using the
same channel.
How can dom0 be notified of an event sent from domU?
Looking through the code in drivers/xen/blkfront/ and
drivers/xen/blkback/, usually the driver associates a
virtual-irq and a callback function to the channel,
but I don't understand how to do it in user space
(using libxc), test the channel, reset it, and
acknowledge domU.
I hope I made myself clear :) Thank you very much!
___________________________________
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
http://it.docs.yahoo.com/nowyoucan.html
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|