• E
    snapshot: refuse to generate names for non-regular backing files · c74b9715
    Eric Blake 提交于
    For whatever reason, the kernel allows you to create a regular
    file named /dev/sdc.12345; although this file will disappear the
    next time devtmpfs is remounted.  If you let libvirt generate
    the name of the external snapshot for a disk image originally
    using the block device /dev/sdc, then the domain will be rendered
    unbootable once the qcow2 file is lost on the next devtmpfs
    remount.  In this case, the user should have used 'virsh
    snapshot-create --xmlfile' or 'virsh snapshot-create-as --diskspec'
    to specify the name for the qcow2 file in a sane location, rather
    than relying on libvirt generating a name that is most likely to
    be wrong.  We can help avoid naive mistakes by enforcing that
    the user provide the external name for any backing file that is
    not a regular file.
    
    * src/conf/domain_conf.c (virDomainSnapshotAlignDisks): Only
    generate names if backing file exists as regular file.
    Reported by MATSUDA Daiki.
    c74b9715
domain_conf.c 418.7 KB