1. 15 11月, 2012 1 次提交
  2. 24 10月, 2012 10 次提交
    • P
      qmp: handle stop/cont in INMIGRATE state · 1e998146
      Paolo Bonzini 提交于
      Right now, stop followed by an incoming migration will let the
      virtual machine start.  cont before an incoming migration instead
      will fail.
      
      This is bad because the actual behavior is not predictable; it is
      racy with respect to the start of the incoming migration.  That's
      because incoming migration is blocking, and thus will delay the
      processing of stop/cont until the end of the migration.
      
      In addition, there's nothing that really prevents the user from
      typing the block device's passwords before incoming migration is
      done, so returning the DeviceEncrypted error is also helpful in
      the QMP case.
      
      Both things can be fixed by just toggling the autostart variable when
      stop/cont are called in INMIGRATE state.
      
      Note that libvirt is currently working around the race by looping
      if the MigrationExpected answer is returned.  After this patch, the
      command will return right away without ever raising an error.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      1e998146
    • 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
    • P
      qmp: add NBD server commands · 6dd844db
      Paolo Bonzini 提交于
      Adding an NBD server inside QEMU is trivial, since all the logic is
      in nbd.c and can be shared easily between qemu-nbd and QEMU itself.
      The main difference is that qemu-nbd serves a single unnamed export,
      while QEMU serves named exports.
      Acked-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6dd844db
    • P
      qapi: add socket address types · 5be8c759
      Paolo Bonzini 提交于
      Acked-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5be8c759
  3. 18 10月, 2012 3 次提交
  4. 03 10月, 2012 1 次提交
  5. 29 9月, 2012 7 次提交
  6. 27 9月, 2012 3 次提交
  7. 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
  8. 14 9月, 2012 1 次提交
  9. 12 9月, 2012 1 次提交
  10. 06 9月, 2012 3 次提交
  11. 05 9月, 2012 1 次提交
  12. 22 8月, 2012 2 次提交
  13. 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
  14. 14 8月, 2012 5 次提交