1. 23 4月, 2018 1 次提交
  2. 20 4月, 2018 5 次提交
  3. 18 4月, 2018 1 次提交
  4. 12 4月, 2018 4 次提交
  5. 09 11月, 2017 1 次提交
  6. 25 7月, 2017 1 次提交
  7. 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
  8. 07 6月, 2017 1 次提交
  9. 05 6月, 2017 1 次提交
  10. 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
  11. 27 3月, 2017 3 次提交
    • M
      util: Fix naming in util/virnodesuspend · d2d1dec1
      Martin Kletzander 提交于
      That file has only two exported files and each one of them has
      different naming.  virNode is what all the other files use, so let's
      use it.  It wasn't used before because the clash with public API
      naming, so let's fix that by shortening the name (there is no other
      private variant of it anyway).
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d2d1dec1
    • M
      Remove src/nodeinfo · 26ae4e48
      Martin Kletzander 提交于
      There is no "node driver" as there was before, drivers have to do
      their own ACL checking anyway, so they all specify their functions and
      nodeinfo is basically just extending conf/capablities.  Hence moving
      the code to src/conf/ is the right way to go.
      
      Also that way we can de-duplicate some code that is in virsysfs and/or
      virhostcpu that got duplicated during the virhostcpu.c split.  And
      Some cleanup is done throughout the changes, like adding the vir*
      prefix etc.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      26ae4e48
    • M
      Move src/fdstream to src/util/virfdstream · bdcb1995
      Martin Kletzander 提交于
      There is no reason for it not to be in the utils, all global symbols
      under that file already have prefix vir* and there is no reason for it
      to be part of DRIVER_SOURCES because that is just a leftover from
      older days (pre-driver modules era, I believe).
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      bdcb1995
  12. 09 12月, 2016 1 次提交
  13. 22 11月, 2016 1 次提交
  14. 22 10月, 2016 1 次提交
  15. 12 10月, 2016 1 次提交
  16. 26 9月, 2016 3 次提交
  17. 09 9月, 2016 1 次提交
  18. 17 6月, 2016 1 次提交
  19. 10 6月, 2016 5 次提交
  20. 08 6月, 2016 2 次提交
  21. 07 6月, 2016 2 次提交
  22. 06 6月, 2016 2 次提交
    • J
      Do not check for domain liveness in virDomainObjSetDefTransient · 8c40ede4
      Ján Tomko 提交于
      Remove the live attribute and mark the definition as transient
      whether the domain is runing or not.
      
      There were only two callers left calling with live=false:
      * testDomainStartState, where the domain already is active
        because we assigned vm->def->id just a few lines above the call
      * virDomainObjGetPersistentDef, which now only calls
        virDomainObjSetDefTransient for an active domain
      8c40ede4
    • J
      Clean up redundant usage of virDomainObjSetDefTransient · 9b111048
      Ján Tomko 提交于
      Commit 45ec297d from November 2010:
          Make state driver device hotplug/update actually transient
      added virDomainObjSetDefTransient calls to the domain startup
      function in several drivers.
      
      In November 2011, commit 8866eed0:
          Set aliases for LXC/UML console devices
      added a call earlier in the startup function, without removing the
      existing ones.
      
      Also, in the UML driver it seems the function never did anything
      useful - vm->def->id is set asynchronnously in umlNotifyEvent.
      At the time of calling virDomainObjSetDefTransient with live=false,
      vm->def->id was likely still -1, making the call a no-op.
      9b111048