From 0582e678653b6dc67ff586c0c847d58015b2d4e5 Mon Sep 17 00:00:00 2001 From: Francesc Guasch Date: Thu, 19 Oct 2017 16:28:37 +0200 Subject: [PATCH 1/5] [408] Ubuntu AA 17.10 iso location --- lib/Ravada.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Ravada.pm b/lib/Ravada.pm index fa2ffb63e..355270ced 100644 --- a/lib/Ravada.pm +++ b/lib/Ravada.pm @@ -171,7 +171,17 @@ sub _update_isos { my $table = 'iso_images'; my $field = 'name'; my %data = ( - zesty => { + artful => { + name => 'Ubuntu Artful Aardvak' + ,description => 'Ubuntu 17.10 Artful Aardvak 64 bits' + ,arch => 'amd64' + ,xml => 'yakkety64-amd64.xml' + ,xml_volume => 'yakkety64-volume.xml' + ,url => 'http://releases.ubuntu.com/17.10/' + ,file_re => ,'ubuntu-17.10.*desktop-amd64.iso' + ,md5_url => ,'http://releases.ubuntu.com/17.10/MD5SUMS' + } + ,zesty => { name => 'Ubuntu Zesty Zapus' ,description => 'Ubuntu 17.04 Zesty Zapus 64 bits' ,arch => 'amd64' From 3e0cecfb757f83f4efe03923c65f622788b67061 Mon Sep 17 00:00:00 2001 From: Francesc Guasch Date: Thu, 19 Oct 2017 17:03:16 +0200 Subject: [PATCH 2/5] [#408] lubuntu 17.10 --- lib/Ravada.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Ravada.pm b/lib/Ravada.pm index 355270ced..b770163c0 100644 --- a/lib/Ravada.pm +++ b/lib/Ravada.pm @@ -231,6 +231,14 @@ sub _update_isos { ,md5 => 'fe495d34188a9568c8d166efc5898d22' ,rename_file => 'xubuntu_xenial_mini.iso' } + ,lubuntu_aardvark => { + name => 'Lubuntu Artful Aardvark' + ,description => 'Lubuntu 17.10 Artful Aardvark 64 bits' + ,url => 'http://cdimage.ubuntu.com/lubuntu/releases/17.10/release/lubuntu-17.10-desktop-amd64.iso' + ,md5_url => 'http://cdimage.ubuntu.com/lubuntu/releases/17.10/release/MD5SUMS' + ,xml => 'yakkety64-amd64.xml' + ,xml_volume => 'yakkety64-volume.xml' + } ,lubuntu_zesty => { name => 'Lubuntu Zesty Zapus' ,description => 'Lubuntu 17.04 Zesty Zapus 64 bits' From f404ee28d864b92ca182c6b711737e746cc43682 Mon Sep 17 00:00:00 2001 From: Francesc Guasch Date: Mon, 6 Nov 2017 12:27:24 +0100 Subject: [PATCH 3/5] [#408] added xubuntu artful 17.10 --- lib/Ravada.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Ravada.pm b/lib/Ravada.pm index b770163c0..bd747d95a 100644 --- a/lib/Ravada.pm +++ b/lib/Ravada.pm @@ -212,6 +212,16 @@ sub _update_isos { ,xml_volume => 'xenial64-volume.xml' ,sha256_url => 'http://fedora.mirrors.ovh.net/linux/releases/25/Workstation/x86_64/iso/Fedora-Workstation-25-.*-x86_64-CHECKSUM' } + ,xubuntu_artful => { + name => 'Xubuntu Artful Aardvark' + ,description => 'Xubuntu 17.10 Artful Aardvark 64 bits' + ,arch => 'amd64' + ,xml => 'yakkety64-amd64.xml' + ,xml_volume => 'yakkety64-volume.xml' + ,md5_url => 'http://archive.ubuntu.com/ubuntu/dists/artful/main/installer-amd64/current/images/MD5SUMS' + ,url => 'http://archive.ubuntu.com/ubuntu/dists/artful/main/installer-amd64/current/images/netboot/mini.iso' + ,rename_file => 'xubuntu_artful.iso' + } ,xubuntu_zesty => { name => 'Xubuntu Zesty Zapus' ,description => 'Xubuntu 17.04 Zesty Zapus 64 bits' From f67f6ae33d78bb65a4a926a3276661d16769963a Mon Sep 17 00:00:00 2001 From: fv3rdugo Date: Thu, 9 Nov 2017 18:36:01 +0100 Subject: [PATCH 4/5] [#408] Fix screenshot in 17.10 - Apply img-thumbnail class - Resize screenshot 250x188 - Fix create img in test. Problems with wayland --- lib/Ravada/Domain.pm | 2 +- lib/Ravada/Domain/KVM.pm | 28 ++++++++++++++-------------- lib/Ravada/Domain/Void.pm | 9 ++++----- templates/main/list_bases2.html.ep | 2 +- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/Ravada/Domain.pm b/lib/Ravada/Domain.pm index 199902b12..d59700e5f 100644 --- a/lib/Ravada/Domain.pm +++ b/lib/Ravada/Domain.pm @@ -909,7 +909,7 @@ sub _convert_png { my $self = shift; my ($file_in ,$file_out) = @_; - my $in = Image::Magick->new(); + my $in = Image::Magick->new(size=>'250x188'); my $err = $in->Read($file_in); confess $err if $err; diff --git a/lib/Ravada/Domain/KVM.pm b/lib/Ravada/Domain/KVM.pm index 1a88bb3fc..85895267f 100644 --- a/lib/Ravada/Domain/KVM.pm +++ b/lib/Ravada/Domain/KVM.pm @@ -858,6 +858,17 @@ Takes a screenshot, it stores it in file. =cut +sub handler { + my ($stream, $data, $n) = @_; + my $file_tmp = "/var/tmp/$$.tmp"; + + open my $out ,'>>',$file_tmp; + print $out $data; + close $out; + + return $n; +} + sub screenshot { my $self = shift; my $file = (shift or $self->_file_screenshot); @@ -869,24 +880,13 @@ sub screenshot { my $stream = $self->{_vm}->vm->new_stream(); my $mimetype = $self->domain->screenshot($stream,0); + $stream->recv_all(\&handler); - my $file_tmp = "$file.tmp"; - my $data; - my $bytes = 0; - open my $out, '>', $file_tmp or die "$! $file_tmp"; - while ( my $rv =$stream->recv($data,1024)) { - $bytes += $rv; - last if $rv<=0; - print $out $data; - } - close $out; + my $file_tmp = "/var/tmp/$$.tmp"; + $stream->finish; $self->_convert_png($file_tmp,$file); unlink $file_tmp or warn "$! removing $file_tmp"; - - $stream->finish; - - return $bytes; } sub _file_screenshot { diff --git a/lib/Ravada/Domain/Void.pm b/lib/Ravada/Domain/Void.pm index b13a1d78c..11263b88d 100644 --- a/lib/Ravada/Domain/Void.pm +++ b/lib/Ravada/Domain/Void.pm @@ -27,8 +27,8 @@ has '_ip' => ( our $DIR_TMP = "/var/tmp/rvd_void"; -our $IMPORT = `which import`; -chomp $IMPORT; +our $CONVERT = `which convert`; +chomp $CONVERT; #######################################3 sub BUILD { @@ -334,8 +334,7 @@ sub screenshot { my $self = shift; my $file = (shift or $self->_file_screenshot); - my @cmd =($IMPORT,'-window','root' - ,'-resize','400x300' + my @cmd =($CONVERT,'-size', '400x300', 'xc:white' ,$file ); my ($in,$out,$err); @@ -347,7 +346,7 @@ sub _file_screenshot { return $DIR_TMP."/".$self->name.".png"; } -sub can_screenshot { return $IMPORT; } +sub can_screenshot { return $CONVERT; } sub get_info { my $self = shift; diff --git a/templates/main/list_bases2.html.ep b/templates/main/list_bases2.html.ep index 4e60b920f..989d0b2e2 100644 --- a/templates/main/list_bases2.html.ep +++ b/templates/main/list_bases2.html.ep @@ -63,7 +63,7 @@ % } % if ($machine->{screenshot} ) { - + % }
From 1b802bc9329abbba09888f671aeca03ccc288137 Mon Sep 17 00:00:00 2001 From: Francesc Guasch Date: Fri, 10 Nov 2017 08:51:27 +0100 Subject: [PATCH 5/5] [#408] scale the screenshot --- lib/Ravada/Domain.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Ravada/Domain.pm b/lib/Ravada/Domain.pm index d59700e5f..1d52b1178 100644 --- a/lib/Ravada/Domain.pm +++ b/lib/Ravada/Domain.pm @@ -909,10 +909,11 @@ sub _convert_png { my $self = shift; my ($file_in ,$file_out) = @_; - my $in = Image::Magick->new(size=>'250x188'); + my $in = Image::Magick->new(); my $err = $in->Read($file_in); confess $err if $err; + $in->Scale(width => 250, height => 188); $in->Write("png24:$file_out"); chmod 0755,$file_out or die "$! chmod 0755 $file_out";