1. 11 4月, 2018 1 次提交
    • J
      bhyve: Use virDomainObjListFindBy{UUID|ID}Ref · f52d0d42
      John Ferlan 提交于
      For bhyveDomObjFromDomain, bhyveDomainLookupByUUID, and
      bhyveDomainLookupByID 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.
      
      For bhyveDomainUndefine and bhyveDomainDestroy since the
      virDomainObjListRemove will return an unlocked object, we need to
      relock before making the EndAPI call.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f52d0d42
  2. 22 2月, 2018 2 次提交
  3. 09 11月, 2017 1 次提交
  4. 19 10月, 2017 1 次提交
  5. 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
  6. 18 9月, 2017 1 次提交
  7. 06 8月, 2017 1 次提交
  8. 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
  9. 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
  10. 27 3月, 2017 2 次提交
    • 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
  11. 15 3月, 2017 1 次提交
    • R
      bhyve: add config file support · 32b67545
      Roman Bogorodskiy 提交于
      Introduce config file support for the bhyve driver. The only available
      setting at present is 'firmware_dir' for specifying a directory with
      UEFI firmware files.
      32b67545
  12. 12 3月, 2017 1 次提交
  13. 31 1月, 2017 1 次提交
    • R
      bhyve: add virBhyveDriverCreateXMLConf · 13a050b2
      Roman Bogorodskiy 提交于
      Add virBhyveDriverCreateXMLConf, a simple wrapper around
      virDomainXMLOptionNew that makes it easier to pass bhyveConnPtr
      as a private data for parser. It will be used later for device
      address allocation at parsing time.
      
      Update consumers to use it instead of direct calls to
      virDomainXMLOptionNew.
      
      As we now have proper callbacks connected for the tests, update
      test files accordingly to include the automatically generated
      PCI root controller.
      13a050b2
  14. 09 1月, 2017 1 次提交
  15. 22 11月, 2016 1 次提交
  16. 22 10月, 2016 1 次提交
  17. 12 10月, 2016 1 次提交
  18. 29 9月, 2016 1 次提交
  19. 26 9月, 2016 1 次提交
  20. 11 7月, 2016 2 次提交
  21. 07 7月, 2016 1 次提交
  22. 17 6月, 2016 1 次提交
  23. 12 6月, 2016 1 次提交
  24. 10 6月, 2016 3 次提交
  25. 08 6月, 2016 1 次提交
  26. 07 6月, 2016 1 次提交
  27. 24 5月, 2016 1 次提交
  28. 20 5月, 2016 1 次提交
  29. 18 5月, 2016 2 次提交
  30. 17 5月, 2016 1 次提交
  31. 14 5月, 2016 1 次提交
  32. 05 5月, 2016 1 次提交
    • R
      bhyve: implement domainShutdown · 9e0bb1c8
      Roman Bogorodskiy 提交于
      Bhyve supports ACPI shutdown by issuing SIGTERM signal to a bhyve
      process.
      
      Add the bhyveDomainShutdown() function and virBhyveProcessShutdown()
      helper function that just sends SIGTERM to VM's bhyve process. If
      a guest supports ACPI shutdown then process will be terminated and
      this event will be noticed by the bhyve monitor code that will handle
      setting proper status and clean up VM's resources by calling
      virBhyveProcessStop().
      9e0bb1c8
  33. 29 3月, 2016 2 次提交