Libvirt Functions
PHP Manual

libvirt_domain_get_job_info

(php-libvirt 0.4)

libvirt_domain_get_job_infoExtract information about progress of a background job on a domain. Will return an error if the domain is not active.

Description

array libvirt_domain_get_job_info ( resource $domain )

Extract information about progress of a background job on a domain. Will return an error if the domain is not active. For exact description of returned values see » original documentation.

Note: Libvirt version
. This function has been added to Libvirt in version 0.7.7. You need this or newer version of Libvirt to be able to use this function..

Note: Warning
. This function returns values that may be bigger than 32bit integer limit. Please read this note for more details.

Parameters

domain

Domain resource of domain to get job information of

Return Values

Associative array on success and FALSE on failure.

Examples

Example #1 libvirt_domain_get_job_info() example

Get info about live migration of domain.

<?php
    $dom
=@libvirt_domain_lookup_by_name($conn,"f13_exper");
    if (
$dom==false)
    {
       echo (
"Domain not found\n");
       echo (
"Libvirt last error: ".libvirt_get_last_error()."\n");
       exit;
    }
    echo (
"Domain found\n");
    echo (
"Getting job info for the domain\n");
    
$info=libvirt_domain_get_job_info($dom);

?>

The above example will output something similar to:

Domain found
Getting job info for the domain
Array
(
    [type] => 2
    [time_elapsed] => 24036
    [time_remaining] => 0
    [data_total] => 554041344
    [data_processed] => 244097024
    [data_remaining] => 313507840
    [mem_total] => 554041344
    [mem_processed] => 244097024
    [mem_remaining] => 313507840
    [file_total] => 0
    [file_processed] => 0
    [file_remaining] => 0
)

See Also


Libvirt Functions
PHP Manual