Re: [libvirt] question about qemudDomainMigratePrepare2 of qemu_driver.c from libvirt-0.6.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 31, 2009 at 10:07:31AM +0200, Gerrit.Slomma@xxxxxxxxxxx wrote:
> Hello
> 
> I am just curious if the checking of the connection string in qemu_driver.c
> from libvirt-0.6.1 in qemudDomainMigratePrepare2 is faulty.
> The source is:
> 
> [...]
>     } else {
>         /* Check the URI starts with "tcp:".  We will escape the
>          * URI when passing it to the qemu monitor, so bad
>          * characters in hostname part don't matter.
>          */
>         if (!STREQLEN (uri_in, "tcp:", 6)) {
>             qemudReportError (dconn, NULL, NULL, VIR_ERR_INVALID_ARG,
>                   "%s", _("only tcp URIs are supported for KVM
> migrations"));
>             goto cleanup;
>         }
> [...]
> 
> The second compare-string "tcp:" is only 4 characters long, therefore a
> check via strncmp must fail i presumed, i isolated this comparison:

Can you try with this patch applied

diff -r b5ad7b1c453b src/qemu_driver.c
--- a/src/qemu_driver.c	Tue Mar 31 14:55:23 2009 +0100
+++ b/src/qemu_driver.c	Tue Mar 31 15:02:30 2009 +0100
@@ -4629,7 +4629,7 @@ qemudDomainMigratePrepare2 (virConnectPt
          * URI when passing it to the qemu monitor, so bad
          * characters in hostname part don't matter.
          */
-        if (!STREQLEN (uri_in, "tcp:", 6)) {
+        if (!STRPREFIX (uri_in, "tcp:")) {
             qemudReportError (dconn, NULL, NULL, VIR_ERR_INVALID_ARG,
                   "%s", _("only tcp URIs are supported for KVM migrations"));
             goto cleanup;



Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]