1. 22 10月, 2010 4 次提交
    • E
      Copy snapshots out of QCOW2 disk · 51ef6727
      edison 提交于
      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: NDisheng Su <edison@cloud.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      51ef6727
    • K
      qcow2: Remove old image creation function · 9b036055
      Kevin Wolf 提交于
      They have been #ifdef'd out by the previous patch.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9b036055
    • K
      qcow2: Simplify image creation · a9420734
      Kevin Wolf 提交于
      Instead of doing lots of magic for setting up initial refcount blocks and stuff
      create a minimal (inconsistent) image, open it and initialize the rest with
      regular qcow2 functions.
      
      This is a complete rewrite of the image creation function. The old
      implementating is #ifdef'd out and will be removed by the next patch (removing
      it here would have made the diff unreadable because diff tries to find
      similarities when it's really a rewrite)
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a9420734
    • S
      qcow2: Support exact L1 table growth · 72893756
      Stefan Hajnoczi 提交于
      The L1 table grow operation includes a size calculation that bumps up
      the new L1 table size in order to anticipate the size needs of vmstate
      data.  This helps reduce the number of times that the L1 table has to be
      grown when vmstate data is appended.
      
      This size overhead is not necessary during image creation,
      bdrv_truncate(), or snapshot goto operations.  In fact, existing
      qemu-iotests that exercise table growth are no longer able to trigger it
      because image creation preallocates an L1 table that is too large after
      changes to qcow_create2().
      
      This patch keeps the size calculation but also adds exact growth for
      callers that do not want to inflate the L1 table size unnecessarily.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      72893756
  2. 14 10月, 2010 1 次提交
  3. 03 10月, 2010 1 次提交
  4. 23 9月, 2010 1 次提交
  5. 21 9月, 2010 12 次提交
  6. 18 9月, 2010 1 次提交
    • B
      blkdebug: fix enum comparison · 95ee3914
      Blue Swirl 提交于
      The signedness of enum types depend on the compiler implementation.
      Therefore the check for negative values may or may not be meaningful.
      
      Fix by explicitly casting to a signed integer.
      
      Since the values are also checked earlier against event_names
      table, this is an internal error. Change the 'if' to 'assert'.
      
      This also avoids a warning with GCC flag -Wtype-limits.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      95ee3914
  7. 09 9月, 2010 1 次提交
  8. 08 9月, 2010 3 次提交
  9. 31 8月, 2010 3 次提交
  10. 03 8月, 2010 1 次提交
    • K
      block: Fix bdrv_has_zero_init · 336c1c12
      Kevin Wolf 提交于
      Assuming that any image on a block device is not properly zero-initialized is
      actually wrong: Only raw images have this problem. Any other image format
      shouldn't care about it, they initialize everything properly themselves.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      336c1c12
  11. 25 7月, 2010 1 次提交
  12. 15 7月, 2010 1 次提交
    • A
      Make default invocation of block drivers safer (v3) · 79368c81
      Anthony Liguori 提交于
      CVE-2008-2004 described a vulnerability in QEMU whereas a malicious user could
      trick the block probing code into accessing arbitrary files in a guest.  To
      mitigate this, we added an explicit format parameter to -drive which disabling
      block probing.
      
      Fast forward to today, and the vast majority of users do not use this parameter.
      libvirt does not use this by default nor does virt-manager.
      
      Most users want block probing so we should try to make it safer.
      
      This patch adds some logic to the raw device which attempts to detect a write
      operation to the beginning of a raw device.  If the first 4 bytes happen to
      match an image file that has a backing file that we support, it scrubs the
      signature to all zeros.  If a user specifies an explicit format parameter, this
      behavior is disabled.
      
      I contend that while a legitimate guest could write such a signature to the
      header, we would behave incorrectly anyway upon the next invocation of QEMU.
      This simply changes the incorrect behavior to not involve a security
      vulnerability.
      
      I've tested this pretty extensively both in the positive and negative case.  I'm
      not 100% confident in the block layer's ability to deal with zero sized writes
      particularly with respect to the aio functions so some additional eyes would be
      appreciated.
      
      Even in the case of a single sector write, we have to make sure to invoked the
      completion from a bottom half so just removing the zero sized write is not an
      option.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      79368c81
  13. 08 7月, 2010 1 次提交
  14. 06 7月, 2010 3 次提交
    • M
      block: add sheepdog driver for distributed storage support · 33b1db1c
      MORITA Kazutaka 提交于
      Sheepdog is a distributed storage system for QEMU. It provides highly
      available block level storage volumes to VMs like Amazon EBS.  This
      patch adds a qemu block driver for Sheepdog.
      
      Sheepdog features are:
      - No node in the cluster is special (no metadata node, no control
        node, etc)
      - Linear scalability in performance and capacity
      - No single point of failure
      - Autonomous management (zero configuration)
      - Useful volume management support such as snapshot and cloning
      - Thin provisioning
      - Autonomous load balancing
      
      The more details are available at the project site:
          http://www.osrg.net/sheepdog/Signed-off-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      33b1db1c
    • M
      raw-posix: Fix test for host CD-ROM · 65d21bc7
      Markus Armbruster 提交于
      raw_pread_aligned() retries up to two times if the block device backs
      a virtual CD-ROM (a drive with media=cdrom and if=ide, scsi, xen or
      none).  This makes no sense.  Whether retrying reads can correct read
      errors can only depend on what we're reading, not on how the result
      gets used.  We need to check what whether we're reading from a
      physical CD-ROM or floppy here.
      
      I doubt retrying is useful even then.  Left for another day.
      
      Impact:
      
      * Virtual CD-ROM backed by host_cdrom behaves the same.
      
      * Virtual CD-ROM backed by file or host_device no longer retries.
      
      * A drive backed by host_cdrom now retries even if it's not a virtual
        CD-ROM.
      
      * Any drive backed by host_floppy now retries.
      
      While there, clean up gratuitous use of goto.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      65d21bc7
    • K
      qcow2/vdi: Change check to distinguish error cases · 9ac228e0
      Kevin Wolf 提交于
      This distinguishes between harmless leaks and real corruption. Hopefully users
      better understand what qemu-img check wants to tell them.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9ac228e0
  15. 02 7月, 2010 4 次提交
  16. 22 6月, 2010 2 次提交