Ben Himberg
2011-Nov-19 20:43 UTC
Run scripts before guest starts and after guest shutsdown
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@lists.xensource.com http://lists.xensource.com/xen-users
Ben Himberg
2011-Nov-22 06:21 UTC
Re: 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@gmail.com> 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@lists.xensource.com http://lists.xensource.com/xen-users