--- .../functions/libvirt-domain-get-job-info.xml | 1 + .../functions/libvirt-domain-migrate-to-uri.xml | 5 +- .../functions/libvirt-domain-migrate-to-uri2.xml | 134 +++++++++++++++++++++ .../libvirt/functions/libvirt-domain-migrate.xml | 3 +- doc/source/libvirt/versions.xml | 1 + 5 files changed, 141 insertions(+), 3 deletions(-) create mode 100644 doc/source/libvirt/functions/libvirt-domain-migrate-to-uri2.xml diff --git a/doc/source/libvirt/functions/libvirt-domain-get-job-info.xml b/doc/source/libvirt/functions/libvirt-domain-get-job-info.xml index e39694c..d5ff320 100644 --- a/doc/source/libvirt/functions/libvirt-domain-get-job-info.xml +++ b/doc/source/libvirt/functions/libvirt-domain-get-job-info.xml @@ -117,6 +117,7 @@ Array <para> <simplelist> <member><function>libvirt_domain_migrate</function></member> + <member><function>libvirt_domain_migrate_to_uri2</function></member> <member><function>libvirt_domain_migrate_to_uri</function></member> </simplelist> </para> diff --git a/doc/source/libvirt/functions/libvirt-domain-migrate-to-uri.xml b/doc/source/libvirt/functions/libvirt-domain-migrate-to-uri.xml index 752f965..2e6bf27 100644 --- a/doc/source/libvirt/functions/libvirt-domain-migrate-to-uri.xml +++ b/doc/source/libvirt/functions/libvirt-domain-migrate-to-uri.xml @@ -13,13 +13,13 @@ <type>bool</type><methodname>libvirt_domain_migrate_to_uri</methodname> <methodparam ><type>resource</type><parameter>domain</parameter></methodparam> <methodparam ><type>string</type><parameter>duri</parameter></methodparam> - <methodparam ><type>int</type><parameter>flags</parameter></methodparam> + <methodparam ><type>integer</type><parameter>flags</parameter></methodparam> <methodparam ><type>string</type><parameter>dname</parameter></methodparam> <methodparam ><type>string</type><parameter>uri</parameter></methodparam> <methodparam ><type>integer</type><parameter>bandwith</parameter></methodparam> </methodsynopsis> <para> - Performs migration of the domain from one host to another. For description of parameters and flags see <link xlink:href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToUri">original documentation</link>. + Performs migration of the domain from one host to another. For description of parameters and flags see <link xlink:href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI">original documentation</link>. </para> <para> Please note that the function returns after the migration is complete. It may take a lot of time to migrate a host. Be sure to configure PHP maximum execution time. @@ -81,6 +81,7 @@ &reftitle.seealso; <para> <simplelist> + <member><function>libvirt_domain_migrate_to_uri2</function></member> <member><function>libvirt_domain_migrate</function></member> <member><function>libvirt_domain_get_job_info</function></member> </simplelist> diff --git a/doc/source/libvirt/functions/libvirt-domain-migrate-to-uri2.xml b/doc/source/libvirt/functions/libvirt-domain-migrate-to-uri2.xml new file mode 100644 index 0000000..0cbb414 --- /dev/null +++ b/doc/source/libvirt/functions/libvirt-domain-migrate-to-uri2.xml @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.28 $ --> + +<refentry xml:id="function.libvirt-domain-migrate-to-uri" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refnamediv> + <refname>libvirt_domain_migrate_to_uri</refname> + <refpurpose>Migrate the domain object from its current host to the destination host defined by URI</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>libvirt_domain_migrate_to_uri</methodname> + <methodparam ><type>resource</type><parameter>domain</parameter></methodparam> + <methodparam ><type>string</type><parameter>dconnuri</parameter></methodparam> + <methodparam ><type>string</type><parameter>miguri</parameter></methodparam> + <methodparam ><type>string</type><parameter>dxml</parameter></methodparam> + <methodparam ><type>integer</type><parameter>flags</parameter></methodparam> + <methodparam ><type>string</type><parameter>dname</parameter></methodparam> + <methodparam ><type>string</type><parameter>uri</parameter></methodparam> + <methodparam ><type>integer</type><parameter>bandwith</parameter></methodparam> + </methodsynopsis> + <para> + Performs migration of the domain from one host to another. For description of parameters and flags see <link xlink:href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI2">original documentation</link>. + </para> + <para> + Please note that the function returns after the migration is complete. It may take a lot of time to migrate a host. Be sure to configure PHP maximum execution time. + </para> + + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <!-- See also &return.success; --> + <para> + &true; on success and &false; on failure. + </para> + </refsect1> + +<refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>libvirt_domain_migrate_to_uri2</function> example</title> + <para> + Live migrate domain (f13_exper) to another node + </para> + <programlisting role="php"> +<![CDATA[ +<?php + echo ("Looking up f13_exper domain\n"); + $domain=@libvirt_domain_lookup_by_name($conn,"f13_exper"); + if ($domain==false) + { + echo ("Domain not found\n"); + echo ("Libvirt last error: ".libvirt_get_last_error()."\n"); + exit; + } + echo ("Domain found\n"); + + $xmllibvirt=libvirt_domain_get_xml_desc($domain, NULL); + $spicePort=5900; + $xml=''; + $pos1=strpos($xmllibvirt,'<graphics'); + if (false!==$pos1) + { + $pos2=strpos($xmllibvirt,"</graphics>",$pos1+1); + if (false!==$pos2) + { + $pos3=($xmllibvirt,"port='",$pos1+1); + if (false!==$pos3 && $pos3<$pos2) { + $start=$pos3+6; + $end=($xmllibvirt,"'",$start); + if (false!==$end) { + $xml=substr_replace($xmllibvirt,$spicePort,$start,$end-$start); + } + } + } + } + $flags=$VIR_MIGRATE_LIVE | $VIR_MIGRATE_UNDEFINE_SOURCE | $VIR_MIGRATE_PEER2PEER | $VIR_MIGRATE_TUNNELLED | $VIR_MIGRATE_PERSIST_DEST | $VIR_MIGRATE_UNSAFE; + + echo ("Migrating domain to $miguri\n"); + $rv=libvirt_domain_migrate_to_uri2($domain,$miguri,null,$xml,$flags); + if ($rv==false) + { + echo ("Failure!"); + echo ("Libvirt last error: ".libvirt_get_last_error()."\n"); + } + else + { + echo ("Success\n"); + } +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>libvirt_domain_migrate_to_uri</function></member> + <member><function>libvirt_domain_migrate</function></member> + <member><function>libvirt_domain_get_job_info</function></member> + </simplelist> + </para> + </refsect1> + +</refentry> + +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +indent-tabs-mode:nil +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> diff --git a/doc/source/libvirt/functions/libvirt-domain-migrate.xml b/doc/source/libvirt/functions/libvirt-domain-migrate.xml index 862a6e9..11170cb 100644 --- a/doc/source/libvirt/functions/libvirt-domain-migrate.xml +++ b/doc/source/libvirt/functions/libvirt-domain-migrate.xml @@ -13,7 +13,7 @@ <type>resource</type><methodname>libvirt_domain_migrate</methodname> <methodparam ><type>resource</type><parameter>domain</parameter></methodparam> <methodparam ><type>resource</type><parameter>dconn</parameter></methodparam> - <methodparam ><type>int</type><parameter>flags</parameter></methodparam> + <methodparam ><type>integer</type><parameter>flags</parameter></methodparam> <methodparam ><type>string</type><parameter>dname</parameter></methodparam> <methodparam ><type>string</type><parameter>uri</parameter></methodparam> <methodparam ><type>integer</type><parameter>bandwith</parameter></methodparam> @@ -91,6 +91,7 @@ &reftitle.seealso; <para> <simplelist> + <member><function>libvirt_domain_migrate_to_uri2</function></member> <member><function>libvirt_domain_migrate_to_uri</function></member> <member><function>libvirt_domain_get_job_info</function></member> </simplelist> diff --git a/doc/source/libvirt/versions.xml b/doc/source/libvirt/versions.xml index adc01a4..5a00c39 100644 --- a/doc/source/libvirt/versions.xml +++ b/doc/source/libvirt/versions.xml @@ -42,6 +42,7 @@ Example entries: <function name='libvirt_domain_memory_peek' from='php-libvirt 0.1'/> <function name='libvirt_domain_memory_stats' from='php-libvirt 0.3'/> <function name='libvirt_domain_migrate' from='php-libvirt 0.4'/> + <function name='libvirt_domain_migrate_to_uri2' from='php-libvirt 0.4.8'/> <function name='libvirt_domain_migrate_to_uri' from='php-libvirt 0.4'/> <function name='libvirt_domain_get_job_info' from='php-libvirt 0.4'/> <function name='libvirt_domain_block_stats' from='php-libvirt 0.3'/> -- 1.7.12.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list