diff --git a/emhttp/plugins/dynamix.vm.manager/VMUsageStats.page b/emhttp/plugins/dynamix.vm.manager/VMUsageStats.page
index b87c75e57..fd024266e 100644
--- a/emhttp/plugins/dynamix.vm.manager/VMUsageStats.page
+++ b/emhttp/plugins/dynamix.vm.manager/VMUsageStats.page
@@ -1,6 +1,6 @@
Menu="VMs:0"
Title="VM Usage Statisics"
-Nchan="vm_usage:stop"
+Nchan="vm_usage"
Cond="exec(\"grep -o '^USAGE=.Y' /boot/config/domain.cfg 2>/dev/null\") && is_file('/var/run/libvirt/libvirtd.pid')"
---
";
}
#$osbootdev = "" ;
+ $evdevstr = "";
+ foreach($evdevs as $evdev) {
+ if ($evdev['dev'] == "") continue;
+ $evdevstr .= " \nsaveXML($memorybackingXML->documentElement);
return "
@@ -1043,6 +1054,7 @@
$channelscopypaste
$swtpm
$memballoon
+ $evdevstr
";
diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php
index efb362397..08ddc34c5 100644
--- a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php
+++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php
@@ -931,6 +931,19 @@ private static $encoding = 'UTF-8';
return $arrValidOtherStubbedDevices;
}
+ function getValidevDev() {
+ $inputevdev = array_merge(glob("/dev/input/by-id/*event-kbd"),glob("/dev/input/by-id/*event-mouse"));
+ return $inputevdev;
+ }
+
+ function getevDev($res) {
+ global $lv ;
+ $xml = $lv->domain_get_xml($res) ;
+ $xmldoc = new SimpleXMLElement($xml);
+ $xmlpath = $xmldoc->xpath('//devices/input[@type="evdev"] ');
+ return $xmlpath;
+ }
+
$cacheValidUSBDevices = null;
function getValidUSBDevices() {
global $cacheValidUSBDevices;
@@ -1375,6 +1388,7 @@ private static $encoding = 'UTF-8';
'nic' => $arrNICs,
'usb' => $arrUSBDevs,
'shares' => $lv->domain_get_mount_filesystems($res),
+ 'evdev' => getevDev($res),
'qemucmdline' => $cmdline,
'clocks' => getClocks($strDOMXML)
];
@@ -1427,6 +1441,7 @@ private static $encoding = 'UTF-8';
}
// settings not in the GUI, but maybe customized
unset($old['clock']);
+ unset($old['devices']['input']);
// preserve vnc/spice port settings
// unset($new['devices']['graphics']['@attributes']['port'],$new['devices']['graphics']['@attributes']['autoport']);
if (!$new['devices']['graphics']) unset($old['devices']['graphics']);
diff --git a/emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php b/emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php
index 87700e1d0..d6ec24ad2 100644
--- a/emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php
+++ b/emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php
@@ -1626,6 +1626,141 @@
Windows and Hyperv Hpet:no Hypervclock: yes Pit no rtc no.
+ #echo "".var_dump($arrConfig['evdev'])." ";
+ if ( $arrConfig['evdev'] == false) {
+
+ $evdevxml = "
+
+ ";
+ $evdevdoc = new SimpleXMLElement($evdevxml);
+ $arrConfig['evdev']= $evdevdoc->xpath('//input[@type="evdev"] ');
+ }
+
+ foreach ($arrConfig['evdev'] as $i => $arrEvdev) {
+ $strLabel = ($i > 0) ? appendOrdinalSuffix($i + 1) : '';
+ ?>
+
+
+ _(Evdev Device)_:
+
+
+
+ echo mk_option($arrEvdev->source->attributes()->dev, '', _('None'));
+ foreach(getValidevDev() as $line) echo mk_option($arrEvdev->source->attributes()->dev, $line , $line);
+ ?>
+
+
+
+
+ _(Grab)_:
+
+
+ source->attributes()->grab, '', _('None'));
+ foreach(["all"] as $line) echo mk_option($arrEvdev->source->attributes()->grab,$line,ucfirst($line));?>
+
+
+
+
+
+ _(Repeat)_:
+
+
+ source->attributes()->repeat, '', _('None'));
+ foreach(["on","off"] as $line) echo mk_option($arrEvdev->source->attributes()->repeat,$line,ucfirst($line));?>
+
+
+
+
+
+ _(Grab Toggle)_:
+
+
+ source->attributes()->grabToggle, '', _('None'));
+ foreach(["ctrl-ctrl", "alt-alt", "shift-shift", "meta-meta", "scrolllock" , "ctrl-scrolllock"] as $line) echo mk_option($arrEvdev->source->attributes()->grabToggle,$line,$line);?>
+
+
+
+
+
+
+
+
+
+
+
+ Event Devices
+ Evdev is an input interface built into the Linux kernel. QEMU’s evdev passthrough support allows a user to redirect evdev events to a guest. These events can include mouse movements and key presses. By hitting both Ctrl keys at the same time, QEMU can toggle the input recipient. QEMU’s evdev passthrough also features almost no latency, making it perfect for gaming. The main downside to evdev passthrough is the lack of button rebinding – and in some cases, macro keys won’t even work at all.
+ Optional items are normally only used for keyboards.
+
+
+ Device
+ Host device to passthrough to guest.
+
+
+
+ Grab
+ All grabs all input devices instead of just one
+
+
+
+ Repeat
+ Repeat with value 'on'/'off' to enable/disable auto-repeat events
+
+
+
+ GrabToggle
+ GrabToggle with values ctrl-ctrl, alt-alt, shift-shift, meta-meta, scrolllock or ctrl-scrolllock to change the grab key combination
+
+ Additional devices can be added/removed by clicking the symbols to the left.
+
+
+ }?>
+ }?>
+
+