[libvirt] Migration issue php-libvirt

Michal Novotny minovotn at redhat.com
Thu Oct 17 12:52:07 UTC 2013


Hi,
the interesting thing is that you use constructor as
$conn = new Libvirt('connection-uri');

You should be using libvirt_connect() API instead. See [1] for example.

Not all of the defines are defined in the libvirt-php scope, that is
correct and patches are welcome :-)

Thanks,
Michal

[1]
http://libvirt.org/git/?p=libvirt-php.git;a=blob;f=tests/test-domain-create.phpt;h=1bcccb8871fd908a0cb90cba9a390fb9e87a97f4;hb=HEAD

On 10/17/2013 11:45 AM, Claudio Bley wrote:
> [Repeat: please, don't top post on technical lists.]
>
> At Thu, 17 Oct 2013 14:26:33 +0500,
> Umar Draz wrote:
>> Here is the php_error_logs
>> --------------------------
>> *[17-Oct-2013 05:17:42 America/New_York] PHP Notice:  Use of undefined
>> constant VIR_MIGRATE_UNSAFE - assumed 'VIR_MIGRATE_UNSAFE' in
>> /home/www/virtspace/inc/mig.php on line 21*
>> *[17-Oct-2013 05:17:42 America/New_York] PHP Notice:  Use of undefined
>> constant VIR_MIGRATE_OFFLINE - assumed 'VIR_MIGRATE_OFFLINE' in
>> /home/www/virtspace/inc/mig.php on line 21*
>>
>> According to above php_notices, both VIR_OFFLINE AND VIR_UNSAFE options are
>> not available.
> Indeed, looking at the libvirt-php code
> (http://libvirt.org/git/?p=libvirt-php.git;a=blob;f=src/libvirt-php.c;h=a149662272016e946d53f4589722d090ceccdbcf;hb=HEAD),
> these constants are not defined yet. The wrapper is lacking the
> following constants, which you can easily define yourself in your PHP
> script:
>
> VIR_MIGRATE_CHANGE_PROTECTION	 =	256	
> VIR_MIGRATE_UNSAFE	 =	512	
> VIR_MIGRATE_OFFLINE	 =	1024	
> VIR_MIGRATE_COMPRESSED	 =     2048
>
>
> Claudio

-- 
Michal Novotny <minovotn at redhat.com>, RHCE, Red Hat
Virtualization | libvirt-php bindings | php-virt-control.org




More information about the libvir-list mailing list