<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 16, 2019 at 1:04 AM Cole Robinson <<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/15/19 3:56 AM, Han Han wrote:<br>
> Hello Cole, one issue is found:<br>
> The qcow2 data file XTTRs is not cleaned on external snapshot when<br>
> -blockdev is not enabled<br>
> <br>
> Versions:<br>
> libvirt v5.8.0-134-g9d03e9adf1<br>
> qemu-kvm-4.1.0-13.module+el8.1.0+4313+ef76ec61.x86_64<br>
> <br>
> Steps:<br>
> 1. Convert a OS image to qcow2&qcow2 data file:<br>
> # qemu-img convert -O qcow2 -o<br>
> data_file=/var/lib/libvirt/images/pc-data.raw,data_file_raw=on<br>
> /var/lib/libvirt/images/pc.qcow2 /var/lib/libvirt/images/pc-data.qcow2<br>
> <br>
> 2. Build and start libvirt source, start libvirt daemon:<br>
> # make clean && CC=/usr/lib64/ccache/cc ./autogen.sh&&./configure<br>
> --without-libssh --build=x86_64-redhat-linux-gnu<br>
> --host=x86_64-redhat-linux-gnu --program-prefix=<br>
> --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr<br>
> --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc<br>
> --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64<br>
> --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib<br>
> --mandir=/usr/share/man --infodir=/usr/share/info --with-qemu<br>
> --without-openvz --without-lxc --without-vbox --without-libxl<br>
> --with-sasl --with-polkit --with-libvirtd --without-phyp --with-esx<br>
> --without-hyperv --without-vmware --without-xenapi --without-vz<br>
> --without-bhyve --with-interface --with-network --with-storage-fs<br>
> --with-storage-lvm --with-storage-iscsi --with-storage-iscsi-direct<br>
> --with-storage-scsi --with-storage-disk --with-storage-mpath<br>
> --with-storage-rbd --without-storage-sheepdog --with-storage-gluster<br>
> --without-storage-zfs --without-storage-vstorage --with-numactl<br>
> --with-numad --with-capng --without-fuse --with-netcf --with-selinux<br>
> --with-selinux-mount=/sys/fs/selinux --without-apparmor --without-hal<br>
> --with-udev --with-yajl --with-sanlock --with-libpcap --with-macvtap<br>
> --with-audit --with-dtrace --with-driver-modules --with-firewalld<br>
> --with-firewalld-zone --without-wireshark-dissector --without-pm-utils<br>
> --with-nss-plugin '--with-packager=Unknown, 2019-08-19-12:13:01,<br>
> <a href="http://lab.rhel8.me" rel="noreferrer" target="_blank">lab.rhel8.me</a> <<a href="http://lab.rhel8.me" rel="noreferrer" target="_blank">http://lab.rhel8.me</a>>' --with-packager-version=1.el8<br>
> --with-qemu-user=qemu --with-qemu-group=qemu<br>
> --with-tls-priority=@LIBVIRT,SYSTEM --enable-werror<br>
> --enable-expensive-tests --with-init-script=systemd<br>
> --without-login-shell && make -j8<br>
> # LD_PRELOAD="$(find src -name '*.so.*'|tr '\n' ' ')" src/.libs/virtlogd<br>
> # LD_PRELOAD="$(find src -name '*.so.*'|tr '\n' ' ')" LIBVIRT_DEBUG=3<br>
> LIBVIRT_LOG_FILTERS="1:util 1:qemu 1:security"<br>
> LIBVIRT_LOG_OUTPUTS="1:file:/tmp/libvirt_daemon.log" src/.libs/libvirtd<br>
> <br>
> 3. Define and start an VM with the qcow2&qcow2 data file. Note that the<br>
> -blockdev is not enabled<br>
> # virsh define pc-data.xml<br>
> # virsh start pc-data<br>
> <br>
> 4. Create snapshot and check the data file XATTRs:<br>
> # virsh snapshot-create-as pc-data s1 --no-metadata --disk-only<br>
> # getfattr -m - -d /var/lib/libvirt/images/pc-data.raw<br>
> getfattr: Removing leading '/' from absolute path names<br>
> # file: var/lib/libvirt/images/pc-data.raw<br>
> security.selinux="unconfined_u:object_r:svirt_image_t:s0:c775,c1011"<br>
> trusted.libvirt.security.dac="+107:+107"<br>
> trusted.libvirt.security.ref_dac="1"<br>
> trusted.libvirt.security.ref_selinux="1"<br>
> trusted.libvirt.security.selinux="unconfined_u:object_r:svirt_image_t:s0:c284,c367"<br>
> trusted.libvirt.security.timestamp_dac="1563328069"<br>
> trusted.libvirt.security.timestamp_selinux="1563328069"<br>
> <br>
> Shutdown the VM. The XATTRs of data file is not changed.<br>
> It is not expected. The XTTRs should not contain *.libvirt.*<br>
> <br>
> Issue is not reproduced with -blockdev enabled:<br>
> <domain type='kvm' xmlns:qemu='<a href="http://libvirt.org/schemas/domain/qemu/1.0" rel="noreferrer" target="_blank">http://libvirt.org/schemas/domain/qemu/1.0</a>'><br>
> ...<br>
>   <qemu:capabilities><br>
>     <qemu:add capability='blockdev'/><br>
>     <qemu:del capability='drive'/><br>
>   </qemu:capabilities><br>
> </domain><br>
> <br>
> See the libvirt daemon log and vm xml in attachment.<br>
<br>
Nice catch! I will need to dig into this to figure out where the issue<br>
is. Can you put this info into an upstream bug report in<br></blockquote><div>Sure. <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1762135">https://bugzilla.redhat.com/show_bug.cgi?id=1762135</a> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
product=Virtualization Tools  and I will get to it when I can<br>
<br>
Thanks,<br>
Cole<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Best regards,</div><div dir="ltr">-----------------------------------<br></div><div dir="ltr">Han Han<br>Quality Engineer<br>Redhat.<br><br>Email: <a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a><br>Phone: +861065339333<br></div></div></div></div></div></div></div>