[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Run scripts before guest starts and after guest shutsdown



Well I figured out a way to do it, though it is really hackish.  I just appended my closing commands to the xend-hotplug-cleanup file in /etc/xen/scripts.

On Sat, Nov 19, 2011 at 3:43 PM, Ben Himberg <bhimberg@xxxxxxxxx> wrote:
So I want to automatically pass my keyboard to a newly created guest.  The idea is to bind the usb device it resides on (0000:00:1a.0) to pciback before starting the new domain and then, when that domain is shut down, the system binds the device to ehci_hcd.  The first part is easy, I just execute a file with the following commands:

echo -n 0000:00:1a.0 > /sys/bus/pci/drivers/ehci_hcd/unbind
echo -n 0000:00:1a.0 > /sys/bus/pci/drivers/pciback/new_slot
echo -n 0000:00:1a.0 > /sys/bus/pci/drivers/pciback/bind
xm create Win7

The problem is I'm not sure where to put the following lines.  I need xen to execute a these commands when the new domain closes.

echo -n 0000:00:1a.0 > /sys/bus/pci/drivers/pciback/unbind
echo -n 0000:00:1a.0 > /sys/bus/pci/drivers/ehci_hcd/bind

The only thing I can come up with is having windows open an ssh shell and pass the commands to xen as part of its showdown process.  I'm just hoping there is a xen config file option that allows me to execute a script before the opening and after the closing of a domain.  Any ideas?

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.