1. 17 3月, 2020 2 次提交
    • D
      rpc: avoid name lookup when dispatching node device APIs · 69eee587
      Daniel P. Berrangé 提交于
      The node device APIs are a little unusual because we don't use a
      "remote_nonnull_node_device" object on the wire, instead we just
      have a "remote_string" for the device name. This meant dispatcher
      code generation needed special cases. In doing so we mistakenly
      used the virNodeDeviceLookupByName() API which gets dispatched
      into the driver, instead of get_nonnull_node_device() which
      directly populates a virNodeDevicePtr object.
      
      This wasn't a problem with monolithic libvirtd, as the
      virNodeDeviceLookupByName() API call was trivially satisfied
      by the registered driver, albeit with an extra (undesirable)
      authentication check. With the split daemons, the call to
      virNodeDeviceLookupByName() fails in virtqemud, because the
      node device driver obviously doesn't exist in that daemon.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      69eee587
    • D
      rpc: fix dispatch for node device APIs for virt drivers · 744208e7
      Daniel P. Berrangé 提交于
      Despite their names, the following APIs:
      
          virNodeDeviceDettach
          virNodeDeviceDetachFlags
          virNodeDeviceReAttach
          virNodeDeviceReset
      
      are all handled by the virt drivers, not the node device driver.
      A bug in the RPC generator meant that these APIs were sent to
      the nodedev driver for handling. This caused breakage with the
      split daemons, since nothing was available to process them.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      744208e7
  2. 06 2月, 2020 1 次提交
  3. 22 11月, 2019 1 次提交
  4. 25 10月, 2019 1 次提交
    • P
      remote: dispatch: Remove return value from make_nonnull_* helpers · 694323bb
      Peter Krempa 提交于
      After conversion to g_strdup, the helpers now always return success.
      Remove the return value to simplify the callers.
      
      Note that many occurrences of these is in the code generated by
      gendispatch.pl. Since gendispatch aggregates many cases together an
      incremental conversion would require more invasive changes to
      gendispatch for the time of conversion which doesn't make sense.
      
      Also in many cases the helper was the last place where the 'error:'
      label was used and thus also those conversions must be included in this
      patch.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      ACKed-by: NEric Blake <eblake@redhat.com>
      694323bb
  5. 21 10月, 2019 1 次提交
  6. 15 10月, 2019 2 次提交
  7. 28 8月, 2019 1 次提交
  8. 09 8月, 2019 1 次提交
  9. 27 7月, 2019 1 次提交
  10. 17 6月, 2019 1 次提交
  11. 08 2月, 2019 1 次提交
    • N
      rpc: client stream: dispose private data on stream dispose · fbcb7386
      Nikolay Shirokovskiy 提交于
      If we call virStreamFinish and virStreamAbort from 2 distinct
      threads for example we can have access to freed memory.
      Because when virStreamFinish finishes for example virStreamAbort
      yet to be finished and it access virNetClientStreamPtr object
      in stream->privateData.
      
      Also it does not make sense to clear @driver field. After
      stream is finished/aborted it is better to have appropriate
      error message instead of "unsupported error".
      
      This commit reverts [1] or virNetClientStreamPtr and
      virStreamPtr will never be unrefed due to cyclic dependency.
      Before this patch we don't have leaks because all execution
      paths we call virStreamFinish or virStreamAbort.
      
      [1] 8b6ffe40 : virNetClientStreamNew: Track origin stream
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      fbcb7386
  12. 14 12月, 2018 1 次提交
  13. 15 11月, 2018 2 次提交
    • J
      access: Modify the VIR_ERR_ACCESS_DENIED to include driverName · 605496be
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1631606
      
      Changes made to manage and utilize a secondary connection
      driver to APIs outside the scope of the primary connection
      driver have resulted in some confusion processing polkit rules
      since the simple "access denied" error message doesn't provide
      enough of a clue when combined with the "authentication failed:
      access denied by policy" as to which connection driver refused
      or failed the ACL check.
      
      In order to provide some context, let's modify the existing
      "access denied" error returned from the various vir*EnsureACL
      API's to provide the connection driver name that is causing
      the failure. This should provide the context for writing the
      polkit rules that would allow access via the driver, but yet
      still adhere to the virAccessManagerSanitizeError commentary
      regarding not telling the user why access was denied.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      605496be
    • J
      Revert "access: Modify the VIR_ERR_ACCESS_DENIED to include driverName" · b08396a5
      John Ferlan 提交于
      This reverts commit ccc72d5c.
      
      Based on upstream comment to a follow-up patch, this didn't take the
      right approach and the right thing to do is revert and rework.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      b08396a5
  14. 05 11月, 2018 1 次提交
    • J
      access: Modify the VIR_ERR_ACCESS_DENIED to include driverName · ccc72d5c
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1631606
      
      Changes made to manage and utilize a secondary connection
      driver to APIs outside the scope of the primary connection
      driver have resulted in some confusion processing polkit rules
      since the simple "access denied" error message doesn't provide
      enough of a clue when combined with the "authentication failed:
      access denied by policy" as to which connection driver refused
      or failed the ACL check.
      
      In order to provide some context, let's modify the existing
      "access denied" error returne from the various vir*EnsureACL
      API's to provide the connection driver name that is causing
      the failure. This should provide the context for writing the
      polkit rules that would allow access via the driver.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
      ccc72d5c
  15. 26 6月, 2018 2 次提交
  16. 09 4月, 2018 7 次提交
  17. 19 9月, 2017 1 次提交
  18. 11 7月, 2017 1 次提交
    • D
      rpc: improve error message for bounds check · c8fb3c31
      Daniel P. Berrange 提交于
      If we exceed a fixed limit in RPC code we get a horrible message
      like this, if the parameter type is a 'string', because we forgot
      to initialize the error message type field:
      
        $ virsh snapshot-list ostack1
        error: too many remote undefineds: 1329 > 1024
      
      It would also be useful to know which RPC call and field was
      exceeded. So this patch makes us report:
      
        $ virsh snapshot-list ostack1
        error: too many remote undefineds: 1329 > 1024,
        in parameter 'names' for 'virDomainSnapshotListNames'
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c8fb3c31
  19. 18 5月, 2017 3 次提交
    • M
      gendispatch: Introduce @sparseflag for our calls · 8f08f28f
      Michal Privoznik 提交于
      Now, not all APIs are going to support sparse streams. To some it
      makes no sense at all, e.g. virDomainOpenConsole() or
      virDomainOpenChannel(). To others, we will need a special flag to
      indicate that client wants to enable sparse streams. Instead of
      having to write RPC dispatchers by hand we can just annotate in
      our .x files that a certain flag to certain RPC call enables this
      feature. For instance:
      
           /**
            * @generate: both
            * @ReadStream: 1
            * @sparseflag: VIR_SPARSE_STREAM
            * @acl: storage_vol:data_read
            */
           REMOTE_PROC_DOMAIN_SOME_API = XXX,
      
      Therefore, whenever client calls virDomainSomeAPI(..,
      VIR_SPARSE_STREAM); daemon will mark that down and send stream
      skips when possible.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8f08f28f
    • M
      Add new flag to daemonCreateClientStream and virNetClientStreamNew · 5f4f9d87
      Michal Privoznik 提交于
      Add a new argument to daemonCreateClientStream in order to allow for
      future expansion to mark that a specific stream can be used to skip
      data, such as the case with sparsely populated files. The new flag will
      be the eventual decision point between client/server to decide whether
      both ends can support and want to use sparse streams.
      
      A new bool 'allowSkip' is added to both _virNetClientStream and
      daemonClientStream in order to perform the tracking.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5f4f9d87
    • M
      virNetClientStreamNew: Track origin stream · 8b6ffe40
      Michal Privoznik 提交于
      Add a virStreamPtr pointer to the _virNetClientStream
      in order to reverse track the parent stream.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8b6ffe40
  20. 22 6月, 2016 1 次提交
  21. 03 5月, 2016 1 次提交
  22. 24 3月, 2016 1 次提交
    • M
      gendispatch: Avoid comparing signed and unsigned vars · 9b48ef9c
      Michal Privoznik 提交于
      The adminDispatchConnectListServers() function is generated by
      our great perl script. However, it has a tiny flaw: if
      adminConnectListServers() it calls fails, the control jumps onto
      cleanup label where we try to free any list of servers built so
      far. However, in the loop @i is unsigned (size_t) while @nresults
      is signed (int). Currently, it does no harm because of the check
      for @result being non-NULL. But if that ever changes in the
      future, this bug will be hard to chase.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9b48ef9c
  23. 11 3月, 2016 6 次提交