Re: [libvirt PATCH v5 30/32] qemu: implement knownHosts for ssh disks with nbdkit

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

 



On Tue, Feb 14, 2023 at 11:08:17 -0600, Jonathon Jongsma wrote:
> For ssh disks that are served by nbdkit, use the configured value for
> knownHosts and pass it to the nbdkit process.
> 
> Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
> ---
>  src/conf/domain_conf.c                                    | 8 ++++++++
>  src/conf/storage_source_conf.c                            | 1 +
>  src/conf/storage_source_conf.h                            | 2 ++
>  src/qemu/qemu_nbdkit.c                                    | 3 +++
>  tests/qemunbdkitdata/disk-network-ssh-password.args.disk0 | 3 ++-
>  tests/qemunbdkitdata/disk-network-ssh.args.disk0          | 3 ++-
>  tests/qemuxml2argvdata/disk-network-ssh-password.xml      | 1 +
>  tests/qemuxml2argvdata/disk-network-ssh.xml               | 1 +
>  8 files changed, 20 insertions(+), 2 deletions(-)

[...]

> @@ -22091,6 +22096,9 @@ virDomainDiskSourceFormatNetwork(virBuffer *attrBuf,
>  
>      if (src->timeout)
>          virBufferAsprintf(childBuf, "<timeout seconds='%llu'/>\n", src->timeout);
> +
> +    if (src->protocol == VIR_STORAGE_NET_PROTOCOL_SSH && src->ssh_known_hosts_file)
> +        virBufferAsprintf(childBuf, "<knownHosts path='%s'/>\n", src->ssh_known_hosts_file);

Any XML formatting of user-provided input strings must use
virBufferEscapeString to ensure that XML entities are escaped properly.

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>




[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]

  Powered by Linux