1. 15 2月, 2017 7 次提交
    • M
      qemu_conf: Check for namespaces availability more wisely · b57bd206
      Michal Privoznik 提交于
      The bare fact that mnt namespace is available is not enough for
      us to allow/enable qemu namespaces feature. There are other
      requirements: we must copy all the ACL & SELinux labels otherwise
      we might grant access that is administratively forbidden or vice
      versa.
      At the same time, the check for namespace prerequisites is moved
      from domain startup time to qemu.conf parser as it doesn't make
      much sense to allow users to start misconfigured libvirt just to
      find out they can't start a single domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b57bd206
    • J
      apparmor: don't fail on non-apparmor <seclabel> · ec94e14b
      Jim Fehlig 提交于
      If the apparmor security driver is loaded/enabled and domain config
      contains a <seclabel> element whose type attribute is not 'apparmor',
      starting the domain fails when attempting to label resources such
      as tap FDs.
      
      Many of the apparmor driver entry points attempt to retrieve the
      apparmor security label from the domain def, returning failure if
      not found. Functions such as AppArmorSetFDLabel fail even though
      domain config contains an explicit 'none' secuirty driver, e.g.
      
        <seclabel type='none' model='none'/>
      
      Change the entry points to succeed if the domain config <seclabel>
      is not apparmor. This matches the behavior of the selinux driver.
      ec94e14b
    • J
      apparmor: don't overwrite error from reload_profile · 5cdfc80b
      Jim Fehlig 提交于
      Like other callers of reload_profile, don't overwrite errors in
      AppArmorSetSecurityHostdevLabelHelper.
      5cdfc80b
    • J
      qemu_monitor_json: Properly check GetArray return value · 598b6d79
      Jiri Denemark 提交于
      Commit 2a8d40f4 refactored qemuMonitorJSONGetCPUx86Data and replaced
      virJSONValueObjectGet(reply, "return") with virJSONValueObjectGetArray.
      While the former is guaranteed to always return non-NULL pointer the
      latter may return NULL if the returned JSON object is not an array.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      598b6d79
    • A
      qemu: Call chmod() after mknod() · ee6ec782
      Andrea Bolognani 提交于
      mknod() is affected my the current umask, so we're not
      guaranteed the newly-created device node will have the
      right permissions.
      
      Call chmod(), which is not affected by the current umask,
      immediately afterwards to solve the issue.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1421036
      ee6ec782
    • A
      spec: Require libacl when building the QEMU driver · e04bd5b6
      Andrea Bolognani 提交于
      For the namespaces feature to work properly we need to be able
      to make a perfect copy of the original /dev, including ACLs.
      
      By adding a BuildRequires on libacl-devel we ensure that ACL
      support will be enabled at configure time and made available
      to the QEMU driver.
      e04bd5b6
    • A
      configure: Move ACL checks to a separate file · c315ead7
      Andrea Bolognani 提交于
      c315ead7
  2. 14 2月, 2017 2 次提交
  3. 13 2月, 2017 5 次提交
  4. 11 2月, 2017 6 次提交
  5. 10 2月, 2017 18 次提交
    • J
      tests: Link virusbmock with probes · e8a35271
      John Ferlan 提交于
      Seeing similar error to commit id '997be5c2' with the inability
      to find the libvirt_event_poll_purge_timeout_semaphore symbol
      causing a virusbtest failure.
      e8a35271
    • B
      remote generator: Increase upper limit on lists of node devices · d15b29be
      Boris Fiuczynski 提交于
      On a system with 697 SCSI disks each configured with 8 paths the command
      virsh nodedev-list fails with
      error: Failed to list node devices
      error: internal error: Too many node_devices '16816' for limit '16384'
      Increasing the upper limit on lists of node devices from 16K to 64K.
      Signed-off-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      d15b29be
    • N
      Mention the min duration for nodesuspend explicitly · f278a148
      Nitesh Konkar 提交于
      Although currently this is documented in virsh man page
      and virsh help, the expicit mention in the error message
      is helful for tools using the API directly.
      Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
      f278a148
    • M
      qemuMonitorCPUModelInfoFree: Don't leak model_info->props · 732629da
      Michal Privoznik 提交于
      ==11846== 240 bytes in 1 blocks are definitely lost in loss record 81 of 107
      ==11846==    at 0x4C2BC75: calloc (vg_replace_malloc.c:624)
      ==11846==    by 0x18C74242: virAllocN (viralloc.c:191)
      ==11846==    by 0x4A05E8: qemuMonitorCPUModelInfoCopy (qemu_monitor.c:3677)
      ==11846==    by 0x446E3C: virQEMUCapsNewCopy (qemu_capabilities.c:2171)
      ==11846==    by 0x437335: testQemuCapsCopy (qemucapabilitiestest.c:108)
      ==11846==    by 0x437CD2: virTestRun (testutils.c:180)
      ==11846==    by 0x437AD8: mymain (qemucapabilitiestest.c:176)
      ==11846==    by 0x4397B6: virTestMain (testutils.c:992)
      ==11846==    by 0x437B44: main (qemucapabilitiestest.c:188)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      732629da
    • M
      testUSBList: don't leak @dev · afecfc2b
      Michal Privoznik 提交于
      ==22187== 77 (56 direct, 21 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 37
      ==22187==    at 0x4C2BC75: calloc (vg_replace_malloc.c:624)
      ==22187==    by 0x4E75685: virAlloc (viralloc.c:144)
      ==22187==    by 0x4F0613A: virUSBDeviceNew (virusb.c:332)
      ==22187==    by 0x4F05BA2: virUSBDeviceSearch (virusb.c:183)
      ==22187==    by 0x4F05F95: virUSBDeviceFind (virusb.c:296)
      ==22187==    by 0x403514: testUSBList (virusbtest.c:209)
      ==22187==    by 0x403BD8: virTestRun (testutils.c:180)
      ==22187==    by 0x4039E5: mymain (virusbtest.c:285)
      ==22187==    by 0x4056BC: virTestMain (testutils.c:992)
      ==22187==    by 0x403A4A: main (virusbtest.c:293)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      afecfc2b
    • M
      virusbmock: Link with libvirt_utils · eb58732c
      Michal Privoznik 提交于
      We are using couple of functions from there (e.g. virStrdup) and
      rely that the binary linking us has the libvirt_utils linked
      already. Well, this makes valgrind sad.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      eb58732c
    • M
      tests: Trace re-executing processes with valgrind · a9595814
      Michal Privoznik 提交于
      A lot of our tests re-execute themeselves after loading their
      mock library. This, however, makes valgrind sad because currently
      we do not tell it to trace the process after exec().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a9595814
    • N
      Fix indentation in datatypes.h · 09a91f05
      Nitesh Konkar 提交于
      Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
      09a91f05
    • M
      remote generator: handle remoteDomainCreateWithFlags() · fd98631c
      Marc Hartmayer 提交于
      This commit removes the handcrafted code for
      remoteDomainCreateWithFlags() and lets it auto generate.
      
      A little bit of history repeating...
      Commit 03d813bb removed the auto generation of
      remoteDomainCreateWithFlags() because it was thought that the design
      flaw in the remote protocol for virDomainCreate is also within the
      remote protocol for virDomainCreateWithFlags. As the commit message of
      ddaf15d7 mentions this is not the case therefore we
      can auto generate the client part.
      
      Even worse there was a typo in remoteDomainCreateWithFlags()
      
      'remote_domain_create_with_flags_args ret;' but in fact it has to be
      'remote_domain_create_with_flags_ret ret;'.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      fd98631c
    • M
      util: reset the counters to zero · c26fe44b
      Marc Hartmayer 提交于
      After freeing the data structures we have to reset the counters to
      zero. This fixes a segmentation fault when virNetDevIPInfoClear is
      called twice (e.g. this is possible in virDomainNetDefParseXML() if
      virDomainNetIPInfoParseXML(...) fails with ret < 0 (this leads to the
      first call of 'virNetDevIPInfoClear(&def->guestIP)') and the resulting
      call of virDomainNetDefFree(def) in the error path of
      virDomainNetDefParseXML() (this leads to the second call of
      virNetDevIPInfoClear(&def->guestIP), and finally to the segmentation
      fault).
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      c26fe44b
    • M
      conf: Fix libvirtd free() segfault if virDomainChrSourceDefNew(...) fails · 28dd54a5
      Marc Hartmayer 提交于
      If virDomainChrSourceDefNew(xmlopt) fails, it will lead to free()ing
      the uninitialized pointer bus. The fix for this is to initialize bus
      with NULL.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      28dd54a5
    • M
      qemu: Check if virQEMUCapsNewCopy(...) has failed · 62b2c2fc
      Marc Hartmayer 提交于
      Check if virQEMUCapsNewCopy(...) has failed, thus a segmentation fault
      in virQEMUCapsFilterByMachineType(...) will be avoided.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      62b2c2fc
    • D
      qemu: Fix live migration over RDMA with IPv6 · 728c0e5d
      David Dai 提交于
      Using libvirt to do live migration over RDMA via IPv6 address failed.
      
      For example:
          rhel73_host1_guest1 qemu+ssh://[deba::2222]/system --verbose
      root@deba::2222's password:
      error: internal error: unable to execute QEMU command 'migrate': RDMA
      ERROR: could not rdma_getaddrinfo address deba
      
      As we can see, the IPv6 address used by rdma_getaddrinfo() has only
      "deba" part because we didn't properly enclose the IPv6 address in []
      and passed rdma:deba::2222:49152 as the migration URI in
      qemuMonitorMigrateToHost.
      Signed-off-by: NDavid Dai <zdai@linux.vnet.ibm.com>
      728c0e5d
    • J
      libxl: fix dom0 maximum memory setting · 79692c38
      Jim Fehlig 提交于
      When the libxl driver is initialized, it creates a virDomainDef
      object for dom0 and adds it to the list of domains. Total memory
      for dom0 was being set from the max_memkb field of libxl_dominfo
      struct retrieved from libxl, but this field can be set to
      LIBXL_MEMKB_DEFAULT (~0ULL) if dom0 maximum memory has not been
      explicitly set by the user.
      
      This patch adds some simple parsing of the Xen commandline,
      looking for a dom0_mem parameter that also specifies a 'max' value.
      If not specified, dom0 maximum memory is effectively all physical
      host memory.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      79692c38
    • J
      libxl: fix reporting of maximum memory · d2b77608
      Jim Fehlig 提交于
      The libxl driver reports different values of maximum memory depending
      on state of a domain. If inactive, maximum memory value is reported
      correctly. When active, maximum memory is derived from max_pages value
      returned by the XEN_SYSCTL_getdomaininfolist sysctl operation. But
      max_pages can be changed by toolstacks and does not necessarily
      represent the maximum memory a domain can use during its active
      lifetime.
      
      A better location for determining a domain's maximum memory is the
      /local/domain/<id>/memory/static-max node in xenstore. This value
      is set from the libxl_domain_build_info.max_memkb field when creating
      the domain. Currently it cannot be changed nor can its value be
      exceeded by a balloon operation. From libvirt's perspective, always
      reporting maximum memory with virDomainDefGetMemoryTotal() will produce
      the same results as reading the static-max node in xenstore.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      d2b77608
    • J
      libxl: fix disk detach when <driver> not specified · bd116810
      Jim Fehlig 提交于
      When a user does not explicitly set a <driver> in the disk config,
      libvirt defers selection of a default to libxl. This approach works
      fine when starting a domain with such configuration or attaching a
      disk to a running domain. But when detaching such a disk, libxl
      will fail with "unrecognized disk backend type: 0". libxl makes no
      attempt to recalculate a default backend (driver) on detach and
      simply fails when uninitialized.
      
      This patch updates the libvirt disk config with the backend selected
      by libxl when starting a domain or attaching a disk to a running
      domain. Another benefit of this approach is that the live XML is
      also updated with the backend driver selected by libxl.
      bd116810
    • J
      libxl: set default disk format in device post-parse · 321a28c6
      Jim Fehlig 提交于
      When starting a domian, a libxl_domain_config object is created from
      virDomainDef. Any virDomainDiskDef devices with a format of
      VIR_STORAGE_FILE_NONE are mapped to LIBXL_DISK_FORMAT_RAW in the
      corresponding libxl_disk_device, but the virDomainDiskDef format is
      never updated to reflect the change.
      
      A better place to set a default format for disk devices is the
      device post-parse callback, ensuring the virDomainDiskDef object
      reflects the default format.
      321a28c6
    • B
      docs: Document new ovs_timeout configuration knob · c0120520
      Boris Fiuczynski 提交于
      Document the ovs_timeout introduced to libvirtd.conf in previous
      patches.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c0120520
  6. 09 2月, 2017 2 次提交