1. 18 5月, 2017 6 次提交
    • M
      Introduce virStreamRecvHole · b6aedd2f
      Michal Privoznik 提交于
      This function is basically a counterpart for virStreamSendHole().
      If one side of a stream called virStreamSendHole() the other
      should call virStreamRecvHole() to get the size of the hole.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b6aedd2f
    • M
      Introduce virStreamSendHole · 69a573d0
      Michal Privoznik 提交于
      This API is used to tell the other side of the stream to skip
      some bytes in the stream. This can be used to create a sparse
      file on the receiving side of a stream.
      
      It takes @length argument, which says how big the hole is. This
      skipping is done from the current point of stream. Since our
      streams are not rewindable like regular files, we don't need
      @whence argument like seek(2) has.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      69a573d0
    • M
      Implement virStreamRecvFlags to some drivers · 65b9cd67
      Michal Privoznik 提交于
      There are three virStreamDriver's currently supported:
      
       * virFDStream
       * remote driver
       * ESX driver
      
      For now, backend virStreamRecvFlags support for only remote driver and
      ESX driver is sufficient. Future patches will update virFDStream.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      65b9cd67
    • M
      Introduce virStreamRecvFlags · a35e2836
      Michal Privoznik 提交于
      This patch is adding the virStreamRecvFlags as a variant to the
      virStreamRecv function in order to allow for future expansion of
      functionality for processing sparse streams using a @flags
      argument.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a35e2836
    • M
      util: Introduce virFileInData · b928d140
      Michal Privoznik 提交于
      This function takes a FD and determines whether the current
      position is in data section or in a hole. In addition to that,
      it also determines how much bytes are there remaining till the
      current section ends.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b928d140
    • M
      virfdstream: Use messages instead of pipe · 07c2399c
      Michal Privoznik 提交于
      One big downside of using the pipe to transfer the data is that
      we can really transfer just bare data. No metadata can be carried
      through unless some formatted messages are introduced. That would
      be quite painful to achieve so let's use a message queue. It's
      fairly easy to exchange info between threads now that iohelper is
      no longer used.
      
      The reason why we cannot use the FD for plain files directly is
      that despite us setting noblock flag on the FD, any
      read()/write() blocks regardless (which is a show stopper since
      those parts of the code are run from the event loop) and poll()
      reports such FD as always readable/writable - even though the
      subsequent operation might block.
      
      The pipe is still not gone though. It is used to signal the event
      loop that an event occurred (e.g. data is available for reading
      in the queue, or vice versa).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      07c2399c
  2. 17 5月, 2017 1 次提交
  3. 16 5月, 2017 5 次提交
  4. 15 5月, 2017 12 次提交
  5. 12 5月, 2017 3 次提交
  6. 11 5月, 2017 2 次提交
  7. 10 5月, 2017 4 次提交
  8. 09 5月, 2017 6 次提交
  9. 05 5月, 2017 1 次提交
    • M
      virNWFilterObjListFree: Don't leak nwfilters->objs · 772e4247
      Michal Privoznik 提交于
      When adding a nwfilter onto the list in
      virNWFilterObjListAssignDef() this array is re-allocated to match
      demand for new size. However, it is never freed leading to a
      leak:
      
      ==26535== 136 bytes in 1 blocks are definitely lost in loss record 1,079 of 1,250
      ==26535==    at 0x4C2E2BE: realloc (vg_replace_malloc.c:785)
      ==26535==    by 0x54BA28E: virReallocN (viralloc.c:245)
      ==26535==    by 0x54BA384: virExpandN (viralloc.c:294)
      ==26535==    by 0x54BA657: virInsertElementsN (viralloc.c:436)
      ==26535==    by 0x55DB011: virNWFilterObjListAssignDef (virnwfilterobj.c:362)
      ==26535==    by 0x55DB530: virNWFilterObjListLoadConfig (virnwfilterobj.c:503)
      ==26535==    by 0x55DB635: virNWFilterObjListLoadAllConfigs (virnwfilterobj.c:539)
      ==26535==    by 0x2AC5A28B: nwfilterStateInitialize (nwfilter_driver.c:250)
      ==26535==    by 0x5621C64: virStateInitialize (libvirt.c:770)
      ==26535==    by 0x124379: daemonRunStateInit (libvirtd.c:881)
      ==26535==    by 0x554AC78: virThreadHelper (virthread.c:206)
      ==26535==    by 0x8F5F493: start_thread (in /lib64/libpthread-2.23.so)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      772e4247