You need to sign in or sign up before continuing.
  1. 11 7月, 2017 1 次提交
  2. 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
  3. 20 6月, 2017 1 次提交
  4. 13 6月, 2017 1 次提交
  5. 18 5月, 2017 2 次提交
    • M
      Introduce virStorageVol{Download,Upload}Flags · 1f43aa67
      Michal Privoznik 提交于
      These flags to APIs will tell if caller wants to use sparse
      stream for storage transfer. At the same time, it's safe to
      enable them in storage driver frontend and rely on our backends
      checking the flags. This way we can enable specific flags only on
      some specific backends, e.g. enable
      VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM for filesystem backend but
      not iSCSI backend.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1f43aa67
    • M
      fdstream: Implement sparse stream · 89547964
      Michal Privoznik 提交于
      Basically, what is needed here is to introduce new message type
      for the messages passed between the event loop callbacks and the
      worker thread that does all the I/O. The idea is that instead of
      a queue of read buffers we will have a queue where "hole of size
      X" messages appear. That way the event loop callbacks can just
      check the head of the queue and see if the worker thread is in
      data or a hole section and how long the section is.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      89547964
  6. 15 5月, 2017 1 次提交
  7. 26 4月, 2017 5 次提交
    • J
      disk: Use virStorageBackendZeroPartitionTable · 3c4f2e3f
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1439132
      
      During 'matrix' testing of all possible combinations I found that if
      device is formated with "gpt" first, then an attempt is made to format
      using "mac", a startup will fail.
      
      Deeper analysis by Peter Krempa indicates that the "mac" table fits
      into the first block on the disk. Since the GPT disklabel is stored
      at LBA address 1 it is not overwritten at all. Thus it's apparent that
      the (blkid) detection tool then prefers GPT over a older disklabel.
      
      The GPT disklabel has also a secondary copy at the last LBA of the disk.
      
      So, follow the same logic as the logical pool in clearing a 1MB swath
      at the beginning and end of the device to avoid potential issues with
      larger sector sizes for the device.
      
      Also fixed a minor formatting nit in virStorageBackendDeviceIsEmpty call.
      3c4f2e3f
    • J
      logical: Increase the size of the data to wipe · d942bf6e
      John Ferlan 提交于
      Since a sector size may be larger than 512 bytes, let's just increase
      the size to wipe to 1MB rather than 2KB
      d942bf6e
    • J
      logical: Use virStorageBackendZeroPartitionTable · c6aa81c6
      John Ferlan 提交于
      Rather than open code it, use the new function which uses the wipe algorithm
      in order to zero the front and tail of the partition.
      c6aa81c6
    • J
      storage: Introduce virStorageBackendZeroPartitionTable · e8b02124
      John Ferlan 提交于
      Create a wrapper/helper that can be used to call the storage backend
      wipe helper - storageBackendVolWipeLocalFile for future use by logical
      and disk backends to clear out the partition table rather than having
      each open code the same algorithm.
      e8b02124
    • J
      storage: Modify storageBackendWipeLocal to allow zero from end of device · 859a2d16
      John Ferlan 提交于
      Add bool 'zero_end' and logic that would allow a caller to wipe specific
      portions of a target device either from the beginning (the default) or
      from the end when zero_end is true.
      
      This will allow for this code to wipe out partition table information
      from a device.
      859a2d16
  8. 11 4月, 2017 7 次提交
  9. 07 4月, 2017 2 次提交
  10. 06 4月, 2017 1 次提交
  11. 05 4月, 2017 1 次提交
  12. 04 4月, 2017 5 次提交
  13. 03 4月, 2017 3 次提交
  14. 28 3月, 2017 2 次提交
  15. 27 3月, 2017 1 次提交
  16. 18 3月, 2017 2 次提交
  17. 16 3月, 2017 4 次提交
    • J
      conf: Return the vHBA name from virNodeDeviceCreateVport · 08c0ea16
      John Ferlan 提交于
      Rather than returning true/false and having the caller check if the
      vHBA was actually created, let's do that check within the CreateVport
      function. That way the caller can faithfully assume success based
      on a name start the thread looking for the LUNs. Prior to this change
      it's possible that the vHBA wasn't really created (e.g if the call to
      virVHBAGetHostByWWN returned NULL), we'd claim success, but in reality
      there'd be no vHBA for the pool. This also fixes a second yet seen
      issue that if the nodedev was present, but the parent by name wasn't
      provided (perhaps parent by wwnn/wwpn or by fabric_name), then a failure
      would be returned. For this path it shouldn't be an error - we should
      just be happy that something else is managing the device and we don't
      have to create/delete it.
      
      The end result is that the createVport code can now just start the
      refresh thread once it gets a non NULL name back.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      08c0ea16
    • J
      conf: Move/Rename createVport and deleteVport · 106930aa
      John Ferlan 提交于
      Move the bulk of createVport and rename to virNodeDeviceCreateVport.
      
      Remove the deleteVport entirely and replace with virNodeDeviceDeleteVport
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      106930aa
    • J
      util: Rename virFileWaitForDevices · 97e0d3c3
      John Ferlan 提交于
      The function is actually in virutil.c, but prototyped in virfile.h.
      This patch fixes that by renaming the function to virWaitForDevices,
      adding the prototype in virutil.h and libvirt_private.syms, and then
      changing the callers to use the new name.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      97e0d3c3
    • J
      conf: Convert virStoragePoolSourceAdapter to virStorageAdapter · a7ce03c7
      John Ferlan 提交于
      Move the virStoragePoolSourceAdapter from storage_conf.h and rename
      to virStorageAdapter.
      
      Continue with code realignment for brevity and flow.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      a7ce03c7