Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-73509

qemu-img can't create a qcow2 overlay with 'data_file' feature on top of a file without destroying the original image

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • rhel-virt-storage
    • ssg_virtualization
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • virt-storage Sprint 6, Patch Under review backlog
    • None
    • None
    • None

      What were you trying to do that didn't work?

      qemu-img create -f qcow2 -o data_file=DATAFILE,data_file_raw=true
      

      destroys data inside DATAFILE.

      What is the impact of this issue to you?

      CNV wants to create qcow2 overlays using the 'data_file' feature on top of existing storage in order to leverage incremental backups.
       

      Please provide the package NVR for which the bug is seen:

      All versions including upstream

      How reproducible is this bug?:

      always

      Steps to reproduce

      0: Create image with some data:
        $ yes | dd of=/tmp/rawfile bs=1M iflag=fullblock count=100
        100+0 records in
        100+0 records out
        104857600 bytes (105 MB, 100 MiB) copied, 0.0891616 s, 1.2 GB/s
      
      1: look that there is data in the image
        $ hexdump /tmp/rawfile 
        0000000 0a79 0a79 0a79 0a79 0a79 0a79 0a79 0a79
        *
        6400000
      
      2: create qcow2 with 'data_file'
        $ qemu-img create -f qcow2 -o data_file=/tmp/rawfile,data_file_raw=true /tmp/dataoverlay.qcow2 100M
        Formatting '/tmp/dataoverlay.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=104857600 data_file=/tmp/rawfile data_file_raw=true lazy_refcounts=off refcount_bits=16
      
      3: look at the data again:
        $ hexdump /tmp/rawfile 
        0000000 0000 0000 0000 0000 0000 0000 0000 0000
        *
        6400000
      

      Expected results

      Data is preserved; qemu-img does not require image size parameter.

      Actual results

      Image size must be specified and data is destroyed.

              hreitz@redhat.com Hanna Czenczek
              pkrempa@redhat.com Peter Krempa
              virt-maint virt-maint
              Tingting Mao Tingting Mao
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: