X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=v3_config_guest.pl;h=04180a67d6091d6f869046bf7bfa86c49204f645;hp=28fb36acb48bf6ee2639f0e31ce4303357ab6901;hb=5ef0e92d52b2698fd2706cd7cfc2b01526a6e319;hpb=e3102a252f2e92de3275bdcf2af96beb85c693e4 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";