Commit f3bd7db7 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

wip: set SATA for cdroms

parent d5d9d608
......@@ -1214,7 +1214,6 @@ sub add_volume {
eval { $self->domain->attach_device($xml_device,Sys::Virt::Domain::DEVICE_MODIFY_CONFIG) };
die $@ if $@;
$self->_set_boot_order($path, $boot) if $boot;
return $path;
}
......@@ -1422,7 +1421,7 @@ sub _new_pci_slot{
}
}
}
for my $dec ( 1 .. 99) {
for my $dec ( 2 .. 99) {
next if $target{$dec};
return sprintf("0x%X", $dec);
}
......@@ -2765,6 +2764,7 @@ sub _change_xml_address_usb($self, $address) {
}
sub _change_xml_address_ide($self, $doc, $address, $max_bus=2, $max_unit=9) {
return if $address->getAttribute('type') eq 'drive'
&& $address->getAttribute('bus') =~ /^\d+$/
&& $address->getAttribute('bus') <= $max_bus
......
......@@ -1664,7 +1664,7 @@ sub _xml_modify_options($self, $doc, $options=undef) {
$self->_xml_remove_vmport($doc);
$self->_xml_remove_ide($doc);
}
if ($machine_found =~ /q35/ && $uefi) {
if ($machine_found =~ /q35/ ) {
$self->_xml_set_pcie($doc);
$self->_xml_remove_ide($doc);
$self->_xml_remove_vmport($doc);
......
......@@ -610,7 +610,7 @@
}
if ( hardware == 'disk' && extra.device == 'cdrom') {
extra.driver = 'ide';
extra.driver = 'sata';
}
if (hardware == 'display' && ! extra) {
......
INSERT INTO iso_images
(name,description,arch,xml,xml_volume,url, file_re, md5_url, min_disk_size)
VALUES('Ubuntu Xenial Xerus 32 bits','Ubuntu 16.04 LTS Xenial Xerus 32 bits'
,'i386'
,'i686'
,'xenial-i386.xml'
,'xenial-volume.xml'
,'http://releases.ubuntu.com/16.04/'
......@@ -14,7 +14,7 @@ INSERT INTO iso_images
(name,description,arch,xml,xml_volume,url,file_re,md5_url)
VALUES('Debian Jessie 64 bits'
,'Debian 8.5.0 Jessie 64 bits (netsinst)'
,'amd64'
,'x86_64'
,'jessie-amd64.xml'
,'jessie-volume.xml'
,'http://cdimage.debian.org/cdimage/archive/8.5.0/amd64/iso-cd/'
......@@ -24,7 +24,7 @@ VALUES('Debian Jessie 64 bits'
INSERT INTO iso_images
(name,description,arch,xml,xml_volume,url, file_re, md5_url)
VALUES('Ubuntu Zesty Zapus',' Ubuntu 17.04 Zesty Zapus 64 bits'
,'amd64'
,'x86_64'
,'zesty-amd64.xml'
,'zesty-volume.xml'
,'http://releases.ubuntu.com/17.04/'
......
......@@ -188,6 +188,7 @@ sub test_isos($vm) {
for my $machine (@{$machine_types->{$iso->{arch}}}) {
next if $machine eq 'ubuntu';
for my $uefi ( 0,1 ) {
next if $machine =~ /^pc-q35/ && $iso->{arch} !~ /x86_64/ && !$uefi;
diag($iso->{arch}." ".$iso->{name}." ".$machine
." uefi=$uefi");
my $name = new_domain_name();
......@@ -206,7 +207,7 @@ sub test_isos($vm) {
}
,iso_file => $iso->{device}
);
wait_request();
wait_request(debug => 1);
my $domain = $vm->search_domain($name);
ok($domain);
wait_request();
......
......@@ -207,7 +207,7 @@ sub add_ubuntu_minimal_iso {
,xml => 'bionic-i386.xml'
,xml_volume => 'bionic32-volume.xml'
,rename_file => 'ubuntu_bionic_mini.iso'
,arch => 'i386'
,arch => 'i686'
,md5 => 'c7b21dea4d2ea037c3d97d5dac19af99'
});
my $device = "/var/lib/libvirt/images/".$info{$distro}->{rename_file};
......
......@@ -183,7 +183,7 @@ sub _req_create($vm, $iso, $options) {
push @args,(options => $options) if defined $options;
my $req = Ravada::Request->create_domain(@args);
wait_request( debug => 1);
wait_request( debug => 0);
my $domain = $vm->search_domain($name);
ok($domain) or die "No machine $name ".Dumper($iso);
$domain->shutdown_now(user_admin);
......@@ -239,7 +239,6 @@ sub _machine_types($vm) {
my $machine_types = {};
$machine_types = decode_json($req->output());
warn Dumper($machine_types);
return $machine_types;
}
......@@ -258,20 +257,21 @@ sub test_cdrom($vm) {
die $@ if $@;
$iso->{device} = $device_iso;
diag(("@" x 10)." ".$iso->{name});
my %done;
for my $bios (undef, 'legacy','uefi') {
die Dumper($iso) if !$machine_types->{$iso->{arch}};
for my $machine ( @{$machine_types->{$iso->{arch}}}) {
die if !$iso->{arch};
diag(($bios or '')." ".($machine or ''));
next;
my $key = ($bios or '')."-".($machine or '')."-"
.$iso->{xml}."-".($iso->{xml_volume} or '');
next if $done{$key}++;
my %options;
$options{bios}=$bios if defined $bios;
$options{machine}=$machine if defined $machine;
my $domain = _req_create($vm, $iso, \%options);
next;
_req_add_cd($domain);
_req_remove_cd($domain);
_req_add_cd($domain);
$domain->prepare_base(user_admin);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment