[pve-devel] r6493 - in qemu-server/pve2: . PVE
svn-commits at proxmox.com
svn-commits at proxmox.com
Thu Aug 18 10:17:37 CEST 2011
Author: dietmar
Date: 2011-08-18 10:17:37 +0200 (Thu, 18 Aug 2011)
New Revision: 6493
Modified:
qemu-server/pve2/ChangeLog
qemu-server/pve2/PVE/QemuServer.pm
Log:
* PVE/QemuServer.pm (print_drive_full): enable aio by default.
(parse_drive): support aio option for drives.
Modified: qemu-server/pve2/ChangeLog
===================================================================
--- qemu-server/pve2/ChangeLog 2011-08-18 07:34:39 UTC (rev 6492)
+++ qemu-server/pve2/ChangeLog 2011-08-18 08:17:37 UTC (rev 6493)
@@ -1,3 +1,8 @@
+2011-08-18 Proxmox Support Team <support at proxmox.com>
+
+ * PVE/QemuServer.pm (print_drive_full): enable aio by default.
+ (parse_drive): support aio option for drives.
+
2011-08-17 Proxmox Support Team <support at proxmox.com>
* PVE/QemuServer.pm (load_defaults): only read 'keyboard' from
Modified: qemu-server/pve2/PVE/QemuServer.pm
===================================================================
--- qemu-server/pve2/PVE/QemuServer.pm 2011-08-18 07:34:39 UTC (rev 6492)
+++ qemu-server/pve2/PVE/QemuServer.pm 2011-08-18 08:17:37 UTC (rev 6493)
@@ -443,7 +443,7 @@
my $idedesc = {
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]',
+ 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 IDE hard disk or CD-ROM (n is 0 to 3).",
};
PVE::JSONSchema::register_standard_option("pve-qm-ide", $idedesc);
@@ -451,7 +451,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]',
+ 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).",
};
PVE::JSONSchema::register_standard_option("pve-qm-scsi", $scsidesc);
@@ -459,7 +459,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]',
+ 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).",
};
PVE::JSONSchema::register_standard_option("pve-qm-virtio", $virtiodesc);
@@ -762,6 +762,7 @@
# ideX = [volume=]volume-id[,media=d][,cyls=c,heads=h,secs=s[,trans=t]]
# [,snapshot=on|off][,cache=on|off][,format=f][,backup=yes|no]
+# [,aio=native|threads]
sub parse_drive {
my ($key, $data) = @_;
@@ -782,7 +783,7 @@
foreach my $p (split (/,/, $data)) {
next if $p =~ m/^\s*$/;
- if ($p =~ m/^(file|volume|cyls|heads|secs|trans|media|snapshot|cache|format|rerror|werror|backup)=(.+)$/) {
+ if ($p =~ m/^(file|volume|cyls|heads|secs|trans|media|snapshot|cache|format|rerror|werror|backup|aio)=(.+)$/) {
my ($k, $v) = ($1, $2);
$k = 'file' if $k eq 'volume';
@@ -813,6 +814,7 @@
return undef if $res->{rerror} && $res->{rerror} !~ m/^(ignore|report|stop)$/;
return undef if $res->{werror} && $res->{werror} !~ m/^(enospc|ignore|report|stop)$/;
return undef if $res->{backup} && $res->{backup} !~ m/^(yes|no)$/;
+ return undef if $res->{aio} && $res->{aio} !~ m/^(native|threads)$/;
if ($res->{media} && ($res->{media} eq 'cdrom')) {
return undef if $res->{snapshot} || $res->{trans} || $res->{format};
@@ -828,7 +830,7 @@
return $res;
}
-my @qemu_drive_options = qw(heads secs cyls trans media format cache snapshot rerror werror);
+my @qemu_drive_options = qw(heads secs cyls trans media format cache snapshot rerror werror aio);
sub print_drive {
my ($vmid, $drive) = @_;
@@ -849,6 +851,9 @@
$opts .= ",$o=$drive->{$o}" if $drive->{$o};
}
+ # use linux-aio by default (qemu default is threads)
+ $opts .= ",aio=native" if !$drive->{aio};
+
my $path;
my $volid = $drive->{file};
if (drive_is_cdrom ($drive)) {
More information about the pve-devel
mailing list