Comment 26 for bug 1847361

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

## Test ##

1. I have a qemu with the experimental patch applied
# dpkg -l qemu-system-x86
 1:4.2-3ubuntu2~ppa3

2. prep disk xml to load curl.so
# cat > curldisk.xml << EOF
  <disk type='network' device='disk'>
    <driver name='qemu' type='raw'/>
    <source protocol="http" name="ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso">
            <host name="archive.ubuntu.com" port="80"/>
    </source>
    <target dev='vdc' bus='virtio'/>
    <readonly/>
  </disk>
EOF

3. check not being loaded
# lsof -p $(pidof qemu-system-x86_64) | grep block
<nothing>

4. load curl.so
# virsh attach-device focal2 curldisk.xml

5. check to be loaded now
# lsof -p $(pidof qemu-system-x86_64) | grep block
qemu-syst 19837 libvirt-qemu mem REG 0,83 34408 386797 /usr/lib/x86_64-linux-gnu/qemu/block-curl.so

1-5 above worked well as-is and my debug code spew out in the log:
DEBUG: trying to load module: /usr/lib/x86_64-linux-gnu/qemu/block-curl.so

Ok, lets do the same again but remove the qemu-system-block-extra package to have the .so only in /var/run.

The qemu version in the binary matches:
# qemu-system-x86_64 --version
QEMU emulator version 4.2.0 (Debian 1:4.2-3ubuntu2~ppa3)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

The files matched (but the /usr/lib path is removed before the experiment:
root@f:~# md5sum /var/run/qemu/1_4_2-3ubuntu2~ppa3/*curl* /usr/lib/x86_64-linux-gnu/qemu/*curl*
3d00fe34bddac3caeec9a4be91d84bae /var/run/qemu/1_4_2-3ubuntu2~ppa3/block-curl.so
3d00fe34bddac3caeec9a4be91d84bae /usr/lib/x86_64-linux-gnu/qemu/orig.block-curl.so.orig

Nothing loaded in advance:
# lsof -p $(pidof qemu-system-x86_64) | grep block
<empty>

Uh there is some serious wrong replacement happening :-)
DEBUG: trying to load module: /usr/lib/x86_64-linux-gnu/qemu/block-curl.so
DEBUG: trying to load module: /usr/bin/../block-curl.so
DEBUG: trying to load module: /usr/bin/block-curl.so
DEBUG: trying to load module: /var/run/qemu/________:_._______________/block-curl.so

So this
Debian 1:4.2-3ubuntu2~ppa3
became
________:_._______________
That replaced the inverse of what I wanted!
Was that function using an allowed set ... ?