[pve-devel] [PATCH v2 qemu-server 1/1] Use usb-kbd for q35 in tablet mode

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Feb 13 09:53:00 CET 2019


On Tue, Feb 12, 2019 at 01:36:31PM +0100, Kamil Trzciński wrote:
> The usb-kbd on q35 in tablet mode removes the need for "hotpatching"
> when trying to install MacOS on Proxmox.

This kind of change can brake live migration for already running VMs, so
we either have to make it depend on the qemu version (but there's no
other technical reason for this), or we change the `tablet` option into
a property string with an additional `keyboard` boolean.
See commit 9d66b3976980 ("Make agent a property string, add
fstrim_cloned_disks") for an example which also changed a boolean to a
property string option.

> ---
>  PVE/QemuServer.pm | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 6dc68a4..7eb6f37 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -1733,9 +1733,12 @@ sub print_tabletdevice_full {
>  sub print_keyboarddevice_full {
>      my ($conf, $arch, $machine) = @_;
>  
> -    return undef if $arch ne 'aarch64';
> +    my $usbkbd;
> +    if (machine_type_is_q35($conf) || $arch eq 'aarch64') {
> +	$usbkbd = "usb-kbd,id=keyboard,bus=ehci.0,port=2";
> +    }
>  
> -    return "usb-kbd,id=keyboard,bus=ehci.0,port=2";
> +    return $usbkbd;
>  }
>  
>  sub print_drivedevice_full {
> -- 
> 2.17.1




More information about the pve-devel mailing list