[Libguestfs] virt-customize

Richard W.M. Jones rjones at redhat.com
Fri Feb 18 19:00:39 UTC 2022


On Fri, Feb 18, 2022 at 07:01:22PM +0100, Lukáš Doktor wrote:
> Hello Rich,
> 
> by any chance do you know whether it's possible to escape ':' in "virt-customize" command? I'm trying to upload a file:
> 
>     --upload '/etc/yum.repos.d/_copr\:copr.devel.redhat.com\:ndokos\:pbench.repo:/etc/yum.repos.d/'
> 
> tried various combinations of doubling the ':' or escaping them and so on, but it always considers the first ':' as splitter.

It's not possible because the function always splits on the first ':'...

https://github.com/libguestfs/libguestfs-common/blob/41126802097f0a864cab8679ae8672b45914d54b/mlcustomize/customize_cmdline.ml#L139

... but there's several workarounds.

* Make a local copy of the file; you can still give the full name when
  you upload:

$ cp /etc/yum.repos.d/_copr:copr.devel.redhat.com:ndokos:pbench.repo tmp.repo

$ virt-customize .. --upload tmp.repo:/etc/yum.repos.d/full:name:including:colons.repo

* If the file is small, --write + --move.

* Use --copy-in (if you can copy the whole directory).

* Use guestfish or the API.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list