BTW I am unable to reproduce this with upstream libguestfs. WhichOn Mon, Nov 25, 2013 at 09:58:50PM +0000, Richard W.M. Jones wrote:
> On Mon, Nov 25, 2013 at 12:52:21PM -0700, Jon wrote:
> > Hello,
> >
> > I'm having trouble connecting to rbd images. It seems like somewhere the
> > name is getting chewed up. I wonder if this is related to my previous
> > troubles [1] [2] with rbd images.
> >
> > I'm trying to add an rbd image, but when I launch the guestfs object I get
> > an error:
> >
> > >> libguestfs: trace: launch = -1 (error)
> >
> > I'm adding a single RBD
> > >> libguestfs: trace: add_drive "libvirt-pool/build_vm_test-os"
> > "format:raw" "protocol:rbd" "server:192.168.0.35:6789 192.168.0.2:6789
> > 192.168.0.40:6789"
> >
> > But it seems like the name is getting chewed up in the call to kvm:
> >
> > >> -drive
> > file=rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none,cache=writeback,format=raw,id=hd0,if=none
> > >> disk image
> > rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none:
> > Invalid argument
> >
> > I am able to add non rbd images without an issue.
> >
> > Any thoughts?
>
> As a general comment, there should be no difference between the API
> from C and the API from Perl. Of course, occasionally we introduce
> Perl-specific bugs in the bindings, but these are rarer than you would
> think (the Perl bindings are automatically generated, so any bugs
> would be systematic, affecting many different calls at once).
>
> [...]
> > [1] https://bugzilla.redhat.com/show_bug.cgi?id=1026688
> > [2] https://www.redhat.com/archives/libguestfs/2013-November/msg00003.html
> >
> > Full Debug Output:
> >
> > libguestfs: trace: set_verbose true
> > libguestfs: trace: set_verbose = 0
> > libguestfs: create: flags = 0, handle = 0x2e74d90, program = perl
> > libguestfs: trace: set_trace true
> > libguestfs: trace: set_trace = 0
> > libguestfs: trace: add_drive "libvirt-pool/build_vm_test-os" "format:raw"
> > "protocol:rbd" "server:192.168.0.35:6789 192.168.0.2:6789 192.168.0.40:6789"
> > libguestfs: trace: add_drive = 0
> > libguestfs: trace: launch
> > libguestfs: trace: get_tmpdir
> > libguestfs: trace: get_tmpdir = "/tmp"
> > libguestfs: trace: get_backend
> > libguestfs: trace: get_backend = "direct"
> [...]
> > -drive
> > file=rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none,cache=writeback,format=raw,id=hd0,if=none
>
> In this case the export name is getting truncated ...
>
> With the direct backend, the following code is responsible for
> constructing the -drive parameter:
>
> https://github.com/libguestfs/libguestfs/blob/master/src/drives.c#L1307
>
> There seems to be something pretty strange going on with the
> u.exportname field. I can't quite understand it at the moment, but it
> is certainly a bug.
version are you using?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org