Comment 7 for bug 2002771

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

Yes, please repro on Fedora and anywhere on upstream libvirt git.
Just to make sure we haven't missed a delta that interacts unexpectedly.
After that yes, please report upstream before you debug even further.
They might already know something and shortcut your work, you can go back to debugging if they are not at all aware as well.

Note: Not exactly the same case, but in a very similar area.
I've found that using block devs changes back the group, wrong.
Once we have - any kind - of fix for this here we need to try that again and check if it is fixed by the same or a different issue.

$ qemu-img create -f qcow2 /tmp/test.qcow2 100M
Formatting '/tmp/test.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=104857600 lazy_refcounts=off refcount_bits=16
$ sudo modprobe nbd max_part=16
$ sudo qemu-nbd --connect=/dev/nbd0 /tmp/test.qcow2
$ sudo sgdisk -n 0:0:0 /dev/nbd0
Creating new GPT entries in memory.
The operation has completed successfully
$ ll /dev/nbd0
brw-rw---- 1 root disk 43, 0 Jul 12 05:55 /dev/nbd0
$ cat > testdisk.xml << EOF
> <disk type='block' device='disk'>
> <driver name='qemu' type='raw' cache='none'/>
> <source dev='/dev/nbd0'/>
> <target dev='vdc' bus='virtio'/>
> </disk>
> EOF
$ virsh attach-device j testdisk.xml
Device attached successfully
$ virsh detach-device j testdisk.xml
$ ll /dev/nbd0
brw-rw---- 1 root root 43, 0 Jul 12 06:36 /dev/nbd0

=> So it restored the user (interestingly in both hotplug and static config!!) but it restored the group badly (kvm->root instead of kvm->disk).