[Libguestfs] [PATCH v2v] -o rhv-upload: Give a nicer error if the storage domain

Richard W.M. Jones rjones at redhat.com
Thu Jan 26 12:31:06 UTC 2023


https://bugzilla.redhat.com/show_bug.cgi?id=1986386

My RHV instance is dead at the moment so I didn't do much more than
check this compiles and passes the one test we have.  Also I want to
spend as little time as possible on RHV outputs for virt-v2v since the
RHV product will be discontinued soon.

I did want to point out some things:

 - The preceeding code is probably wrong.
   https://github.com/libguestfs/virt-v2v/blob/master/output/rhv-upload-transfer.py#L70

   It attempts to search for the output storage using:

    storage_domains = system_service.storage_domains_service().list(
        search='name=%s' % params['output_storage'],
        case_sensitive=True,
    )

   I couldn't find any documentation about what can go into that
   search string, but it's clearly a lot more complicated than just
   pasting in the literal name after "name=".  At the very least,
   spaces are not permitted, see:
   https://github.com/libguestfs/virt-v2v/blob/master/output/rhv-upload-transfer.py#L70

 - The bug reporter used "data*" as the name and I suspect that is
   parsed in some way (wildcard? regexp? I've no idea).

 - Probably for the same reason, the preceeding code ought to fail
   with an error if the output storage domain doesn't exist.  The fact
   we reach the code patched here at all also indicates some bug,
   maybe in the search string.

As I say above, I don't especially care about any of this.

Rich.





More information about the Libguestfs mailing list