1. 25 7月, 2017 1 次提交
  2. 21 7月, 2017 1 次提交
  3. 20 7月, 2017 2 次提交
  4. 11 7月, 2017 3 次提交
  5. 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
  6. 16 6月, 2017 1 次提交
  7. 07 6月, 2017 1 次提交
  8. 05 6月, 2017 1 次提交
  9. 26 5月, 2017 1 次提交
  10. 09 5月, 2017 1 次提交
  11. 27 4月, 2017 1 次提交
  12. 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
  13. 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
  14. 04 3月, 2017 1 次提交
  15. 03 3月, 2017 1 次提交
    • N
      Fix location of blkid.h in include header · 2d8fbeb8
      Nehal J Wani 提交于
      The build system for libvirt correctly detects the location of blkid
      using PKG_CONFIG_PATH environment variable. The file blkid.pc states
      that the include flags should be: 'Cflags: -I${includedir}/blkid' but
      libvirt searches for blkid.h inside ${includedir}/blkid/blkid, which is
      wrong. Until now, the compilation for libvirt succeeded because of pure
      luck, as it had -I/usr/include as a CFLAG. This issue was faced while
      compiling libvirt on Ubuntu 16.04.2 with bare minimum dev packages and a
      custom compiled blkid kept in a non-standard $prefix.
      Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
      2d8fbeb8
  16. 23 2月, 2017 1 次提交
    • D
      Add ATTRIBUTE_FALLTHROUGH for switch cases without break · 5d84f596
      Daniel P. Berrange 提交于
      In GCC 7 there is a new warning triggered when a switch
      case has a conditional statement (eg if ... else...) and
      some of the code paths fallthrough to the next switch
      statement. e.g.
      
      conf/domain_conf.c: In function 'virDomainChrEquals':
      conf/domain_conf.c:14926:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
               if (src->targetTypeAttr != tgt->targetTypeAttr)
                  ^
      conf/domain_conf.c:14928:5: note: here
           case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
           ^~~~
      conf/domain_conf.c: In function 'virDomainChrDefFormat':
      conf/domain_conf.c:22143:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
               if (def->targetTypeAttr) {
                  ^
      conf/domain_conf.c:22151:5: note: here
           default:
           ^~~~~~~
      
      GCC introduced a __attribute__((fallthrough)) to let you
      indicate that this is intentionale behaviour rather than
      a bug.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5d84f596
  17. 12 1月, 2017 2 次提交
  18. 09 1月, 2017 2 次提交
    • D
      Add domain event for metadata changes · c5007017
      Daniel P. Berrange 提交于
      When changing the metadata via virDomainSetMetadata, we now
      emit an event to notify the app of changes. This is useful
      when co-ordinating different applications read/write of
      custom metadata.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c5007017
    • D
      lxc: ensure libvirt_lxc and qemu-nbd move into systemd machine slice · 44f79a0b
      Daniel P. Berrange 提交于
      Currently when spawning containers with systemd, the container PID 1
      will get moved into the systemd machine slice. Libvirt then manually
      moves the libvirt_lxc and qemu-nbd processes into the cgroups associated
      with the slice, but skips the systemd controller cgroup. This means that
      from systemd's POV, libvirt_lxc and qemu-nbd are still part of the
      libvirtd.service unit.
      
      On systemctl daemon-reload, it will notice that libvirt_lxc & qemu-nbd
      are in the libvirtd.service unit for the systemd controller, but in the
      machine cgroups for resources. Systemd will thus move them back into
      the libvirtd.service resource cgroups next time libvirtd is restarted.
      This causes libvirtd to kill off the container due to incorrect cgroup
      placement.
      
      The solution is to ensure that when moving libvirt_lxc & qemu-nbd, we
      also move the systemd cgroup controller placement. Normally this is
      not something we ever want todo, but this is a special case as we are
      intentionally wanting to move them to a different systemd unit.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      44f79a0b
  19. 15 12月, 2016 2 次提交
  20. 09 12月, 2016 2 次提交
  21. 08 12月, 2016 1 次提交
  22. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  23. 22 11月, 2016 1 次提交
  24. 10 11月, 2016 1 次提交
  25. 27 10月, 2016 1 次提交
  26. 22 10月, 2016 1 次提交
  27. 20 10月, 2016 1 次提交
    • J
      qemu: Introduce qemuDomainChardevPrivatePtr · 5f2a1327
      John Ferlan 提交于
      Modeled after the qemuDomainHostdevPrivatePtr (commit id '27726d8c'),
      create a privateData pointer in the _virDomainChardevDef to allow storage
      of private data for a hypervisor in order to at least temporarily store
      secret data for usage during qemuBuildCommandLine.
      
      NB: Since the qemu_parse_command (qemuParseCommandLine) code is not
      expecting to restore the secret data, there's no need to add code
      code to handle this new structure there.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5f2a1327
  28. 14 10月, 2016 1 次提交
  29. 13 10月, 2016 1 次提交
    • M
      src: Treat PID as signed · b7d2d4af
      Michal Privoznik 提交于
      This initially started as a fix of some debug printing in
      virCgroupDetect. However it turned out that other places suffer
      from the similar problem. While dealing with pids, esp. in cases
      where we cannot use pid_t for ABI stability reasons, we often
      chose an unsigned integer type. This makes no sense as pid_t is
      signed.
      Also, new syntax-check rule is introduced so we won't repeat this
      mistake.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b7d2d4af
  30. 12 10月, 2016 1 次提交
  31. 26 9月, 2016 1 次提交