[Libguestfs] [PATCH v2] lib/info: Remove /dev/fd hacking and pass a true filename to qemu-img info.

Pino Toscano ptoscano at redhat.com
Fri Jan 12 14:32:31 UTC 2018


On Friday, 15 December 2017 09:26:29 CET Richard W.M. Jones wrote:
> It obscures what's really going on and is no longer necessary
> for the original purpose.
> 
> This reverts commit d50cb7bbb4cc18f69ea1425e9f5cee9685825f95.
> 
> See also:
> 
>   https://www.redhat.com/archives/libguestfs/2017-November/thread.html#00226
>   https://www.redhat.com/archives/libguestfs/2017-December/thread.html#00044
> ---

Mostly LGTM -- a couple of notes below.

> -  guestfs_int_cmd_clear_close_files (cmd);

Don't we want this regardless?

> +  if (filename[0] == '/')
> +    guestfs_int_cmd_add_arg (cmd, filename);
> +  else {
> +    rel_filename = safe_asprintf (g, "./%s", filename);
> +    guestfs_int_cmd_add_arg (cmd, rel_filename);

There's guestfs_int_cmd_add_arg_format, so that can be used to avoid
the temporary string.

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20180112/0bdfb19c/attachment.sig>


More information about the Libguestfs mailing list