X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=v3_config_guest.pl;h=04180a67d6091d6f869046bf7bfa86c49204f645;hb=ce0f119828348c3c57a00c4aa268a8a223ccd7f8;hp=28fb36acb48bf6ee2639f0e31ce4303357ab6901;hpb=41d8acf598ba74a939848619d0a1490579bc0fe8;p=palacios.git diff --git a/v3_config_guest.pl b/v3_config_guest.pl index 28fb36a..04180a6 100755 --- a/v3_config_guest.pl +++ b/v3_config_guest.pl @@ -83,6 +83,7 @@ if ($config{numcores}>1) { } } +do_swapping(\%config, $pdir); print "We will give your guest the default performance tuning characteristics\n"; $config{perftune_block} .= <\n\n"; print $target file_setup(\%config), "\n"; print $target memory_setup(\%config), "\n"; +print $target swapping_setup(\%config), "\n"; print $target paging_setup(\%config), "\n"; print $target memmap_setup(\%config), "\n"; print $target numa_setup(\%config), "\n"; @@ -403,6 +405,28 @@ sub get_numa_data() { return %numa; } + +sub do_swapping { + my ($cr, $pdir) = @_; + + my $canswap = is_palacios_core_feature_enabled($pdir,"V3_CONFIG_SWAPPING"); + my $mem = $cr->{mem}; + + if ($canswap) { + #Config for swapping + $cr->{swapping} = yn_question("Do you want to use swapping?", "n", "y", "n"); + + if ($cr->{swapping} eq "y") { + $cr->{swap_alloc} = quant_question("How much memory do you want to allocate [MB] ?", $mem/2); + print "We will use the default swapping strategy.\n"; + $cr->{swap_strat} = "default"; + print "What file do you want to swap to? [./swap.bin] "; + $cr->{swap_file} = get_user("./swap.bin"); + } + } + +} + sub do_device { my ($cr,$pdir,$feature, $class, $id, $hardfail, $optblob, $nestblob) =@_; @@ -984,6 +1008,14 @@ sub extensions_setup { return $s; } +sub swapping_setup { + my $cr=shift; + if (defined($cr->{swapping}) && $cr->{swapping} eq "y") { + return " \n ".$cr->{swap_alloc}."\n ".$cr->{swap_file}."\n ".$cr->{swap_strat}."\n \n"; + } else { + return " \n"; + } +} sub telemetry_setup { my $cr=shift; return " ".$cr->{telemetry}."\n";