1. 03 12月, 2014 1 次提交
    • M
      qemu_migration: Send disk sizes to the other side · e1466dc7
      Michal Privoznik 提交于
      Up 'til now, users need to precreate non-shared storage on migration
      themselves. This is not very friendly requirement and we should do
      something about it. In this patch, the migration cookie is extended,
      so that <nbd/> section does not only contain NBD port, but info on
      disks being migrated. This patch sends a list of pairs of:
      
          <disk target; disk size>
      
      to the destination. The actual storage allocation is left for next
      commit.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e1466dc7
  2. 01 12月, 2014 2 次提交
    • W
      qemu: set jobinfo type to FAILED if job is failed in qemuMigrationRun · 11119821
      Wang Rui 提交于
      If job is failed in qemuMigrationRun, we expect the jobinfo type as
      FAILED. But jobinfo type won't be updated until entering
      qemuMigrationWaitForCompletion. We should make it updated in all
      conditions. Moreover, we can't use qemuMigrationUpdateJobStatus
      here because job may fail in libvirt, so we can't query job status
      from QEMU.
      Signed-off-by: NWang Rui <moon.wangrui@huawei.com>
      11119821
    • W
      qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions · 0b0cba4d
      Wang Rui 提交于
      The migration job status is traced in qemuMigrationUpdateJobStatus
      which is called in qemuMigrationRun. But if migration is cancelled
      before the trace such as in qemuMigrationDriveMirror, the jobinfo
      type won't be updated to CANCELLED. After this patch, we can get
      jobinfo type CANCELLED if migration is cancelled during drive
      mirror.  Moreover, we can't use qemuMigrationUpdateJobStatus
      because from qemu's point of view it's just the drive mirror being
      cancelled and the migration hasn't even started yet.
      Signed-off-by: NWang Rui <moon.wangrui@huawei.com>
      0b0cba4d
  3. 28 11月, 2014 1 次提交
    • J
      Fix usage of virReportSystemError · 9340528a
      Jiri Denemark 提交于
      virReportSystemError is reserved for reporting system errors, calling it
      with VIR_ERR_* error codes produces error messages that do not make any
      sense, such as
      
          internal error: guest failed to start: Kernel doesn't support user
          namespace: Link has been severed
      
      We should prohibit wrong usage with a syntax-check rule.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      9340528a
  4. 20 11月, 2014 2 次提交
  5. 15 11月, 2014 1 次提交
  6. 14 11月, 2014 1 次提交
  7. 13 11月, 2014 1 次提交
  8. 06 11月, 2014 1 次提交
    • J
      Free job statistics from the migration cookie · 1d1c5ecd
      Ján Tomko 提交于
      ==404== 232 bytes in 1 blocks are definitely lost in loss record 669 of 758
      ==404==    at 0x4C2B934: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==404==    by 0x52A2BF3: virAlloc (viralloc.c:144)
      ==404==    by 0x1D49AD70: qemuMigrationCookieAddStatistics (qemu_migration.c:554)
      ==404==    by 0x1D49AD70: qemuMigrationBakeCookie (qemu_migration.c:1228)
      ==404==    by 0x1D4A43B8: qemuMigrationFinish (qemu_migration.c:5002)
      ==404==    by 0x1D4C9339: qemuDomainMigrateFinish3Params (qemu_driver.c:11526)
      
      Introduced by commit 5d6fb963
      1d1c5ecd
  9. 04 11月, 2014 1 次提交
  10. 31 10月, 2014 1 次提交
  11. 22 10月, 2014 1 次提交
  12. 15 10月, 2014 1 次提交
  13. 30 9月, 2014 1 次提交
    • J
      Don't verify CPU features with host-passthrough · ec5f817f
      Ján Tomko 提交于
      Commit fba6bc47 introduced the non-migratable invtsc feature,
      breaking save/migration with host-model and host-passthrough.
      
      On hosts with this feature present it was automatically included
      in the CPU definition, regardless of QEMU support.
      
      Commit de0aeafe stopped including it by default for host-model,
      but failed to fix host-passthrough.
      
      This commit ignores checking of CPU features with host-passthrough,
      since we don't pass them to QEMU (only -cpu host is passed),
      allowing domains using host-passthrough that were saved with
      the broken version of libvirtd to be restored.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1147584
      ec5f817f
  14. 23 9月, 2014 6 次提交
  15. 12 9月, 2014 1 次提交
    • E
      blockcopy: add qemu implementation of new tunables · eef91f94
      Eric Blake 提交于
      Upstream qemu 1.4 added some drive-mirror tunables not present
      when it was first introduced in 1.3.  Management apps may want
      to set these in some cases (for example, without tuning
      granularity down to sector size, a copy may end up occupying
      more bytes than the original because an entire cluster is
      copied even when only a sector within the cluster is dirty,
      although tuning it down results in more CPU time to do the
      copy).  I haven't personally needed to use the parameters, but
      since they exist, and since the new API supports virTypedParams,
      we might as well expose them.
      
      Since the tuning parameters aren't often used, and omitted from
      the QMP command when unspecified, I think it is safe to rely on
      qemu 1.3 to issue an error about them being unsupported, rather
      than trying to create a new capability bit in libvirt.
      
      Meanwhile, all versions of qemu from 1.4 to 2.1 have a bug where
      a bad granularity (such as non-power-of-2) gives a poor message:
      error: internal error: unable to execute QEMU command 'drive-mirror': Invalid parameter 'drive-virtio-disk0'
      
      because of abuse of QERR_INVALID_PARAMETER (which is supposed to
      name the parameter that was given a bad value, rather than the
      value passed to some other parameter).  I don't see that a
      capability check will help, so we'll just live with it (and it
      has since been improved in upstream qemu).
      
      * src/qemu/qemu_monitor.h (qemuMonitorDriveMirror): Add
      parameters.
      * src/qemu/qemu_monitor.c (qemuMonitorDriveMirror): Likewise.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDriveMirror):
      Likewise.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDriveMirror):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainBlockCopyCommon): Likewise.
      (qemuDomainBlockRebase, qemuDomainBlockCopy): Adjust callers.
      * src/qemu/qemu_migration.c (qemuMigrationDriveMirror): Likewise.
      * tests/qemumonitorjsontest.c (qemuMonitorJSONDriveMirror): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eef91f94
  16. 11 9月, 2014 1 次提交
  17. 10 9月, 2014 5 次提交
    • J
      qemu: Transfer recomputed stats back to source · a1c0180d
      Jiri Denemark 提交于
      After the previous commit, migration statistics on the source and
      destination hosts are not equal because the destination updated time
      statistics. Let's send the result back so that the same data can be
      queried on both sides of the migration.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      a1c0180d
    • J
      qemu: Recompute downtime and total time when migration completes · eaee338a
      Jiri Denemark 提交于
      Total time of a migration and total downtime transfered from a source to
      a destination host do not count with the transfer time to the
      destination host and with the time elapsed before guest CPUs are
      resumed. Thus, source libvirtd remembers when migration started and when
      guest CPUs were paused. Both timestamps are transferred to destination
      libvirtd which uses them to compute total migration time and total
      downtime. Obviously, this requires the time to be synchronized between
      the two hosts. The reported times are useless otherwise but they would
      be equally useless if we didn't do this recomputation so don't lose
      anything by doing it.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      eaee338a
    • J
      qemu: Transfer migration statistics to destination · 5d6fb963
      Jiri Denemark 提交于
      When migrating a transient domain or with VIR_MIGRATE_UNDEFINE_SOURCE
      flag, the domain may disappear from source host. And so will migration
      statistics associated with the domain. We need to transfer the
      statistics at the end of a migration so that they can be queried at the
      destination host.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      5d6fb963
    • J
      Add support for fetching statistics of completed jobs · 3a868816
      Jiri Denemark 提交于
      virDomainGetJobStats gains new VIR_DOMAIN_JOB_STATS_COMPLETED flag that
      can be used to fetch statistics of a completed job rather than a
      currently running job.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      3a868816
    • J
      Refactor job statistics · 6fcddfcd
      Jiri Denemark 提交于
      Job statistics data were tracked in several structures and variables.
      Let's make a new qemuDomainJobInfo structure which can be used as a
      single source of statistics data as a preparation for storing data about
      completed a job.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      6fcddfcd
  18. 08 9月, 2014 2 次提交
  19. 06 9月, 2014 2 次提交
    • E
      blockjob: allow finer bandwidth tuning for query · db33cc24
      Eric Blake 提交于
      While reviewing the new virDomainBlockCopy API, Peter Krempa
      pointed out that our existing design of using MiB/s for block
      job bandwidth is rather coarse, especially since qemu tracks
      it in bytes/s; so virDomainBlockCopy only accepts bytes/s.
      But once the new API is implemented for qemu, we will be in
      the situation where it is possible to set a value that cannot
      be accurately reflected back to the user, because the existing
      virDomainGetBlockJobInfo defaults to the coarser units.
      
      Fortunately, we have an escape hatch; and one that has already
      served us well in the past: we can use the flags argument to
      specify which scale to use (see virDomainBlockResize for prior
      art).  This patch fixes the query side of the API; made easier
      by previous patches that split the query side out from the
      modification code.  Later patches will address the virsh
      interface, as well retrofitting all other blockjob APIs to
      also accept a flag for toggling bandwidth units.
      
      * include/libvirt/libvirt.h.in (_virDomainBlockJobInfo)
      (VIR_DOMAIN_BLOCK_COPY_BANDWIDTH): Document sizing issues.
      (virDomainBlockJobInfoFlags): New enum.
      * src/libvirt.c (virDomainGetBlockJobInfo): Document new flag.
      * src/qemu/qemu_monitor.h (qemuMonitorBlockJobInfo): Add parameter.
      * src/qemu/qemu_monitor.c (qemuMonitorBlockJobInfo): Likewise.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockJobInfo):
      Likewise.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockJobInfo)
      (qemuMonitorJSONGetBlockJobInfoOne): Likewise. Don't scale here.
      * src/qemu/qemu_migration.c (qemuMigrationDriveMirror): Update
      callers.
      * src/qemu/qemu_driver.c (qemuDomainBlockPivot)
      (qemuDomainBlockJobImpl): Likewise.
      (qemuDomainGetBlockJobInfo): Likewise, and support new flag.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      db33cc24
    • E
      blockjob: split out block info monitor handling · ced81365
      Eric Blake 提交于
      Another layer of overly-multiplexed code that deserves to be
      split into obviously separate paths for query vs. modify.
      This continues the cleanup started in commit cefe0ba3.
      
      In the process, make some tweaks to simplify the logic when
      parsing the JSON reply.  There should be no user-visible
      semantic changes.
      
      * src/qemu/qemu_monitor.h (qemuMonitorBlockJob): Drop parameter.
      (qemuMonitorBlockJobInfo): New prototype.
      (BLOCK_JOB_INFO): Drop enum.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockJob)
      (qemuMonitorJSONBlockJobInfo): Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Split...
      (qemuMonitorBlockJobInfo): ...into second function.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockJob): Move
      block info portions...
      (qemuMonitorJSONGetBlockJobInfo): ...here, and rename...
      (qemuMonitorJSONBlockJobInfo): ...and export.
      (qemuMonitorJSONGetBlockJobInfoOne): Alter return semantics.
      * src/qemu/qemu_driver.c (qemuDomainBlockPivot)
      (qemuDomainBlockJobImpl, qemuDomainGetBlockJobInfo): Adjust
      callers.
      * src/qemu/qemu_migration.c (qemuMigrationDriveMirror)
      (qemuMigrationCancelDriveMirror): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ced81365
  20. 14 8月, 2014 1 次提交
  21. 12 8月, 2014 1 次提交
  22. 08 7月, 2014 1 次提交
  23. 04 7月, 2014 1 次提交
  24. 03 7月, 2014 1 次提交
    • J
      Use virBufferCheckError everywhere we report OOM error · 92a8e72f
      Ján Tomko 提交于
      Replace:
      if (virBufferError(&buf)) {
          virBufferFreeAndReset(&buf);
          virReportOOMError();
          ...
      }
      
      with:
      if (virBufferCheckError(&buf) < 0)
          ...
      
      This should not be a functional change (unless some callers
      misused the virBuffer APIs - a different error would be reported
      then)
      92a8e72f
  25. 02 7月, 2014 2 次提交
  26. 25 6月, 2014 1 次提交
    • J
      qemu: enum cleanups in "src/qemu/*" · aa990efe
      Julio Faracco 提交于
      As we are doing with the enum structures, a cleanup in "src/qemu/"
      directory was done now. All the enums that were defined in the
      header files were converted to typedefs in this directory. This
      patch includes all the adjustments to remove conflicts when you do
      this kind of change. "Enum-to-typedef"'s conversions were made in
      "src/qemu/qemu_{capabilities, domain, migration, hotplug}.h".
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      aa990efe