From 2fe1a152f4f0af14bd780cd9fe477d4bba1b5bd2 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 12 Sep 2011 07:08:01 +0200 Subject: [PATCH] Simplify schema for serial/parallel options (use pattern) --- PVE/QemuServer.pm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 8d23d804..7168c86c 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -421,7 +421,7 @@ my $scsidesc = { optional => 1, type => 'string', format => 'pve-qm-drive', typetext => '[volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback] [,format=f] [,backup=yes|no] [,aio=native|threads]', - description => "Use volume as SCSI hard disk or CD-ROM (n is 0 to 15).", + description => "Use volume as SCSI hard disk or CD-ROM (n is 0 to 13).", }; PVE::JSONSchema::register_standard_option("pve-qm-scsi", $scsidesc); @@ -429,7 +429,7 @@ my $virtiodesc = { optional => 1, type => 'string', format => 'pve-qm-drive', typetext => '[volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback] [,format=f] [,backup=yes|no] [,aio=native|threads]', - description => "Use volume as VIRTIO hard disk (n is 0 to 15).", + description => "Use volume as VIRTIO hard disk (n is 0 to 5).", }; PVE::JSONSchema::register_standard_option("pve-qm-virtio", $virtiodesc); @@ -438,7 +438,7 @@ my $usbdesc = { type => 'string', format => 'pve-qm-usb-device', typetext => 'host=HOSTUSBDEVICE', description => < 1, type => 'string', format => 'pve-qm-serial', - typetext => "SERIALDEVICE", + pattern => '/dev/ttyS\d+', description => < 1, type => 'string', format => 'pve-qm-parallel', - typetext => "PARALLELDEVICE", + pattern => '/dev/parport\d+', description => <{hostusb}; $loc_res = 1 if $conf->{hostpci}; - $loc_res = 1 if $conf->{serial}; - $loc_res = 1 if $conf->{parallel}; foreach my $k (keys %$conf) { - $loc_res = 1 if $k =~ m/^(usb|pci)\d+$/; + $loc_res = 1 if $k =~ m/^(usb|hostpci|serial|parallel)\d+$/; } die "VM uses local resources\n" if $loc_res && !$noerr;