1. 12 1月, 2017 1 次提交
    • M
      lxc: Move lxcContainerAvailable to virprocess · 083fcd06
      Michal Privoznik 提交于
      Other drivers (like qemu) would like to know if the namespaces
      are available therefore it makes sense to move this function to
      a shared module.
      
      At the same time, this function had some default namespaces that
      are checked with every call. It is not necessary - let callers
      pass just those namespaces they are interested in.
      
      With the move the function is renamed to
      virProcessNamespaceAvailable.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      083fcd06
  2. 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
  3. 15 12月, 2016 2 次提交
  4. 09 12月, 2016 2 次提交
  5. 08 12月, 2016 1 次提交
  6. 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
  7. 22 11月, 2016 1 次提交
  8. 10 11月, 2016 1 次提交
  9. 27 10月, 2016 1 次提交
  10. 22 10月, 2016 1 次提交
  11. 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
  12. 14 10月, 2016 1 次提交
  13. 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
  14. 12 10月, 2016 1 次提交
  15. 26 9月, 2016 3 次提交
  16. 09 9月, 2016 1 次提交
  17. 06 9月, 2016 1 次提交
    • M
      Make sure sys/types.h is included after sys/sysmacros.h · f3f15cc2
      Michal Privoznik 提交于
      In the latest glibc, major() and minor() functions are marked as
      deprecated (glibc commit dbab6577):
      
        CC       util/libvirt_util_la-vircgroup.lo
      util/vircgroup.c: In function 'virCgroupGetBlockDevString':
      util/vircgroup.c:768:5: error: '__major_from_sys_types' is deprecated:
        In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
        For historical compatibility, it is currently defined by
        <sys/types.h> as well, but we plan to remove this soon.
        To use `major', include <sys/sysmacros.h> directly.
        If you did not intend to use a system-defined macro `major',
        you should #undef it after including <sys/types.h>.
        [-Werror=deprecated-declarations]
           if (virAsprintf(&ret, "%d:%d ", major(sb.st_rdev), minor(sb.st_rdev)) < 0)
           ^~
      In file included from /usr/include/features.h:397:0,
                       from /usr/include/bits/libc-header-start.h:33,
                       from /usr/include/stdio.h:28,
                       from ../gnulib/lib/stdio.h:43,
                       from util/vircgroup.c:26:
      /usr/include/sys/sysmacros.h:87:1: note: declared here
       __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL)
       ^
      
      Moreover, in the glibc commit, there's suggestion to keep
      ordering of including of header files as implemented here.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f3f15cc2
  18. 17 8月, 2016 1 次提交
    • A
      util: Make virStringArrayHasString() const-correct · 3edcf834
      Andrea Bolognani 提交于
      The first argument should be const char ** instead of
      char **, because this is a search function and as such it
      doesn't, and shouldn't, alter the haystack in any way.
      
      This change means we no longer have to cast arrays of
      immutable strings to arrays of mutable strings; we still
      have to do the opposite, though, but that's reasonable.
      3edcf834
  19. 16 8月, 2016 2 次提交
  20. 05 8月, 2016 1 次提交
    • M
      lxcDomainCreateXMLWithFiles: Avoid crash · 5f5a5a42
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1363773
      
      Imagine that you're creating a transient domain, but for some reason,
      starting it fails. That is virLXCProcessStart() returns an error. With
      current code, in the error handling code the domain object is removed
      from the domain object list, @vm is set to NULL and controls jump to
      enjob label where virLXCDomainObjEndJob() is called which dereference vm
      leading to instant crash.
      
      The fix is to end the job in the error handling code and only after that
      remove the domain from the list and jump onto cleanup label instead of
      endjob.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5f5a5a42
  21. 24 7月, 2016 1 次提交
  22. 22 7月, 2016 1 次提交
    • K
      lxc: make container's init process session leader · f96cd890
      Katerina Koukiou 提交于
      This patch forces container's init process, to become a session leader,
      that is its session ID is made the same as its process ID.
      That might seem unnecessary in general, but if we want to checkpoint a
      container with CRIU, which is needed for container migration,
      we must ensure that the SID of each process inside the container points
      to a process that lives in the same PID namespace as the container.
      Therefore, we force that the session leader is the init.
      Signed-off-by: NKaterina Koukiou <k.koukiou@gmail.com>
      f96cd890
  23. 19 7月, 2016 3 次提交
  24. 12 7月, 2016 1 次提交
  25. 11 7月, 2016 1 次提交
    • P
      conf: Add private data for virDomainVcpuDef · 5fe0b6b0
      Peter Krempa 提交于
      Allow to store driver specific data on a per-vcpu basis.
      
      Move of the virDomainDef*Vcpus* functions was necessary as
      virDomainXMLOptionPtr was declared below this block and I didn't want to
      split the function headers.
      5fe0b6b0
  26. 07 7月, 2016 2 次提交
  27. 02 7月, 2016 2 次提交
    • L
      lxc: support setting host-side IP addresses/routes · 18792027
      Laine Stump 提交于
      (This patch had been pushed earlier in
      commit cd5c9f21, but was reverted in
      commit 1549f168 because it had been
      accidentally pushed during the freeze for release 2.0.0)
      18792027
    • L
      util: new function virNetDevIPInfoAddToDev · 95309424
      Laine Stump 提交于
      This patch takes the code out of
      lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
      IP routes to the interface, and puts it into a utility function
      virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
      anyone.
      
      One small change in functionality -
      lxcContainerRenameAndEnableInterfaces() previously would add all IP
      addresses to the interface while it was still offline, then set the
      interface online, and then add the routes. Because I don't want the
      utility function to set the interface online, I've moved this up so
      the interface is first set online, then IP addresses and routes are
      added. This is the same order that the network service from
      initscripts (in ifup-ether) does it, so it shouldn't pose any problem
      (and hasn't, in the tests that I've run).
      
      (This patch had been pushed earlier in commit
      f1e0d0da, but was reverted in commit
      05eab475 because it had been
      accidentally pushed during the freeze for release 2.0.0)
      95309424
  28. 27 6月, 2016 3 次提交