1. 14 11月, 2013 14 次提交
    • P
      qcow2: fix possible corruption when reading multiple clusters · 78a52ad5
      Peter Lieven 提交于
      if multiple sectors spanning multiple clusters are read the
      function count_contiguous_clusters should ensure that the
      cluster type should not change between the clusters.
      
      Especially the for-loop should break when we have one
      or more normal clusters followed by a compressed cluster.
      
      Unfortunately the wrong macro was used in the mask to
      compare the flags.
      
      This was discovered while debugging a data corruption
      issue when converting a compressed qcow2 image to raw.
      qemu-img reads 2MB chunks which span multiple clusters.
      
      CC: qemu-stable@nongnu.org
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      78a52ad5
    • A
      qmp: access the local QemuOptsLists for drive option · 968854c8
      Amos Kong 提交于
      Currently we have three QemuOptsList (qemu_common_drive_opts,
      qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts
      is added to vm_config_groups[].
      
      This patch changes query-command-line-options to access three local
      QemuOptsLists for drive option, and merge the description items
      together.
      Signed-off-by: NAmos Kong <akong@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      968854c8
    • S
      MAINTAINERS: add block tree repo URLs · d48addda
      Stefan Hajnoczi 提交于
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d48addda
    • M
      qemu-iotests: Extend 041 for unbacked mirroring · c15badee
      Max Reitz 提交于
      Add a new test case in file 041 for mirroring unbacked images in
      "absolute-paths" mode. This should work, if possible, but most
      importantly, qemu should never crash.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NWenchao Xia <xiawenc@linux.vnet.ibm.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c15badee
    • M
      block/drive-mirror: Check for NULL backing_hd · 14526864
      Max Reitz 提交于
      It should be possible to execute the QMP "drive-mirror" command in
      "none" sync mode and "absolute-paths" mode even for block devices
      lacking a backing file.
      
      "absolute-paths" does in fact not require a backing file to be present,
      as can be seen from the "top" sync mode code path. "top" basically
      states that the device should indeed have a backing file - however, the
      current code catches the case if it doesn't and then simply treats it as
      "full" sync mode, creating a target image without a backing file (in
      "absolute-paths" mode). Thus, "absolute-paths" does not imply the target
      file must indeed have a backing file.
      
      Therefore, the target file may be left unbacked in case of "none" sync
      mode as well, if the specified device is not backed either. Currently,
      qemu will crash trying to dereference the backing file pointer since it
      assumes that it will always be non-NULL in that case ("none" with
      "absolute-paths").
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NWenchao Xia <xiawenc@linux.vnet.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      14526864
    • M
      qapi-schema: Update description for NewImageMode · 1296c2f0
      Max Reitz 提交于
      If the NewImageMode is "absolute-paths" but no backing file is available
      (e.g., when mirroring a device with an unbacked image), the target image
      will not be backed either. This patch updates the documentation in
      qapi-schema.json accordingly.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1296c2f0
    • F
      block: Print its file name if backing file opening failed · b04b6b6e
      Fam Zheng 提交于
      If backing file doesn't exist, the error message is confusing and
      misleading:
      
          $ qemu /tmp/a.qcow2
          qemu: could not open disk image /tmp/a.qcow2: Could not open file: No
          such file or directory
      
      But...
      
          $ ls /tmp/a.qcow2
          /tmp/a.qcow2
      
          $ qemu-img info /tmp/a.qcow2
          image: /tmp/a.qcow2
          file format: qcow2
          virtual size: 8.0G (8589934592 bytes)
          disk size: 196K
          cluster_size: 65536
          backing file: /tmp/b.qcow2
      
      Because...
      
          $ ls /tmp/b.qcow2
          ls: cannot access /tmp/b.qcow2: No such file or directory
      
      This is not intuitive. It's better to have the missing file's name in
      the error message. With this patch:
      
          $ qemu-io -c 'read 0 512' /tmp/a.qcow2
          qemu-io: can't open device /tmp/a.qcow2: Could not open backing
          file: Could not open '/stor/vm/arch.raw': No such file or directory
          no file open, try 'help open'
      
      Which is a little bit better.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b04b6b6e
    • A
      Merge remote-tracking branch 'luiz/queue/qmp' into staging · 5c5432e7
      Anthony Liguori 提交于
      # By Luiz Capitulino (1) and Richard Henderson (1)
      # Via Luiz Capitulino
      * luiz/queue/qmp:
        MAINTAINERS: add git tree info for HMP, QMP and QAPI
        Adjust qapi-visit for python-2.4.3
      
      Message-id: 1384281985-11100-1-git-send-email-lcapitulino@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      5c5432e7
    • A
      Merge remote-tracking branch 'mst/tags/for_anthony' into staging · 29c5b77d
      Anthony Liguori 提交于
      pci, pc, virtio bug fixes
      
      This reverts PCI master abort support - we'll want it
      eventually but it exposes too many core bugs to be safe for 1.7.
      This also reverts a recent exec.c change that was an
      attempt to work-around some of these core bugs.
      
      Also included are small fixes in pc and virtio,
      and a core loader fix for PPC bamboo.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Sun 10 Nov 2013 05:13:22 AM PST using RSA key ID D28D5469
      # gpg: Can't check signature: public key not found
      
      # By Michael S. Tsirkin (3) and others
      # Via Michael S. Tsirkin
      * mst/tags/for_anthony:
        Revert "exec: limit system memory size"
        Revert "hw/pci: partially handle pci master abort"
        loader: drop return value for rom_add_blob_fixed
        acpi-build: disable with -no-acpi
        virtio-net: only delete bh that existed
        Fix pc migration from qemu <= 1.5
      
      Message-id: 1384159176-31662-1-git-send-email-mst@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      29c5b77d
    • A
      Merge remote-tracking branch 'stefanha/net' into staging · b873a55c
      Anthony Liguori 提交于
      # By Dmitry Fleytman (1) and others
      # Via Stefan Hajnoczi
      * stefanha/net:
        virtio-net: broken RX filtering logic fixed
        net: fix qemu_flush_queued_packets() in presence of a hub
        net: disallow to specify multicast MAC address
      
      Message-id: 1383928804-28866-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      b873a55c
    • A
      Merge remote-tracking branch 'stefanha/block' into staging · deb0f500
      Anthony Liguori 提交于
      # By Jeff Cody (26) and others
      # Via Stefan Hajnoczi
      * stefanha/block: (37 commits)
        block: Round up total_sectors
        block: vhdx qemu-iotest - log replay of data sector
        block: qemu-iotests for vhdx, add write test support
        block: vhdx - update _make_test_img() to filter out vhdx options
        block: vhdx - add .bdrv_create() support
        block: vhdx - fix comment typos in header, fix incorrect struct fields
        block: vhdx - break out code operations to functions
        block: vhdx - move more endian translations to vhdx-endian.c
        block: vhdx - remove BAT file offset bit shifting
        block: vhdx write support
        block: vhdx - add log write support
        block: vhdx - add region overlap detection for image files
        block: vhdx - log parsing, replay, and flush support
        block: vhdx code movement - move vhdx_close() above vhdx_open()
        block: vhdx - update log guid in header, and first write tracker
        block: vhdx - break endian translation functions out
        block: vhdx - log support struct and defines
        block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.
        block: vhdx - add header update capability.
        block: vhdx - minor comments and typo correction.
        ...
      
      Message-id: 1383905551-16411-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      deb0f500
    • A
      Merge remote-tracking branch 'filippov/tags/20131108-xtensa' into staging · 70c4c5b5
      Anthony Liguori 提交于
      Two small fixes for 1.7:
      
      - add missing debug feature to dc233c xtensa core;
      - fix qemu abort caused by gdb attempt to invalidate a breakpoint by
        virtual address for which there's no mapping.
      
      # gpg: Signature made Thu 07 Nov 2013 09:32:19 PM PST using RSA key ID F83FA044
      # gpg: Can't check signature: public key not found
      
      # By Max Filippov
      # Via Max Filippov
      * filippov/tags/20131108-xtensa:
        target-xtensa: add missing DEBUG section to dc233c config
        exec: fix breakpoint_invalidate when pc may not be translated
      
      Message-id: 1383889643-21621-1-git-send-email-jcmvbkbc@gmail.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      70c4c5b5
    • A
      Merge remote-tracking branch 'kraxel/audio.3' into staging · 9f43a3f5
      Anthony Liguori 提交于
      # By Gerd Hoffmann
      # Via Gerd Hoffmann
      * kraxel/audio.3:
        ossaudio: check for oss support in oss_audio_init
        Revert "ossaudio: do not enable by default"
      
      Message-id: 1383823947-5132-1-git-send-email-kraxel@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      9f43a3f5
    • A
      Merge remote-tracking branch 'sweil/mingw' into staging · 6bddfae3
      Anthony Liguori 提交于
      # By Stefan Weil
      # Via Stefan Weil
      * sweil/mingw:
        linux-user: Fix stat64 syscall for SPARC64
        configure: Add config.status to recreate the current configuration
        nsis: Improved support for parallel installation of 32 and 64 bit code
      
      Message-id: 1383804909-376-1-git-send-email-sw@weilnetz.de
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      6bddfae3
  2. 11 11月, 2013 2 次提交
  3. 10 11月, 2013 6 次提交
  4. 09 11月, 2013 3 次提交
  5. 08 11月, 2013 3 次提交
  6. 07 11月, 2013 12 次提交
    • J
      block: vhdx qemu-iotest - log replay of data sector · e78835b7
      Jeff Cody 提交于
      This tests the replay of a data sector in a VHDX image file.
      
      The image file is a 10G dynamic image, with 4MB block size.  The
      image was created with qemu-img, and the log left unplayed by
      modification of the vhdx image format driver.
      
      It was verified under both QEMU and Hyper-V that the image file,
      post log replay, matched.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e78835b7
    • J
      block: qemu-iotests for vhdx, add write test support · 751aec24
      Jeff Cody 提交于
      This removes the IMGFMT_GENERIC blocker for read-only, so existing
      iotests run read/write tests for vhdx images created by qemu-img (e.g.
      tests 001, 002, 003).
      
      In addition, this updates the sample image test for the Hyper-V
      created image, to verify we can write it as well.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      751aec24
    • J
      block: vhdx - update _make_test_img() to filter out vhdx options · 228b234d
      Jeff Cody 提交于
      The non-global option output is suppresed in _make_test_img() for
      output verification in the 0?? tests.  This adds suppression for
      the vhdx-unique options as well.  This allows check -vhdx to run
      successfully.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      228b234d
    • J
      block: vhdx - add .bdrv_create() support · 3412f7b1
      Jeff Cody 提交于
      This adds support for VHDX image creation, for images of type "Fixed"
      and "Dynamic".  "Differencing" types (i.e., VHDX images with backing
      files) are currently not supported.
      
      Options for image creation include:
          * log size:
              The size of the journaling log for VHDX.  Minimum is 1MB,
              and it must be a multiple of 1MB. Invalid log sizes will be
              silently fixed by rounding up to the nearest MB.
      
              Default is 1MB.
      
          * block size:
              This is the size of a payload block.  The range is 1MB to 256MB,
              inclusive, and must be a multiple of 1MB as well.  Invalid sizes
              and multiples will be silently fixed.  If '0' is passed, then
              a sane size is chosen (depending on virtual image size).
      
              Default is 0 (Auto-select).
      
          * subformat:
              - "dynamic"
                  An image without data pre-allocated.
              - "fixed"
                  An image with data pre-allocated.
      
              Default is "dynamic"
      
      When creating the image file, the lettered sections are created:
      
      -----------------------------------------------------------------.
      |   (A)    |   (B)    |    (C)    |     (D)       |     (E)
      |  File ID |  Header1 |  Header 2 |  Region Tbl 1 |  Region Tbl 2
      |          |          |           |               |
      .-----------------------------------------------------------------.
      0         64KB      128KB       192KB           256KB          320KB
      
      .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
      |     (F)     |     (G)       |    (H)    |
      | Journal Log |  BAT / Bitmap |  Metadata |  .... data ......
      |             |               |           |
      .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
      1MB         (var.)          (var.)      (var.)
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      3412f7b1
    • J
      block: vhdx - fix comment typos in header, fix incorrect struct fields · 61c02e56
      Jeff Cody 提交于
      VHDXPage83Data and VHDXParentLocatorHeader both incorrectly had their
      MSGUID fields set as arrays of 16.  This is incorrect (it stems from
      an early version where those fields were uint_8 arrays).  Those fields
      were, up to this patch, unused.
      
      Also, there were a couple of typos and incorrect wording in comments,
      and those have been fixed up as well.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      61c02e56
    • J
      block: vhdx - break out code operations to functions · 1e74a971
      Jeff Cody 提交于
      This is preperation for vhdx_create().  The ability to write headers,
      and calculate the number of BAT entries will be needed within the
      create() functions, so move this relevant code into helper functions.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      1e74a971
    • J
      block: vhdx - move more endian translations to vhdx-endian.c · c325ee1d
      Jeff Cody 提交于
      In preparation for vhdx_create(), move more endian translation
      functions out to vhdx-endian.c.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c325ee1d
    • J
      block: vhdx - remove BAT file offset bit shifting · 0b7da092
      Jeff Cody 提交于
      Bit shifting can be fun, but in this case it was unnecessary.  The
      upper 44 bits of the 64-bit BAT entry is specifies the File Offset,
      so we shifted the bits to get access to the value.
      
      However, per the spec the value is in MB.  So we dutifully shifted back
      to the left by 20 bits, to convert to a true uint64_t file offset.
      
      This replaces those steps with just a bit mask, to get rid of the lower
      20 bits instead.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0b7da092
    • J
      block: vhdx write support · d92aa883
      Jeff Cody 提交于
      This adds support for writing to VHDX image files, using coroutines.
      Writes into the BAT table goes through the VHDX log.  Currently, BAT
      table writes occur when expanding a dynamic VHDX file, and allocating a
      new BAT entry.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d92aa883
    • J
      block: vhdx - add log write support · 8adc5233
      Jeff Cody 提交于
      This adds support for writing to the VHDX log.
      
      For spec details, see VHDX Specification Format v1.00:
      https://www.microsoft.com/en-us/download/details.aspx?id=34750
      
      There are a few limitations to this log support:
      1.) There is no caching yet
      2.) The log is flushed after each entry
      
      The primary write interface, vhdx_log_write_and_flush(), performs a log
      write followed by an immediate flush of the log.
      
      As each log entry sector is a minimum of 4KB, partial sector writes are
      filled in with data from the disk write destination.
      
      If the current file log GUID is 0, a new GUID is generated and updated
      in the header.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      8adc5233
    • J
      block: vhdx - add region overlap detection for image files · 1a848fd4
      Jeff Cody 提交于
      Regions in the image file cannot overlap - the log, region tables,
      and metdata must all be unique and non-overlapping.
      
      This adds region checking by means of a QLIST; there can be a variable
      number of regions and metadata (there may be metadata or region tables
      that we do not recognize / know about, but are not required).
      
      This adds the capability to register a region for later checking, and
      to check against registered regions for any overlap.
      
      Also, if neither the BAT or Metadata region tables are found, return
      error.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      1a848fd4
    • J
      block: vhdx - log parsing, replay, and flush support · 0a43a1b5
      Jeff Cody 提交于
      This adds support for VHDX v0 logs, as specified in Microsoft's
      VHDX Specification Format v1.00:
      https://www.microsoft.com/en-us/download/details.aspx?id=34750
      
      The following support is added:
      
      * Log parsing, and validation - validate that an existing log
        is correct.
      
      * Log search - search through an existing log, to find any valid
        sequence of entries.
      
      * Log replay and flush - replay an existing log, and flush/clear
        the log when complete.
      
      The VHDX log is a circular buffer, with elements (sectors) of 4KB.
      
      A log entry is a variably-length number of sectors, that is
      comprised of a header and 'descriptors', that describe each sector.
      
      A log may contain multiple entries, know as a log sequence.  In a log
      sequence, each log entry immediately follows the previous entry, with an
      incrementing sequence number.  There can only ever be one active and
      valid sequence in the log.
      
      Each log entry must match the file log GUID in order to be valid (along
      with other criteria).  Once we have flushed all valid log entries, we
      marked the file log GUID to be zero, which indicates a buffer with no
      valid entries.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0a43a1b5