1. 07 2月, 2017 8 次提交
    • M
      qemuDomainCreateDevice: Properly deal with symlinks · 54ed6722
      Michal Privoznik 提交于
      Imagine you have a disk with the following source set up:
      
      /dev/disk/by-uuid/$uuid (symlink to) -> /dev/sda
      
      After cbc45525 the transitive end of the symlink chain is
      created (/dev/sda), but we need to create any item in chain too.
      Others might rely on that.
      In this case, /dev/disk/by-uuid/$uuid comes from domain XML thus
      it is this path that secdriver tries to relabel. Not the resolved
      one.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      54ed6722
    • M
      qemuDomain{Attach,Detach}Device NS helpers: Don't relabel devices · b621291f
      Michal Privoznik 提交于
      After previous commit this has become redundant step.
      Also setting up devices in namespace and setting their label
      later on are two different steps and should be not done at once.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b621291f
    • M
      qemu_security: Use more transactions · 0f0fcc2c
      Michal Privoznik 提交于
      The idea is to move all the seclabel setting to security driver.
      Having the relabel code spread all over the place looks very
      messy.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0f0fcc2c
    • M
      qemuSecurityRestoreAllLabel: Don't use transactions · 3e6839d4
      Michal Privoznik 提交于
      Because of the nature of security driver transactions, it is
      impossible to use them properly. The thing is, transactions enter
      the domain namespace and commit all the seclabel changes.
      However, in RestoreAllLabel() this is impossible - the qemu
      process, the only process running in the namespace, is gone. And
      thus is the namespace. Therefore we shouldn't use the transactions
      as there is no namespace to enter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3e6839d4
    • M
      qemuDomainPrepareDisk: Fix ordering · 0a465238
      Michal Privoznik 提交于
      The current ordering is as follows:
      1) set label
      2) create the device in namespace
      3) allow device in the cgroup
      
      While this might work for now, it will definitely not work if the
      security driver would use transactions as in that case there
      would be no device to relabel in the domain namespace as the
      device is created in the second step.
      Swap steps 1) and 2) to allow security driver to use more
      transactions.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0a465238
    • M
      util: Introduce virFileReadLink · 6094169b
      Michal Privoznik 提交于
      We will need to traverse the symlinks one step at the time.
      Therefore we need to see where a symlink is pointing to.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6094169b
    • M
      virProcessRunInMountNamespace: Report errors from child · 3172d267
      Michal Privoznik 提交于
      The comment to the function states that the errors from the child
      process are reported. Well, the error buffer is filled with
      possible error messages. But then it is thrown away. Among with
      important error message from the child process.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3172d267
    • M
      xenFormatXLDisk: Don't leak @target · aaf0ac7e
      Michal Privoznik 提交于
      ==11260== 1,006 bytes in 1 blocks are definitely lost in loss record 106 of 111
      ==11260==    at 0x4C2AE5F: malloc (vg_replace_malloc.c:297)
      ==11260==    by 0x4C2BDFF: realloc (vg_replace_malloc.c:693)
      ==11260==    by 0x4EA430B: virReallocN (viralloc.c:245)
      ==11260==    by 0x4EA7C52: virBufferGrow (virbuffer.c:130)
      ==11260==    by 0x4EA7D28: virBufferAdd (virbuffer.c:165)
      ==11260==    by 0x4EA8E10: virBufferStrcat (virbuffer.c:718)
      ==11260==    by 0x42D263: xenFormatXLDiskSrcNet (xen_xl.c:960)
      ==11260==    by 0x42D4EB: xenFormatXLDiskSrc (xen_xl.c:1015)
      ==11260==    by 0x42D870: xenFormatXLDisk (xen_xl.c:1101)
      ==11260==    by 0x42DA89: xenFormatXLDomainDisks (xen_xl.c:1148)
      ==11260==    by 0x42EAF8: xenFormatXL (xen_xl.c:1558)
      ==11260==    by 0x40E85F: testCompareParseXML (xlconfigtest.c:105)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      aaf0ac7e
  2. 04 2月, 2017 2 次提交
    • J
      util: Fix domain object leaks on closecallbacks · 48ad6009
      John Ferlan 提交于
      Originally/discovered proposed by "Wang King <king.wang@huawei.com>"
      
      When the virCloseCallbacksSet is first called, it increments the refcnt
      on the domain object to ensure it doesn't get deleted before the callback
      is called. The refcnt would be decremented in virCloseCallbacksUnset once
      the entry is removed from the closeCallbacks has table.
      
      When (mostly) normal shutdown occurs, the qemuProcessStop will end up
      calling qemuProcessAutoDestroyRemove and will remove the callback from
      the list and hash table normally and decrement the refcnt.
      
      However, when qemuConnectClose calls virCloseCallbacksRun, it will scan
      the (locked) closeCallbacks list for matching domain and callback function.
      If an entry is found, it will be removed from the closeCallbacks list and
      placed into a lookaside list to be processed when the closeCallbacks lock
      is dropped. The callback function (e.g. qemuProcessAutoDestroy) is called
      and will run qemuProcessStop. That code will fail to find the callback
      in the list when qemuProcessAutoDestroyRemove is called and thus not decrement
      the domain refcnt. Instead since the entry isn't found the code will just
      return (mostly) harmlessly.
      
      This patch will resolve the issue by taking another ref during the
      search UUID process during virCloseCallackRun, decrementing the refcnt
      taken by virCloseCallbacksSet, calling the callback routine and returning
      overwriting the vm (since it could return NULL). Finally, it will call the
      virDomainObjEndAPI to lower the refcnt and remove the lock taken during
      the search UUID processing. This may cause the vm to be destroyed.
      48ad6009
    • D
      virtlockd: fix systemd unit file dependancies · aed0850e
      Daniel P. Berrange 提交于
      After deploying virtlogd by default we identified a number of
      mistakes in the systemd unit file. virtlockd's relationship
      to libvirtd is the same as virtlogd, so we must apply the
      same unit file fixes to virtlockd
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aed0850e
  3. 03 2月, 2017 3 次提交
    • P
      HACKING: Update after recent change of the html file · aa7a84ad
      Peter Krempa 提交于
      aa7a84ad
    • A
      docs: Release notes should be updated in a separate commit · 54eaf639
      Andrea Bolognani 提交于
      Updating docs/news.xml in the same commit that performs the
      documented change makes backports needlessly complicated,
      both for mainteinance branches and downstream distributions,
      because it introduces additional potential for merge
      conflicts.
      
      Document in the contributor guidelines that the release notes
      should be updated in a separate commit instead, so that it's
      easy to backport just the code change.
      54eaf639
    • J
      libxl: fix dom0 autoballooning with Xen 4.8 · f86a7a83
      Jim Fehlig 提交于
      xen.git commit 57f8b13c changed several of the libxl memory
      get/set functions to take 64 bit parameters. The libvirt
      libxl driver still uses uint32_t variables for these various
      parameters, which is particularly problematic for the
      libxl_set_memory_target() function.
      
      When dom0 autoballooning is enabled, libvirt (like xl) determines
      the memory needed to start a domain and the memory available. If
      memory available is less than memory needed, dom0 is ballooned
      down by passing a negative value to libxl_set_memory_target()
      'target_memkb' parameter. Prior to xen.git commit 57f8b13c,
      'target_memkb' was an int32_t. Subtracting a larger uint32 from
      a smaller uint32 and assigning it to int32 resulted in a negative
      number. After commit 57f8b13c, the same subtraction is widened
      to a int64, resulting in a large positive number. The simple
      fix taken by this patch is to assign the difference of the
      uint32 values to a temporary int32 variable, which is then
      passed to 'target_memkb' parameter of libxl_set_memory_target().
      
      Note that it is undesirable to change libvirt to use 64 bit
      variables since it requires setting LIBXL_API_VERSION to 0x040800.
      Currently libvirt supports LIBXL_API_VERSION >= 0x040400,
      essentially Xen >= 4.4.
      f86a7a83
  4. 02 2月, 2017 2 次提交
  5. 01 2月, 2017 3 次提交
  6. 31 1月, 2017 16 次提交
  7. 30 1月, 2017 6 次提交