1. 25 4月, 2019 7 次提交
    • P
      util: hash: Append to hash buckets when adding new entries · 4b99ba98
      Peter Krempa 提交于
      In cases when the hash function for a name collides with other entry
      already in the hash we prepend to the bucket. This creates a 'stack
      effect' on the buckets if we then iterate through the hash. Normally
      this is not a problem, but in tests we want deterministic results.
      
      Since it does not matter where we add the entry and it's usually more
      probable that a different entry will be accessed next change it to
      append to the end of the bucket. Luckily we already iterate throught the
      bucket once thus we can easily find the last entry and just connect the
      new entry after it.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      4b99ba98
    • D
      qemuDomainPMSuspendForDuration: check for wake-up support · cc1d1dbb
      Daniel Henrique Barboza 提交于
      If the current QEMU guest can't wake up from suspend properly,
      and we are able to determine that, avoid suspending the guest
      at all. To be able to determine this support, QEMU needs to
      implement the 'query-current-machine' QMP call. This is reflected
      by the QEMU_CAPS_QUERY_CURRENT_MACHINE cap.
      
      If the cap is enabled, a new function qemuDomainProbeQMPCurrentMachine
      is called. This is wrapper for qemuMonitorGetCurrentMachineInfo,
      where the 'wakeup-suspend-support' flag is retrieved from
      'query-current-machine'. If wakeupSuspendSupport is true,
      proceed with the regular flow of qemuDomainPMSuspendForDuration.
      
      The absence of QEMU_CAPS_QUERY_CURRENT_MACHINE indicates that
      we're dealing with a QEMU version older than 4.0 (which implements
      the required QMP API). In this case, proceed as usual with the
      suspend logic of qemuDomainPMSuspendForDuration, since we can't
      assume whether the guest has support or not.
      
      Fixes: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1759509Reported-by: NBalamuruhan S <bala24@linux.vnet.ibm.com>
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cc1d1dbb
    • M
      qemu_monitor: Introduce handler for 'query-current-machine' command · 70a4e3ee
      Michal Privoznik 提交于
      So far, this command returns a structure with only one member:
      'wakeup-suspend-support'. But that's okay. It's what we are after
      anyway.
      
      Based-on-work-of: Daniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      70a4e3ee
    • D
      qemu_capabilities: Add QEMU_CAPS_QUERY_CURRENT_MACHINE · dca1b1d0
      Daniel Henrique Barboza 提交于
      QEMU commit 46ea94ca9cf ("qmp: query-current-machine with
      wakeup-suspend-support") added a new QMP command called
      'query-current-machine' that retrieves guest parameters that
      can vary in the same machine model (e.g. ACPI support for x86 VMs
      depends on the '--no-acpi' option). Currently, this API has a single
      flag, 'wakeup-suspend-support', that indicates whether the guest has
      the capability of waking up from suspended state.
      
      Introduce a libvirt capability that reflects whether qemu has the
      monitor command.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      dca1b1d0
    • P
      vircgroup: no need to ifdef virCgroupFree · 9470815d
      Pavel Hrdina 提交于
      virCgroup struct is always defined and the free function is not calling
      anything that would require OS supporting cgroups.
      
      This fixes an issue if we try to start a VM with QEMU binary that
      doesn't support QXL.  The start operation will fail in
      qemuProcessStartValidateVideo() which will set correct error message,
      but later in one of the cleanup paths we will call
      qemuDomainObjPrivateDataClear() which always calls virCgroupFree()
      and that will fail on OS that doesn't support cgroups and it will
      set a new error which will be eventually reported to user.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      9470815d
    • A
      Handle copying bitmaps to larger data buffers · 51f9f80d
      Allen, John 提交于
      If a bitmap of a shorter length than the data buffer is passed to
      virBitmapToDataBuf, it will read off the end of the bitmap and copy junk
      into the returned buffer. Add a check to only copy the length of the
      bitmap to the buffer.
      
      The problem can be observed after setting a vcpu affinity using the vcpupin
      command on a system with a large number of cores:
        # virsh vcpupin example_domain 0 0
        # virsh vcpupin example_domain 0
           VCPU   CPU Affinity
          ---------------------------
           0      0,192,197-198,202
      Signed-off-by: NJohn Allen <john.allen@amd.com>
      51f9f80d
    • N
      conf: add cpu check attribute to ABI check · 055af76f
      Nikolay Shirokovskiy 提交于
      Different check values are not ABI compatible. For example
      if on migration we change 'full' to 'partial' then guest cpu
      on destination can be different.
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      055af76f
  2. 24 4月, 2019 1 次提交
  3. 23 4月, 2019 5 次提交
  4. 20 4月, 2019 2 次提交
    • M
      libxlDriverConfigDispose: Free @configBaseDir too · 4f18b2d7
      Michal Privoznik 提交于
      Allocated in libxlDriverConfigNew(), the @configBaseDir is never
      freed.
      
       13 bytes in 1 blocks are definitely lost in loss record 36 of 125
          at 0x483579F: malloc (vg_replace_malloc.c:299)
          by 0x8012469: strdup (strdup.c:42)
          by 0x52926DE: virStrdup (virstring.c:966)
          by 0x11D46B: libxlDriverConfigNew (libxl_conf.c:1749)
          by 0x114D78: testCompareXMLToDomConfig (libxlxml2domconfigtest.c:62)
          by 0x1152A3: testCompareXMLToDomConfigHelper (libxlxml2domconfigtest.c:160)
          by 0x115925: virTestRun (testutils.c:174)
          by 0x1154A4: mymain (libxlxml2domconfigtest.c:216)
          by 0x1179E9: virTestMain (testutils.c:1096)
          by 0x1154FD: main (libxlxml2domconfigtest.c:224)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4f18b2d7
    • M
      qemucaps2xmltest: Don't leak @binary · 8bf7cc5f
      Michal Privoznik 提交于
      There's no need to keep @binary around.
      virQEMUCapsInitGuestFromBinary() duplicates the string anyway.
      
       1,002 bytes in 36 blocks are definitely lost in loss record 54 of 59
          at 0x483579F: malloc (vg_replace_malloc.c:299)
          by 0x796B1C7: vasprintf (vasprintf.c:73)
          by 0x4C3F2C6: virVasprintfInternal (virstring.c:740)
          by 0x4C3F3DC: virAsprintfInternal (virstring.c:761)
          by 0x13AFC9: testGetCaps (qemucaps2xmltest.c:105)
          by 0x13B200: testQemuCapsXML (qemucaps2xmltest.c:157)
          by 0x13B642: virTestRun (testutils.c:174)
          by 0x13B366: doCapsTest (qemucaps2xmltest.c:191)
          by 0x13FF2B: testQemuCapsIterate (testutilsqemu.c:941)
          by 0x13B427: mymain (qemucaps2xmltest.c:215)
          by 0x13D706: virTestMain (testutils.c:1096)
          by 0x13B489: main (qemucaps2xmltest.c:221)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8bf7cc5f
  5. 18 4月, 2019 12 次提交
  6. 17 4月, 2019 13 次提交