Ravada::Domain::KVM - Online Linux Manual PageSection : 3
Updated : 2021-03-05
Source : perl v5.32.1
Note : User Contributed Perl Documentation

NAMERavada::Domain::KVM − KVM Virtual Machines library for Ravada

nameReturns the name of the domain

list_disksReturns a list of the disks used by the virtual machine. CDRoms are not included ​ my@ disks = $domain−>list_disks();

remove_disksRemove the volume files of the domain

pre_remove_domainCleanup operations executed before removing this domain ​ $self−>pre_remove_domain

removeRemoves this domain. It removes also the disk drives and base images.

disk_deviceReturns the file name of the disk of the domain. ​ my $file_name = $domain−>disk_device();

pre_prepare_baseRun this before preparing the base. It is necessary to correctly detect disks drivers for newer libvirts. This is executed automatically so it shouldn't been called.

post_prepare_baseTask to run after preparing a base virtual machine

get_xml_baseReturns the XML definition for the base, only if prepare_base has been run befor

display_infoReturns the display information as a hashref. The display URI is in the display entry

is_activeReturns whether the domain is running or not

is_persistentReturns wether the domain has a persistent configuration file

startStarts the domain

shutdownStops the domain

shutdown_nowShuts down uncleanly the domain

force_shutdownShuts down uncleanly the domain

pausePauses the domain

resumeResumes a paused the domain

is_hibernatedReturns if the domain has a managed saved state.

is_pausedReturns if the domain is paused

can_hybernateReturns true(1) for KVM domains

can_hybernateReturns true(1) for KVM domains

hybernateTake a snapshot of the domain's state and save the information to a managed save location. The domain will be automatically restored with this state when it is next started. ​ $domain−>hybernate();

hybernateTake a snapshot of the domain's state and save the information to a managed save location. The domain will be automatically restored with this state when it is next started. ​ $domain−>hybernate();

add_volumeAdds a new volume to the domain ​ $domain−>add_volume(name => $name, size => $size); ​ $domain−>add_volume(name => $name, size => $size, xml => 'definition.xml'); ​ ​ $domain−>add_volume(path => "/var/lib/libvirt/images/path.img");

list_volumesReturns a list of the disk volumes. Each element of the list is a string with the filename. For KVM it reads from the XML definition of the domain. ​ my @volumes = $domain−>list_volumes();

list_volumes_infoReturns a list of the disk volumes. Each element of the list is a string with the filename. For KVM it reads from the XML definition of the domain. ​ my @volumes = $domain−>list_volumes_info();

screenshotTakes a screenshot, it stores it in file.

can_screenshotReturns if a screenshot of this domain can be taken.

storage_refreshRefreshes the internal storage. Used after removing files such as base images.

get_infoThis is taken directly from Sys::Virt::Domain. Returns a hash reference summarising the execution state of the domain. The elements of the hash are as follows: maxMem The maximum memory allowed for this domain, in kilobytes memory The current memory allocated to the domain in kilobytes cpu_time The amount of CPU time used by the domain n_virt_cpu The current number of virtual CPUs enabled in the domain state The execution state of the machine, which will be one of the constants &Sys::Virt::Domain::STATE_*.

set_max_memSet the maximum memory for the domain

get_max_memGet the maximum memory for the domain

set_memorySets the current available memory for the domain

renameRenames the domain ​ $domain−>rename("new name");

disk_sizeReturns the size of the domains disk or disks If an array is expected, it returns the list of disks sizes, if it expects an scalar returns the first disk as it is asumed to be the main one. ​ my $size = $domain−>disk_size(); sub _find_base {
    my $self = shift;
    my
$file = shift;
​ my @cmd = ( 'qemu−img','info',$file); ​ my ($in,$out, $err); ​ run3(\@cmd,\$in, \$out, \$err); ​ ​ my ($base) = $out =~ m{^backing file: (.*)}mi; ​ warn "No base for $file in $out" if !$base; ​ ​ return $base; ​}

clean_swap_volumesClean swap volumes. It actually just creates an empty qcow file from the base sub clean_swap_volumes {
    my $self = shift;
    return if !$self−>is_local;
    for my
$file ($self−>list_volumes) {
        next if !$file ||
$file !~ /\.SWAP\.\w+/;
        next if ! −e
$file;
        my
$base = $self>_find_base($file) or next;
​ my @cmd = ('qemu−img','create' ​ ,'−f','qcow2' ​ ,'−b',$base ​ ,$file ​ ); ​ my ($in,$out, $err); ​ run3(\@cmd,\$in, \$out, \$err); ​ die $err if $err; ​ }}

set_driverSets the value of a driver Argument: name , driver ​ my $driver = $domain−>set_driver('video','"type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"');

pre_removeCode to run before removing the domain. It can be implemented in each domain. It is not expected to run by itself, the remove function calls it before proceeding. In KVM it removes saved images. ​ $domain−>pre_remove(); # This isn't likely to be necessary ​ $domain−>remove(); # Automatically calls the domain pre_remove method
0
Johanes Gumabo
Data Size   :   25,143 byte
man-Ravada::Domain::KVM.3pmBuild   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 257,417
Visitor ID   :     :  
Visitor IP   :   3.145.202.60   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|252|Ravada::Domain::KVM.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Ravada::Domain::KVM.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|252|Ravada::Domain::KVM.3pm|43|br══─}─══|'br══─}─══ )         (htmlprn|149|Ravada::Domain::KVM.3pm|43|'br══─}─══ |'br══─}─══ )