[libvirt PATCH v3 09/18] qemu: add functions to start and stop nbdkit

Richard W.M. Jones rjones at redhat.com
Fri Dec 9 20:20:16 UTC 2022


On Fri, Dec 09, 2022 at 06:23:59PM +0000, Richard W.M. Jones wrote:
> $ guestfish --format=raw -a ssh://foo/var/tmp/fedora-36.img -i -vx
> 
> ...
> 
>     <disk device="disk" type="network">
>       <source protocol="ssh" name="/var/tmp/fedora-36.img">
>         <host name="foo"/>
>       </source>
>       <target dev="sda" bus="scsi"/>
>       <driver name="qemu" type="raw" cache="writeback"/>
>       <address type="drive" controller="0" bus="0" target="0" unit="0"/>
>     </disk>

Actually I remembered in the "read-only"[1] case we do create a qcow2
overlay:

$ guestfish --ro --format=raw -a ssh://foo/var/tmp/fedora-36.img -i 

...

libguestfs: trace: disk_create "/tmp/libguestfszdXqqC/overlay1.qcow2" "qcow2" -1 "backingfile:ssh://foo/var/tmp/fedora-36.img" "backingformat:raw"
libguestfs: command: run: qemu-img
libguestfs: command: run: \ create
libguestfs: command: run: \ -f qcow2
libguestfs: command: run: \ -o backing_file=ssh://foo/var/tmp/fedora-36.img,backing_fmt=raw
libguestfs: command: run: \ /tmp/libguestfszdXqqC/overlay1.qcow2
Formatting '/tmp/libguestfszdXqqC/overlay1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=6442450944 backing_file=ssh://foo/var/tmp/fedora-36.img backing_fmt=raw lazy_refcounts=off refcount_bits=16

...

    <disk device="disk" type="file">
      <source file="/tmp/libguestfszdXqqC/overlay1.qcow2"/>
      <target dev="sda" bus="scsi"/>
      <driver name="qemu" type="qcow2" cache="unsafe"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>

which might be what you were thinking about.  Actually this doesn't
work either:

Original error from libvirt: internal error: process exited while connecting to monitor: 2022-12-09T20:17:41.074400Z qemu-kvm: -blockdev {"driver":"ssh","path":"var/tmp/fedora-36.img","server":{"host":"foo","port":"22"},"node-name":"libvirt-4-storage","cache":{"direct":false,"no-flush":true},"auto-read-only":true,"discard":"unmap"}: failed to authenticate using publickey authentication and the identities held by your ssh-agent [code=1 int1=-1]

Rich.

[1] Not really "read-only" - we must create a r/w overlay because
otherwise replaying journals in filesystems does not work.  The
overlay is discarded afterwards.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org


More information about the libvir-list mailing list