1. 22 Sep, 2014 1 commit
    • Stefan Hajnoczi's avatar
      block: delete cow block driver · 550830f9
      Stefan Hajnoczi authored
      This patch removes support for the cow file format.
      Normally we do not break backwards compatibility but in this case there
      is no impact and it is the most logical option.  Extraordinary claims
      require extraordinary evidence so I will show why removing the cow block
      driver is the right thing to do.
      The cow file format is the disk image format for Usermode Linux, a way
      of running a Linux system in userspace.  The performance of UML was
      never great and it was hacky, but it enjoyed some popularity before
      hardware virtualization support became mainstream.
      QEMU's block/cow.c is supposed to read this image file format.
      Unfortunately the file format was underspecified:
      1. Earlier Linux versions used the MAXPATHLEN constant for the backing
         filename field.  The value of MAXPATHLEN can change, so Linux
         switched to a 4096 literal but QEMU has a 1024 literal.
      2. Padding was not used on the header struct (both in the Linux kernel
         and in QEMU) so the struct layout varied across architectures.  In
         particular, i386 and x86_64 were different due to int64_t alignment
         differences.  Linux now uses __attribute__((packed)), QEMU does not.
      1. QEMU cow images do not conform to the Linux cow image file format.
      2. cow images cannot be shared between different host architectures.
      This means QEMU cow images are useless and QEMU has not had bug reports
      from users actually hitting these issues.
      Let's get rid of this thing, it serves no purpose and no one will be
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 1410877464-20481-1-git-send-email-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
  2. 12 Sep, 2014 2 commits
  3. 08 Sep, 2014 2 commits
  4. 22 Aug, 2014 2 commits
    • Max Reitz's avatar
      qemu-img: Allow cache mode specification for amend · bd39e6ed
      Max Reitz authored
      qemu-img amend may extensively modify the target image, depending on the
      options to be amended (e.g. conversion to qcow2 compat level 0.10 from
      1.1 for an image with many unallocated zero clusters). Therefore it
      makes sense to allow the user to specify the cache mode to be used.
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    • Max Reitz's avatar
      qemu-img: Allow source cache mode specification · 40055951
      Max Reitz authored
      Many qemu-img subcommands only read the source file(s) once. For these
      use cases, a full write-back cache is unnecessary and mainly clutters
      host cache memory. Though this is generally no concern as cache memory
      is freely available and can be scaled by the host OS, it may become a
      concern with thin provisioning.
      For these cases, it makes sense to allow users to freely specify the
      source cache mode (e.g. use no cache at all).
      This commit adds a new switch (-T) for the qemu-img subcommands check,
      compare, convert and rebase to specify the cache to be used for source
      images (the backing file in case of rebase).
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
  5. 07 Jul, 2014 1 commit
  6. 01 Jul, 2014 1 commit
    • Chunyan Liu's avatar
      qemu-img create: add 'nocow' option · 4ab15590
      Chunyan Liu authored
      Add 'nocow' option so that users could have a chance to set NOCOW flag to
      newly created files. It's useful on btrfs file system to enhance performance.
      Btrfs has low performance when hosting VM images, even more when the guest
      in those VM are also using btrfs as file system. One way to mitigate this bad
      performance is to turn off COW attributes on VM files. Generally, there are
      two ways to turn off NOCOW on btrfs: a) by mounting fs with nodatacow, then
      all newly created files will be NOCOW. b) per file. Add the NOCOW file
      attribute. It could only be done to empty or new files.
      This patch tries the second way, according to the option, it could add NOCOW
      per file.
      For most block drivers, since the create file step is in raw-posix.c, so we
      can do setting NOCOW flag ioctl in raw-posix.c only.
      But there are some exceptions, like block/vpc.c and block/vdi.c, they are
      creating file by calling qemu_open directly. For them, do the same setting
      NOCOW flag ioctl work in them separately.
      [Fixed up 082.out due to the new 'nocow' creation option
      Signed-off-by: default avatarChunyan Liu <cyliu@suse.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
  7. 04 Jun, 2014 1 commit
  8. 31 Jan, 2014 1 commit
    • Daniel P. Berrange's avatar
      Describe flaws in qcow/qcow2 encryption in the docs · 136cd19d
      Daniel P. Berrange authored
      The qemu-img.texi / qemu-doc.texi files currently describe the
      qcow2/qcow2 encryption thus
        "Encryption uses the AES format which is very secure (128 bit
         keys). Use a long password (16 characters) to get maximum
      While AES is indeed a strong encryption system, the way that
      QCow/QCow2 use it results in a poor/weak encryption system.
      Due to the use of predictable IVs, based on the sector number
      extended to 128 bits, it is vulnerable to chosen plaintext
      attacks which can reveal the existence of encrypted data.
      The direct use of the user passphrase as the encryption key
      also leads to an inability to change the passphrase of an
      image. If passphrase is ever compromised the image data will
      all be vulnerable, since it cannot be re-encrypted. The admin
      has to clone the image files with a new passphrase and then
      use a program like shred to secure erase all the old files.
      Recommend against any use of QCow/QCow2 encryption, directing
      users to dm-crypt / LUKS which can meet modern cryptography
      best practices.
      [Changed "Qcow" to "qcow" for consistency.
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
  9. 24 Jan, 2014 2 commits
  10. 22 Jan, 2014 1 commit
  11. 20 Dec, 2013 1 commit
  12. 04 Dec, 2013 1 commit
  13. 28 Nov, 2013 1 commit
  14. 12 Sep, 2013 1 commit
  15. 06 Sep, 2013 2 commits
  16. 22 Feb, 2013 3 commits
  17. 30 Nov, 2012 1 commit
  18. 24 Oct, 2012 2 commits
  19. 14 Sep, 2012 1 commit
  20. 12 Sep, 2012 1 commit
    • Benoît Canet's avatar
      qemu-img: Add json output option to the info command. · c054b3fd
      Benoît Canet authored
      This option --output=[human|json] make qemu-img info output on
      human or JSON representation at the choice of the user.
          "snapshots": [
                  "vm-clock-nsec": 637102488,
                  "name": "vm-20120821145509",
                  "date-sec": 1345553709,
                  "date-nsec": 220289000,
                  "vm-clock-sec": 20,
                  "id": "1",
                  "vm-state-size": 96522745
                  "vm-clock-nsec": 28210866,
                  "name": "vm-20120821154059",
                  "date-sec": 1345556459,
                  "date-nsec": 171392000,
                  "vm-clock-sec": 46,
                  "id": "2",
                  "vm-state-size": 101208714
          "virtual-size": 1073741824,
          "filename": "snap.qcow2",
          "cluster-size": 65536,
          "format": "qcow2",
          "actual-size": 985587712,
          "dirty-flag": false
      Signed-off-by: default avatarBenoit Canet <benoit@irqsave.net>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
  21. 17 Aug, 2012 1 commit
  22. 15 Jun, 2012 2 commits
  23. 25 May, 2012 1 commit
  24. 15 Dec, 2011 1 commit
  25. 29 Aug, 2011 1 commit
    • Kevin Wolf's avatar
      qemu-img: Require larger zero areas for sparse handling · a22f123c
      Kevin Wolf authored
      By default, require 4k of consecutive zero bytes for qemu-img to make the
      output file sparse by not issuing a write request for the zeroed parts. Add an
      -S option to allow users to tune this setting.
      This helps to avoid situations where a lot of zero sectors and data sectors are
      mixed and qemu-img tended to issue many tiny 512 byte writes.
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
  26. 20 Jul, 2011 1 commit
  27. 05 Jul, 2011 1 commit
  28. 24 Jan, 2011 1 commit
  29. 22 Oct, 2010 1 commit
    • edison's avatar
      Copy snapshots out of QCOW2 disk · 51ef6727
      edison authored
      In order to backup snapshots, created from QCOW2 iamge, we want to copy snapshots out of QCOW2 disk to a seperate storage.
      The following patch adds a new option in "qemu-img": qemu-img convert -f qcow2 -O qcow2 -s snapshot_name src_img bck_img.
      Right now, it only supports to copy the full snapshot, delta snapshot is on the way.
      Changes from V1: all the comments from Kevin are addressed:
      Add read-only checking
      Fix coding style
      Change the name from bdrv_snapshot_load to bdrv_snapshot_load_tmp
      Signed-off-by: default avatarDisheng Su <edison@cloud.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
  30. 03 May, 2010 1 commit
  31. 09 Nov, 2009 1 commit