1. 20 7月, 2017 2 次提交
    • P
      qemu: blockcopy: Explicitly assert 'reuse' for block devices · 060d4ec6
      Peter Krempa 提交于
      When copying to a block device, the block device will already exist. To
      allow users using a block device without any preparation, they need to
      use the block copy without VIR_DOMAIN_BLOCK_COPY_REUSE_EXT.
      
      This means that if the target is an existing block device we don't need
      to prepare it, but we can't reject it as being existing.
      
      To avoid breaking this feature, explicitly assume that existing block
      devices will be reused even without that flag explicitly specified,
      while skipping attempts to create it.
      
      qemuMonitorDriveMirror still needs to honor the flag as specified by the
      user, since qemu overwrites the metadata otherwise.
      060d4ec6
    • P
      qemu: driver: Split out access to VIR_DOMAIN_BLOCK_COPY_REUSE_EXT · a805320b
      Peter Krempa 提交于
      Extract the presence of the flag into a boolean to simplify conditions
      and allow further manipulation of the state of the flag.
      a805320b
  2. 12 7月, 2017 1 次提交
    • J
      qemu: Fix qemuDomainGetBlockInfo allocation value setting · fde654be
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1467826
      
      Commit id 'b9b1aa63' was supposed to add logic to set the allocation
      for sparse files when wr_highest_offset was zero; however, an unconditional
      setting was done just prior. For block devices, this means allocation is
      always returning 0 since 'actual-size' will be zero.
      
      Remove the unconditional setting and add the note about it being possible
      to still be zero for block devices. As soon as the guest starts writing to
      the volume, the allocation value will then be obtainable from qemu via
      the wr_highest_offset.
      fde654be
  3. 11 7月, 2017 6 次提交
  4. 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
  5. 20 6月, 2017 3 次提交
  6. 14 6月, 2017 1 次提交
  7. 13 6月, 2017 2 次提交
  8. 12 6月, 2017 1 次提交
  9. 07 6月, 2017 11 次提交
  10. 05 6月, 2017 1 次提交
  11. 02 6月, 2017 1 次提交
  12. 31 5月, 2017 1 次提交
    • M
      qemu: mkdir memory_backing_dir on startup · 3bab51e0
      Michal Privoznik 提交于
      In 48d9e6cd and friends we've allowed users to back guest
      memory by a file inside the host. And in order to keep things
      manageable the memory_backing_dir variable was introduced to
      qemu.conf to specify the directory where the files are kept.
      However, libvirt's policy is that directories are created on
      domain startup if they don't exist. We've missed this one.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3bab51e0
  13. 25 5月, 2017 1 次提交
  14. 24 5月, 2017 1 次提交
  15. 23 5月, 2017 1 次提交
  16. 17 5月, 2017 1 次提交
  17. 10 5月, 2017 2 次提交
  18. 28 4月, 2017 1 次提交
  19. 27 4月, 2017 2 次提交