Re: virsh attach makes qcow2 format disk to raw format

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

 



On 12/09/2013 09:03 PM, lyz_pro@xxxxxxx wrote:
> Hi all
> 
> I have a problem when I use `virsh attach` to attach a qcow2 disk to vm without argument --subdirver=qcow2
> and this makes the qcow2 disk become a raw format disk, and the data in this disk is missing in guest os
> and also I have used guestmout to confirm this, the same result.

The format of a file is important.  By default, libvirt refuses to probe
a file for its format, because any raw file can contain contents that
look like any other format, making libvirt and/or qemu misbehave if the
guest abused the raw contents to intentionally resemble a different
format (this is a known CVE in the past).  You can flip an option in
/etc/libvirt/qemu.conf to request libvirt to probe image formats, at
which point you can then omit the format but the guest will still get
the data from the qcow2 format instead of abusing the file as raw; but
this is a security risk if you do not trust any guest that has ever run
on the image file.

> 
> Is there any way to let me find back the data in this disk ?

If the guest wrote to the disk, then I hope you had a good backup.  If
the guest merely read from the disk but didn't write any data, then
unplugging the disk and replugging with the correct qcow2 format will
fix things.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux