1. 16 12月, 2013 1 次提交
  2. 07 11月, 2013 3 次提交
    • 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
    • J
      block: vhdx - break endian translation functions out · 0f48e8f0
      Jeff Cody 提交于
      This moves the endian translation functions out from the vhdx.c source,
      into a separate source file. In addition to the previously defined
      endian functions, new endian translation functions for log support are
      added as well.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0f48e8f0
    • J
      block: vhdx - add header update capability. · 4f18b782
      Jeff Cody 提交于
      This adds the ability to update the headers in a VHDX image, including
      generating a new MS-compatible GUID.
      
      As VHDX depends on uuid.h, VHDX is now a configurable build option.  If
      VHDX support is enabled, that will also enable uuid as well.  The
      default is to have VHDX enabled.
      
      To enable/disable VHDX:  --enable-vhdx, --disable-vhdx
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4f18b782
  3. 30 8月, 2013 1 次提交
    • L
      switch raw block driver from "raw.o" to "raw_bsd.o" · 7a6d3fc5
      Laszlo Ersek 提交于
      "Incoming" function prototypes and "outgoing" function calls must match
      reality. Implemented using the "struct BlockDriver" definition in
      "include/block/block_int.h", and gcc errors & warnings.
      
      v1->v2:
      
      On 08/20/13 09:51, Kevin Wolf wrote:
      > Am 18.08.2013 um 16:29 hat Paolo Bonzini geschrieben:
      >> Il 16/08/2013 16:15, Laszlo Ersek ha scritto:
      >>> +static int raw_reopen_prepare(BDRVReopenState *reopen_state,
      >>> +                              BlockReopenQueue *queue, Error **errp)
      >>>  {
      >>> -    return bdrv_reopen_prepare(bs->file);
      >>> +    BDRVReopenState tmp = *reopen_state;
      >>> +
      >>> +    tmp.bs = tmp.bs->file;
      >>> +    return bdrv_reopen_prepare(&tmp, queue, errp);
      >>>  }
      >>
      >> This should just return zero, my fault.
      >
      > Which is because bdrv_reopen_queue() already queues bs->file for reopen.
      > The simple return 0; implementation is shared by all other format drivers
      > that support reopening images.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      7a6d3fc5
  4. 28 6月, 2013 1 次提交
    • D
      block: add basic backup support to block driver · 98d2c6f2
      Dietmar Maurer 提交于
      backup_start() creates a block job that copies a point-in-time snapshot
      of a block device to a target block device.
      
      We call backup_do_cow() for each write during backup. That function
      reads the original data from the block device before it gets
      overwritten.  The data is then written to the target device.
      
      Currently backup cluster size is hardcoded to 65536 bytes.
      
      [I made a number of changes to Dietmar's original patch and folded them
      in to make code review easy.  Here is the full list:
      
       * Drop BackupDumpFunc interface in favor of a target block device
       * Detect zero clusters with buffer_is_zero() and use bdrv_co_write_zeroes()
       * Use 0 delay instead of 1us, like other block jobs
       * Unify creation/start functions into backup_start()
       * Simplify cleanup, free bitmap in backup_run() instead of cb
       * function
       * Use HBitmap to avoid duplicating bitmap code
       * Use bdrv_getlength() instead of accessing ->total_sectors
       * directly
       * Delete the backup.h header file, it is no longer necessary
       * Move ./backup.c to block/backup.c
       * Remove #ifdefed out code
       * Coding style and whitespace cleanups
       * Use bdrv_add_before_write_notifier() instead of blockjob-specific hooks
       * Keep our own in-flight CowRequest list instead of using block.c
         tracked requests.  This means a little code duplication but is much
         simpler than trying to share the tracked requests list and use the
         backup block size.
       * Add on_source_error and on_target_error error handling.
       * Use trace events instead of DPRINTF()
      
      -- stefanha]
      Signed-off-by: NDietmar Maurer <dietmar@proxmox.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      98d2c6f2
  5. 04 6月, 2013 2 次提交
  6. 03 5月, 2013 1 次提交
  7. 15 4月, 2013 1 次提交
    • R
      block: Add support for Secure Shell (ssh) block device. · 0a12ec87
      Richard W.M. Jones 提交于
        qemu-system-x86_64 -drive file=ssh://hostname/some/image
      
      QEMU will ssh into 'hostname' and open '/some/image' which is made
      available as a standard block device.
      
      You can specify a username (ssh://user@host/...) and/or a port number
      (ssh://host:port/...).  You can also use an alternate syntax using
      properties (file.user, file.host, file.port, file.path).
      
      Current limitations:
      
      - Authentication must be done without passwords or passphrases, using
        ssh-agent.  Other authentication methods are not supported.
      
      - Uses a single connection, instead of concurrent AIO with multiple
        SSH connections.
      
      This is implemented using libssh2 on the client side.  The server just
      requires a regular ssh daemon with sftp-server support.  Most ssh
      daemons on Unix/Linux systems will work out of the box.
      Signed-off-by: NRichard W.M. Jones <rjones@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@gmail.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0a12ec87
  8. 19 12月, 2012 1 次提交
  9. 31 10月, 2012 2 次提交
  10. 30 10月, 2012 1 次提交
    • P
      aio: add Win32 implementation · f42b2207
      Paolo Bonzini 提交于
      The Win32 implementation will only accept EventNotifiers, thus a few
      drivers are disabled under Windows.  EventNotifiers are a good match
      for the GSource implementation, too, because the Win32 port of glib
      allows to place their HANDLEs in a GPollFD.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f42b2207
  11. 24 10月, 2012 1 次提交
    • P
      mirror: introduce mirror job · 893f7eba
      Paolo Bonzini 提交于
      This patch adds the implementation of a new job that mirrors a disk to
      a new image while letting the guest continue using the old image.
      The target is treated as a "black box" and data is copied from the
      source to the target in the background.  This can be used for several
      purposes, including storage migration, continuous replication, and
      observation of the guest I/O in an external program.  It is also a
      first step in replacing the inefficient block migration code that is
      part of QEMU.
      
      The job is possibly never-ending, but it is logically structured into
      two phases: 1) copy all data as fast as possible until the target
      first gets in sync with the source; 2) keep target in sync and
      ensure that reopening to the target gets a correct (full) copy
      of the source data.
      
      The second phase is indicated by the progress in "info block-jobs"
      reporting the current offset to be equal to the length of the file.
      When the job is cancelled in the second phase, QEMU will run the
      job until the source is clean and quiescent, then it will report
      successful completion of the job.
      
      In other words, the BLOCK_JOB_CANCELLED event means that the target
      may _not_ be consistent with a past state of the source; the
      BLOCK_JOB_COMPLETED event means that the target is consistent with
      a past state of the source.  (Note that it could already happen
      that management lost the race against QEMU and got a completion
      event instead of cancellation).
      
      It is not yet possible to complete the job and switch over to the target
      disk.  The next patches will fix this and add many refinements to the
      basic idea introduced here.  These include improved error management,
      some tunable knobs and performance optimizations.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      893f7eba
  12. 29 9月, 2012 2 次提交
  13. 28 9月, 2012 1 次提交
  14. 07 6月, 2012 1 次提交