1. 24 10月, 2012 7 次提交
    • P
      mirror: add support for on-source-error/on-target-error · b952b558
      Paolo Bonzini 提交于
      Error management is important for mirroring; otherwise, an error on the
      target (even something as "innocent" as ENOSPC) requires to start again
      with a full copy.  Similar to on_read_error/on_write_error, two separate
      knobs are provided for on_source_error (reads) and on_target_error (writes).
      The default is 'report' for both.
      
      The 'ignore' policy will leave the sector dirty, so that it will be
      retried later.  Thus, it will not cause corruption.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b952b558
    • P
      qmp: add drive-mirror command · d9b902db
      Paolo Bonzini 提交于
      This adds the monitor commands that start the mirroring job.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d9b902db
    • 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
    • P
      block: introduce BLOCK_JOB_READY event · a66a2a36
      Paolo Bonzini 提交于
      Even for jobs that need to be manually completed, management may want
      to take care itself of the completion, not requiring the user to issue
      a command to terminate the job.  In this case we want to avoid that
      they poll us continuously, waiting for completion to become available.
      Thus, add a new event that signals the phase switch and the availability
      of the block-job-complete command.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a66a2a36
    • P
      block: add block-job-complete · aeae883b
      Paolo Bonzini 提交于
      While streaming can be dropped as soon as it progressed through the whole
      image, mirroring needs to be completed manually for two reasons: 1) so that
      management knows exactly when the VM switches to the target; 2) because
      for other use cases such as replication, we may leave the operation running
      for the whole life of the virtual machine.
      
      Add a new block job command that manually completes background operations.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      aeae883b
    • P
      b9a9b3a4
    • C
      monitor: Allow add-fd to any specified fd set · 9ac54af0
      Corey Bryant 提交于
      The first call to add an fd to an fd set was previously not
      allowed to choose the fd set ID.  The ID was generated as
      the first available and ensuing calls could add more fds by
      specifying the fd set ID.  This change allows users to
      choose the fd set ID on the first call.
      Signed-off-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9ac54af0
  2. 18 10月, 2012 3 次提交
  3. 03 10月, 2012 1 次提交
  4. 29 9月, 2012 7 次提交
  5. 27 9月, 2012 3 次提交
  6. 26 9月, 2012 1 次提交
    • L
      qapi: convert add_client · b224e5e2
      Luiz Capitulino 提交于
      Also fixes a few issues while there:
      
       1. The fd returned by monitor_get_fd() leaks in most error conditions
       2. monitor_get_fd() return value is not checked. Best case we get
          an error that is not correctly reported, worse case one of the
          functions using the fd (with value of -1) will explode
       3. A few error conditions aren't reported
       4. We now "use up" @fdname always.  Before, it was left alone for
          invalid @protocol
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      b224e5e2
  7. 14 9月, 2012 1 次提交
  8. 12 9月, 2012 1 次提交
  9. 06 9月, 2012 3 次提交
  10. 05 9月, 2012 1 次提交
  11. 22 8月, 2012 2 次提交
  12. 15 8月, 2012 1 次提交
    • C
      qapi: Introduce add-fd, remove-fd, query-fdsets · ba1c048a
      Corey Bryant 提交于
      This patch adds support that enables passing of file descriptors
      to the QEMU monitor where they will be stored in specified file
      descriptor sets.
      
      A file descriptor set can be used by a client like libvirt to
      store file descriptors for the same file.  This allows the
      client to open a file with different access modes (O_RDWR,
      O_WRONLY, O_RDONLY) and add/remove the passed fds to/from an fd
      set as needed.  This will allow QEMU to (in a later patch in this
      series) "open" and "reopen" the same file by dup()ing the fd in
      the fd set that corresponds to the file, where the fd has the
      matching access mode flag that QEMU requests.
      
      The new QMP commands are:
        add-fd: Add a file descriptor to an fd set
        remove-fd: Remove a file descriptor from an fd set
        query-fdsets: Return information describing all fd sets
      
      Note: These commands are not compatible with the existing getfd
      and closefd QMP commands.
      Signed-off-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ba1c048a
  13. 14 8月, 2012 7 次提交
  14. 08 8月, 2012 2 次提交