1. 18 5月, 2017 1 次提交
    • 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
  2. 25 4月, 2017 4 次提交
    • J
      remote: Fix possible use-after-free when sending event message · fe8f1c8b
      John Ferlan 提交于
      Based upon an idea and some research by Wang King <king.wang@huawei.com>
      and xinhua.Cao <caoxinhua@huawei.com>.
      
      Since we're assigning the 'client' to our callback event lookaside list,
      it's imperative that we grab a reference to the object; otherwise, when
      the object is unref'd during virNetServerProcessClients when it's determined
      that the virNetServerClientIsClosed and the memory is free'd before perhaps
      the object event state callbacks are run.  When a virObjectLock() is run,
      before sending the message the following trace occurs;
      
          #0  0x00007fda223d66d8 in virClassIsDerivedFrom
              (klass=0xdeadbeef, parent=0x7fda24c81b40)
               at util/virobject.c:169
          #1  0x00007fda223d6a1e in virObjectIsClass
              (anyobj=anyobj@entry=0x7fd9e575b400, klass=<optimized out>)
               at util/virobject.c:365
          #2  0x00007fda223d6a44 in virObjectLock
              (anyobj=0x7fd9e575b400)
              at util/virobject.c:317
          #3  0x00007fda22507f71 in virNetServerClientSendMessage
              (client=client@entry=0x7fd9e575b400, msg=msg@entry=0x7fd9ec30de90)
              at rpc/virnetserverclient.c:1422
          #4  0x00007fda230d714d in remoteDispatchObjectEventSend
              (client=0x7fd9e575b400, program=0x7fda24c844e0, procnr=348,
               proc=0x7fda2310e5e0 <xdr_remote_domain_event_callback_tunable_msg>,
               data=0x7ffc3857fdb0)
              at remote.c:3803
          #5  0x00007fda230dd71b in remoteRelayDomainEventTunable
              (conn=<optimized out>, dom=0x7fda27cd7660, params=0x7fda27f3aae0,
               nparams=1,opaque=0x7fd9e6c99e00)
              at remote.c:1033
          #6  0x00007fda224484cb in virDomainEventDispatchDefaultFunc
              (conn=0x7fda27cd0120, event=0x7fda2736ea00, cb=0x7fda230dd610
               <remoteRelayDomainEventTunable>, cbopaque=0x7fd9e6c99e00)
              at conf/domain_event.c:1910
          #7  0x00007fda22446871 in virObjectEventStateDispatchCallbacks
              (callbacks=<optimized out>, callbacks=<optimized out>,
               event=0x7fda2736ea00,state=0x7fda24ca3960)
              at conf/object_event.c:722
          #8  virObjectEventStateQueueDispatch
              (callbacks=0x7fda24c65800, queue=0x7ffc3857fe90, state=0x7fda24ca3960)
              at conf/object_event.c:736
          #9  virObjectEventStateFlush (state=0x7fda24ca3960)
              at conf/object_event.c:814
          #10 virObjectEventTimer (timer=<optimized out>, opaque=0x7fda24ca3960)
              at conf/object_event.c:560
          #11 0x00007fda223ae8b9 in virEventPollDispatchTimeouts ()
              at util/vireventpoll.c:458
          #12 virEventPollRunOnce ()
              at util/vireventpoll.c:654
          #13 0x00007fda223ad1d2 in virEventRunDefaultImpl ()
              at util/virevent.c:314
          #14 0x00007fda225046cd in virNetDaemonRun (dmn=0x7fda24c775c0)
              at rpc/virnetdaemon.c:818
          #15 0x00007fda230d6351 in main (argc=<optimized out>, argv=<optimized out>)
              at libvirtd.c:1623
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      fe8f1c8b
    • J
      daemon: Rework remoteClientFreeFunc cleanup loops into C macro · 2033e8cc
      John Ferlan 提交于
      Rather than 'n' repetitive code segments, let's create a single macro
      which will make the code easier to read.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      2033e8cc
    • W
      daemon: Remove unnecessary goto error · 0023cc03
      Wang King 提交于
      Freeing the dst is unnecessary if the VIR_STRDUP fails, and therefore
      we need to remove the error label as well.
      0023cc03
    • W
      daemon: Fix domain name leak in error path · f6934047
      Wang King 提交于
      Domain name is duplicated in make_nonnull_domain, but not freed when
      virTypedParamsSerialize returns error.
      f6934047
  3. 03 4月, 2017 1 次提交
    • M
      virGetDomain: Set domain ID too · 5683b213
      Michal Privoznik 提交于
      So far our code is full of the following pattern:
      
        dom = virGetDomain(conn, name, uuid)
        if (dom)
            dom->id = 42;
      
      There is no reasong why it couldn't be just:
      
        dom = virGetDomain(conn, name, uuid, id);
      
      After all, client domain representation consists of tuple (name,
      uuid, id).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5683b213
  4. 27 3月, 2017 1 次提交
    • P
      lib: Introduce event for tracking disk backing file write threshold · 085e794a
      Peter Krempa 提交于
      When using thin provisioning, management tools need to resize the disk
      in certain cases. To avoid having them to poll disk usage introduce an
      event which will be fired when a given offset of the storage is written
      by the hypervisor. Together with the API which will be added later, it
      will allow registering thresholds for given storage backing volumes and
      this event will then notify management if the threshold is exceeded.
      085e794a
  5. 17 3月, 2017 1 次提交
  6. 10 1月, 2017 1 次提交
  7. 09 1月, 2017 2 次提交
  8. 21 12月, 2016 1 次提交
    • J
      storage: Introduce virStorageVolInfoFlags · 0c234889
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1332019
      
      This function will essentially be a wrapper to virStorageVolInfo in order
      to provide a mechanism to have the "physical" size of the volume returned
      instead of the "allocation" size. This will provide similar capabilities to
      the virDomainBlockInfo which can return both allocation and physical of a
      domain storage volume.
      
      NB: Since we're reusing the _virStorageVolInfo and not creating a new
      _virStorageVolInfoFlags structure, we'll need to generate the rpc APIs
      remoteStorageVolGetInfoFlags and remoteDispatchStorageVolGetInfoFlags
      (although both were originally created from gendispatch.pl and then
      just copied into daemon/remote.c and src/remote/remote_driver.c).
      
      The new API will allow the usage of a VIR_STORAGE_VOL_GET_PHYSICAL flag
      and will make the decision to return the physical or allocation value
      into the allocation field.
      
      In order to get that physical value, virStorageBackendUpdateVolTargetInfoFD
      adds logic to fill in physical value matching logic in qemuStorageLimitsRefresh
      used by virDomainBlockInfo when the domain is inactive.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      0c234889
  9. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  10. 24 8月, 2016 1 次提交
  11. 15 8月, 2016 1 次提交
    • J
      Introduce node device update event as top level event · 43a6b37b
      Jovanka Gulicoska 提交于
      This event is emitted when a nodedev XML definition is updated,
      like when cdrom media is changed in a cdrom block device.
      
      Also includes node device update event implementation for udev
      backend, virsh nodedev-event support, and event-test support
      43a6b37b
  12. 02 8月, 2016 2 次提交
  13. 25 6月, 2016 1 次提交
  14. 24 6月, 2016 2 次提交
  15. 17 6月, 2016 1 次提交
  16. 03 5月, 2016 1 次提交
    • E
      virnetsocket: Provide socket address format in a more standard form · 9b45c9f0
      Erik Skultety 提交于
      Our socket address format is in a rather non-standard format and that is
      because sasl library requires the IP address and service to be delimited by a
      semicolon. The string form is a completely internal matter, however once the
      admin interfaces to retrieve client identity information are merged, we should
      return the socket address string in a common format, e.g. format defined by
      URI rfc-3986, i.e. the IP address and service are delimited by a colon and
      in case of an IPv6 address, square brackets are added:
      
      Examples:
          127.0.0.1:1234
          [::1]:1234
      
      This patch changes our default format to the one described above, while adding
      separate methods to request the non-standard SASL format using semicolon as a
      delimiter.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      9b45c9f0
  17. 13 4月, 2016 1 次提交
    • P
      Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED event · 5be12071
      Peter Krempa 提交于
      Since we didn't opt to use one single event for device lifecycle for a
      VM we are missing one last event if the device removal failed. This
      event will be emitted once we asked to eject the device but for some
      reason it is not possible.
      5be12071
  18. 31 3月, 2016 1 次提交
  19. 29 3月, 2016 1 次提交
  20. 24 3月, 2016 1 次提交
  21. 11 3月, 2016 1 次提交
  22. 08 3月, 2016 1 次提交
    • J
      Introduce job completed event · f2893001
      Jiri Denemark 提交于
      The VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event will be triggered once a job
      (such as migration) finishes and it will contain statistics for the job
      as one would get by calling virDomainGetJobStats. Thanks to this event
      it is now possible to get statistics of a completed migration of a
      transient domain on the source host.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      f2893001
  23. 03 3月, 2016 1 次提交
  24. 01 3月, 2016 1 次提交
  25. 03 2月, 2016 2 次提交
    • E
      util: Export remoteSerializeTypedParameters internally via util · 8cd1d546
      Erik Skultety 提交于
      Same as for deserializer, this method might get handy for admin one day.
      The major reason for this patch is to stay consistent with idea, i.e.
      when deserializer can be shared, why not serializer as well. The only
      problem to be solved was that the daemon side serializer uses a code
      snippet which handles sparse arrays returned by some APIs as well as
      removes any string parameters that can't be returned to older clients.
      This patch makes of the new virTypedParameterRemote datatype introduced
      by one of the pvious patches.
      8cd1d546
    • E
      util: Export remoteDeserializeTypedParameters internally via util · 0472cef6
      Erik Skultety 提交于
      Currently, the deserializer is hardcoded into remote_driver which makes
      it impossible for admin to use it. One way to achieve a shared implementation
      (besides moving the code to another module) would be pass @ret_params_val as a
      void pointer as opposed to the remote_typed_param pointer and add a new extra
      argument specifying which of those two protocols is being used and typecast
      the pointer at the function entry. An example from remote_protocol:
      
      struct remote_typed_param_value {
              int type;
              union {
                      int i;
                      u_int ui;
                      int64_t l;
                      uint64_t ul;
                      double d;
                      int b;
                      remote_nonnull_string s;
              } remote_typed_param_value_u;
      };
      typedef struct remote_typed_param_value remote_typed_param_value;
      
      struct remote_typed_param {
              remote_nonnull_string field;
              remote_typed_param_value value;
      };
      
      That would leave us with a bunch of if-then-elses that needed to be used across
      the method. This patch takes the other approach using the new datatype
      introduced in one of earlier commits.
      0472cef6
  26. 21 1月, 2016 1 次提交
  27. 10 8月, 2015 1 次提交
    • M
      rpc: Remove keepalive_required option · a8743c39
      Martin Kletzander 提交于
      Since its introduction in 2011 (particularly in commit f4324e32),
      the option doesn't work.  It just effectively disables all incoming
      connections.  That's because the client private data that contain the
      'keepalive_supported' boolean, are initialized to zeroes so the bool is
      false and the only other place where the bool is used is when checking
      whether the client supports keepalive.  Thus, according to the server,
      no client supports keepalive.
      
      Removing this instead of fixing it is better because a) apparently
      nobody ever tried it since 2011 (4 years without one month) and b) we
      cannot know whether the client supports keepalive until we get a ping or
      pong keepalive packet.  And that won't happen until after we dispatched
      the ConnectOpen call.
      
      Another two reasons would be c) the keepalive_required was tracked on
      the server level, but keepalive_supported was in private data of the
      client as well as the check that was made in the remote layer, thus
      making all other instances of virNetServer miss this feature unless they
      all implemented it for themselves and d) we can always add it back in
      case there is a request and a use-case for it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      a8743c39
  28. 05 6月, 2015 1 次提交
    • E
      remote: fix odd comma operator · c7d0da23
      Eric Blake 提交于
      Commit 1882c0bd accidentally used ',' instead of ';'; oddly
      enough, the result was still syntactically valid (yes, C is
      a fun language).  But it made me do a double take; it's better
      to use idiomatic syntax.
      
      * daemon/remote.c (remoteRelayDomainEventDeviceAdded): Fix
      harmless typo.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c7d0da23
  29. 11 5月, 2015 1 次提交
    • P
      util: Make the virDomainListFree helper more universal · a5e89ae1
      Peter Krempa 提交于
      Extend it to a universal helper used for clearing lists of any objects.
      Note that the argument type is specifically void * to allow implicit
      typecasting.
      
      Additionally add a helper that works on non-NULL terminated arrays once
      we know the length.
      a5e89ae1
  30. 15 4月, 2015 1 次提交
  31. 26 3月, 2015 2 次提交
  32. 25 3月, 2015 1 次提交
    • P
      daemon: Clear fake domain def object that is used to check ACL prior to use · 6ca857c7
      Peter Krempa 提交于
      The fake object is used to pass the domain name and UUID to the ACL code
      for events where we don't have the full domain def when dispatching
      events. The rest of the entries would be left uninitialized. While this
      is not a problem code-wise as the used fields are initialized it looks
      ugly in the debugger.
      6ca857c7