1. 17 3月, 2018 1 次提交
    • J
      libxl: MigrateBegin: Dont call EndAPI in helper function · 64370c4b
      Jim Fehlig 提交于
      The libxlDomainMigrateBegin3Params API locks and ref counts the associated
      virDomainObj but relies on the helper function libxlDomainMigrationBegin
      to unref/unlock the object. libxlDomainMigrationBegin is also used by
      libxlDomainMigratePerform3Params for p2p migration, but in that case the
      lock/ref and unref/unlock are properly handled in the API entry point. So
      p2p migrations suffer a double unref/unlock in the Perform API.
      
      Remove the unref/unlock (virDomainObjEndAPI) from libxlDomainMigrationBegin
      and adjust libxlDomainMigrateBegin3Params to properly unref/unlock
      the virDomainObj on success and error paths.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      64370c4b
  2. 16 3月, 2018 1 次提交
  3. 24 2月, 2018 1 次提交
    • J
      libxl: round memory values to next 1MiB increment · ef71caea
      Jim Fehlig 提交于
      libxl requires the memory sizes to be rounded to 1MiB increments.
      Attempting to start a domain that violates this requirement will
      fail with the marginally helpful error
      
      2018-02-22 01:55:32.921+0000: xc: panic: xc_dom_boot.c:141: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory
      2018-02-22 01:55:32.921+0000: libxl: libxl_dom.c:671:libxl__build_dom: xc_dom_boot_mem_init failed: No such file or directory
      
      Round the maximum and current memory values to the next 1MiB
      increment when generating the libxl_domain_config object.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      ef71caea
  4. 23 2月, 2018 1 次提交
  5. 22 2月, 2018 6 次提交
  6. 20 2月, 2018 1 次提交
    • D
      conf: add enum constants for default controller models · a302480d
      Daniel P. Berrangé 提交于
      The controller model is slightly unusual in that the default value is
      -1, not 0. As a result the default value is not covered by any of the
      existing enum cases. This in turn means that any switch() statements
      that think they have covered all cases, will in fact not match the
      default value at all. In the qemuDomainDeviceCalculatePCIConnectFlags()
      method this has caused a serious mistake where we fallthrough from the
      SCSI controller case, to the VirtioSerial controller case, and from
      the USB controller case to the IDE controller case.
      
      By adding explicit enum constant starting at -1, we can ensure switches
      remember to handle the default case.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      a302480d
  7. 09 2月, 2018 1 次提交
  8. 26 1月, 2018 1 次提交
    • J
      libxl: resume lock process after failed migration · 0c710a37
      Jim Fehlig 提交于
      During migration, the lock process is paused in the perform phase
      but not resumed if there is a subsequent failure, leaving the locked
      resource unprotected.
      
      The perform phase itself can fail, in which case the lock process
      should be resumed before returning from perform. The finish phase
      could also fail on the destination host, in which case the migration
      is canceled in the confirm phase and the VM is resumed. The lock
      process needs to be resumed there as well.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      0c710a37
  9. 16 12月, 2017 1 次提交
  10. 09 12月, 2017 1 次提交
  11. 13 11月, 2017 1 次提交
  12. 09 11月, 2017 1 次提交
  13. 07 11月, 2017 1 次提交
  14. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  15. 19 10月, 2017 2 次提交
  16. 16 10月, 2017 2 次提交
  17. 14 10月, 2017 3 次提交
  18. 12 10月, 2017 1 次提交
  19. 05 10月, 2017 2 次提交
  20. 21 9月, 2017 1 次提交
    • J
      cpu_conf: Drop updateCPU from virCPUDefFormat · 4fd179f5
      Jiri Denemark 提交于
      In the past we updated host-model CPUs with host CPU data by adding a
      model and features, but keeping the host-model mode. And since the CPU
      model is not normally formatted for host-model CPU defs, we had to pass
      the updateCPU flag to the formatting code to be able to properly output
      updated host-model CPUs. Libvirt doesn't do this anymore, host-model
      CPUs are turned into custom mode CPUs once updated with host CPU data
      and thus there's no reason for keeping the hacks inside CPU XML
      formatters.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      4fd179f5
  21. 20 9月, 2017 1 次提交
  22. 18 9月, 2017 1 次提交
  23. 04 9月, 2017 1 次提交
  24. 24 8月, 2017 1 次提交
  25. 08 8月, 2017 1 次提交
    • J
      introduce virConfReadString · e9f32227
      Ján Tomko 提交于
      Rewrite virConfReadMem to take a null-terminated string.
      All the callers were calling strlen on it anyway.
      e9f32227
  26. 25 7月, 2017 1 次提交
  27. 24 7月, 2017 1 次提交
  28. 11 7月, 2017 1 次提交
  29. 25 6月, 2017 1 次提交
    • J
      events: Avoid double free possibility on remote call failure · 2065499b
      John Ferlan 提交于
      If a remote call fails during event registration (more than likely from
      a network failure or remote libvirtd restart timed just right), then when
      calling the virObjectEventStateDeregisterID we don't want to call the
      registered @freecb function because that breaks our contract that we
      would only call it after succesfully returning.  If the @freecb routine
      were called, it could result in a double free from properly coded
      applications that free their opaque data on failure to register, as seen
      in the following details:
      
          Program terminated with signal 6, Aborted.
          #0  0x00007fc45cba15d7 in raise
          #1  0x00007fc45cba2cc8 in abort
          #2  0x00007fc45cbe12f7 in __libc_message
          #3  0x00007fc45cbe86d3 in _int_free
          #4  0x00007fc45d8d292c in PyDict_Fini
          #5  0x00007fc45d94f46a in Py_Finalize
          #6  0x00007fc45d960735 in Py_Main
          #7  0x00007fc45cb8daf5 in __libc_start_main
          #8  0x0000000000400721 in _start
      
      The double dereference of 'pyobj_cbData' is triggered in the following way:
      
          (1) libvirt_virConnectDomainEventRegisterAny is invoked.
          (2) the event is successfully added to the event callback list
              (virDomainEventStateRegisterClient in
              remoteConnectDomainEventRegisterAny returns 1 which means ok).
          (3) when function remoteConnectDomainEventRegisterAny is hit,
              network connection disconnected coincidently (or libvirtd is
              restarted) in the context of function 'call' then the connection
              is lost and the function 'call' failed, the branch
              virObjectEventStateDeregisterID is therefore taken.
          (4) 'pyobj_conn' is dereferenced the 1st time in
              libvirt_virConnectDomainEventFreeFunc.
          (5) 'pyobj_cbData' (refered to pyobj_conn) is dereferenced the
               2nd time in libvirt_virConnectDomainEventRegisterAny.
          (6) the double free error is triggered.
      
      Resolve this by adding a @doFreeCb boolean in order to avoid calling the
      freeCb in virObjectEventStateDeregisterID for any remote call failure in
      a remoteConnect*EventRegister* API. For remoteConnect*EventDeregister* calls,
      the passed value would be true indicating they should run the freecb if it
      exists; whereas, it's false for the remote call failure path.
      
      Patch based on the investigation and initial patch posted by
      fangying <fangying1@huawei.com>.
      2065499b
  30. 13 6月, 2017 1 次提交