1. 23 4月, 2018 1 次提交
  2. 20 4月, 2018 2 次提交
    • J
      vz: Use virDomainObjListFindBy{UUID|ID}Ref · 3c66d510
      John Ferlan 提交于
      For vzDomainLookupByID and vzDomainLookupByUUID let's
      return a locked and referenced @vm object so that callers
      can then use the common and more consistent virDomainObjEndAPI
      in order to handle cleanup rather than needing to know that the
      returned object is locked and calling virObjectUnlock.
      
      The LookupByName already returns the ref counted and locked object,
      so this will make things more consistent.
      
      Also adjust the prlsdkHandle{VmState|VmRemoved|Perf}Event APIs
      in the same manner.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      3c66d510
    • J
      vz: Unify vzDomObjFromDomain{Ref} · d758374d
      John Ferlan 提交于
      Rather than have two API's doing different things for different
      callers, let's make one API that will always return a locked and
      ref counted object. That way, the callers will always know that
      they must call virDomainObjEndAPI and not have to decide whether
      they should call virObjectUnlock instead.
      
      This will make things consistent with LookupByName which returns
      the locked and ref counted object.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      d758374d
  3. 19 4月, 2018 1 次提交
  4. 18 4月, 2018 2 次提交
  5. 12 4月, 2018 4 次提交
  6. 16 3月, 2018 1 次提交
  7. 28 2月, 2018 1 次提交
  8. 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
  9. 18 10月, 2017 1 次提交
  10. 14 10月, 2017 1 次提交
  11. 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
  12. 18 9月, 2017 1 次提交
  13. 29 6月, 2017 1 次提交
  14. 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
  15. 07 6月, 2017 2 次提交
  16. 05 6月, 2017 1 次提交
  17. 24 5月, 2017 1 次提交
  18. 09 5月, 2017 1 次提交
  19. 18 4月, 2017 2 次提交
  20. 04 4月, 2017 1 次提交
  21. 03 4月, 2017 1 次提交
    • M
      virGetDomain: Set domain ID too · 5683b213
      Michal Privoznik 提交于
      So far our code is full of the following pattern:
      
        dom = virGetDomain(conn, name, uuid)
        if (dom)
            dom->id = 42;
      
      There is no reasong why it couldn't be just:
      
        dom = virGetDomain(conn, name, uuid, id);
      
      After all, client domain representation consists of tuple (name,
      uuid, id).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5683b213
  22. 27 3月, 2017 2 次提交
  23. 14 3月, 2017 3 次提交
  24. 24 2月, 2017 1 次提交
  25. 23 2月, 2017 1 次提交
  26. 31 1月, 2017 5 次提交