Subject: | migrate doesn't work - doesn't pass NULLs (with fix) |
Trying to use $dom->migrate to move a domain consistently returns:
Use of uninitialized value in concatenation (.) or string at
/usr/local/lib/perl/5.10.0/Sys/Virt/Error.pm line 54.
Use of uninitialized value in pattern match (m//) at
/usr/local/lib/perl/5.10.0/Sys/Virt/Error.pm line 54.
libvirt error code: 0, message:
This is because the "dname" and "uri" parameters are being passed from
Perl as an empty string, even if they are undef. However, the C API
requires these parameters to be passed as NULLs, not empty strings.
Perhaps you need something like
if (!strlen(dname)) dname = NULL;
if (!strlen(uri)) uri = NULL;
before the call to virDomainMigrate; I made this change locally and now
it works for me.