1. 08 10月, 2019 1 次提交
    • M
      driver: Introduce virDriverShouldAutostart() · ee16a195
      Michal Privoznik 提交于
      Some of objects we manage can be autostarted on libvirtd startup
      (e.g. domains, network, storage pools). The idea was that when
      the host is started up these objects are started too without need
      of user intervention. However, with the latest daemon split and
      switch to socket activated, short lived daemons (we put --timeout
      120 onto each daemon's command line) this doesn't do what we want
      it to. The problem is not new though, we already had the session
      daemon come and go and we circumvented this problem by
      documenting it (see v4.10.0-92-g61b4e8aa). But now that we meet
      the same problem at all fronts it's time to deal with it.
      
      The solution implemented in this commit is to have a file (one
      per each driver) that:
      
        1) if doesn't exist, is created and autostart is allowed for
           given driver,
      
        2) if it does exist, then autostart is suppressed for given
           driver.
      
      All the files live in a location that doesn't survive host
      reboots (/var/run/ for instance) and thus the file is
      automatically not there on fresh host boot.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      ee16a195
  2. 07 10月, 2019 1 次提交
  3. 27 9月, 2019 2 次提交
  4. 25 9月, 2019 2 次提交
    • P
      util: typedparam: Simplify handling of lists of typed parameters · 33773355
      Peter Krempa 提交于
      Introduce a new set of helpers including a new data structure which
      simplifies keeping and construction of lists of typed parameters.
      
      The use of VIR_RESIZE_N in the virTypedParamsAdd API has performance
      benefits but requires passing around 3 arguments. Use of them lead to a
      set of macros with embedded jumps used in the qemu statistics code.
      
      This patch introduces 'virTypedParamList' type which aggregates the
      necessary list-keeping variables and also a new set of functions to add
      new typed parameters to a list.
      
      These new helpers use printf-like format string and arguments to format
      the argument name as the stats code often uses indexed typed parameters.
      
      The accessor function then allows extracting the typed parameter list in
      the same format as virTypedParamsAdd* functions would do.
      
      One additional benefit is also that the list function can easily be used
      with VIR_AUTOPTR.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      33773355
    • P
      util: typedparam: Move and unexport virTypedParameterAssignFromStr · e532aa61
      Peter Krempa 提交于
      The function is only used as a helper in virTypedParamsAddFromString.
      Make it static and move it to virtypedparam-public.c.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      e532aa61
  5. 19 9月, 2019 2 次提交
  6. 16 9月, 2019 4 次提交
  7. 14 9月, 2019 1 次提交
    • D
      network: fix connection usage counts after restart · 7ab9bdd4
      Daniel P. Berrangé 提交于
      Since the introduction of the virNetworkPort object, the network driver
      has a persistent record of ports that have been created against the
      networks. Thus the hypervisor drivers no longer communicate to the
      network driver during libvirtd restart.
      
      This change, however, meant that the connection usage counts were
      no longer re-initialized during a libvirtd restart. To deal with this we
      must iterate over all virNetworkPortDefPtr objects we have and invoke
      the notify callback to record the connection usage count.
      Reviewed-by: NLaine Stump <laine@laine.org>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      7ab9bdd4
  8. 13 9月, 2019 1 次提交
  9. 12 9月, 2019 1 次提交
  10. 10 9月, 2019 3 次提交
  11. 06 9月, 2019 1 次提交
  12. 23 8月, 2019 2 次提交
    • M
      virpci: Remove unused virPCIDeviceWaitForCleanup · d5b07eae
      Michal Privoznik 提交于
      This function is no longer used after previous commit.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      d5b07eae
    • M
      storage_driver: Protect pool def during startup and build · 13284a6b
      Michal Privoznik 提交于
      In near future the storage pool object lock will be released
      during startPool and buildPool callback (in some backends). But
      this means that another thread may acquire the pool object lock
      and change its definition rendering the former thread access not
      only stale definition but also access freed memory
      (virStoragePoolObjAssignDef() will free old def when setting a
      new one).
      
      One way out of this would be to have the pool appear as active
      because our code deals with obj->def and obj->newdef just fine.
      But we can't declare a pool as active if it's not started or
      still building up. Therefore, have a boolean flag that is very
      similar and forces virStoragePoolObjAssignDef() to store new
      definition in obj->newdef even for an inactive pool. In turn, we
      have to move the definition to correct place when unsetting the
      flag. But that's as easy as calling
      virStoragePoolUpdateInactive().
      
      Technically speaking, change made to
      storageDriverAutostartCallback() is not needed because until
      storage driver is initialized no storage API can run therefore
      there can't be anyone wanting to change the pool's definition.
      But I'm doing the change there for consistency anyways.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      13284a6b
  13. 22 8月, 2019 2 次提交
  14. 16 8月, 2019 1 次提交
  15. 15 8月, 2019 1 次提交
  16. 14 8月, 2019 2 次提交
  17. 09 8月, 2019 1 次提交
  18. 07 8月, 2019 4 次提交
  19. 06 8月, 2019 5 次提交
  20. 27 7月, 2019 3 次提交
    • E
      backup: Add list of checkpoints to domain · b736619f
      Eric Blake 提交于
      Wire up the use of a checkpoint list into each domain, similar to the
      existing snapshot list.  This includes adding a function for checking
      that a redefine operation fits in with the existing list, as well as
      various filtering capabilities over the list contents.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      b736619f
    • E
      backup: Allow for lists of checkpoint objects · 2795d856
      Eric Blake 提交于
      Create a new file for managing a list of checkpoint objects, borrowing
      heavily from existing virDomainSnapshotObjList paradigms.
      
      Note that while snapshots definitely have a use case for multiple
      children to a single parent (create a base snapshot, create a child
      snapshot, revert to the base, then create another child snapshot),
      it's harder to predict how checkpoints will play out with reverting to
      prior points in time. Thus, in initial use, given a list of
      checkpoints, you never have more than one child, and we can treat the
      most-recent leaf node as the parent of the next node creation, without
      having to expose a notion of a current node in XML or public API.
      However, as the snapshot machinery is already generic, it is easier to
      reuse the generic machinery that tracks relations between domain
      moments than it is to open-code a new list-management scheme just for
      checkpoints (hence, we still have internal functions related to a
      current checkpoint, even though that has no observable effect
      externally, as well as the addition of a function to easily find the
      lone leaf in the list to use as the current checkpoint).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      2795d856
    • E
      backup: Parse and output checkpoint XML · 1a4df34a
      Eric Blake 提交于
      Add a new file checkpoint_conf.c that performs the translation to and
      from new XML describing a checkpoint. The code shares a common base
      class with snapshots, since a checkpoint similarly represents the
      domain state at a moment in time. Add some basic testing of round trip
      XML handling through the new code.
      
      Of note - this code intentionally differs from snapshots in that XML
      schema validation is unconditional, rather than based on a public API
      flag.  We have many existing interfaces that still need to add a flag
      for opt-in schema validation, but those interfaces have existing
      clients that may not have been producing strictly-compliant XML, or we
      may still uncover bugs where our RNG grammar is inconsistent with our
      code (where omitting the opt-in flag allows existing apps to keep
      working while waiting for an RNG patch).  But since checkpoints are
      brand-new, it's easier to ensure the code matches the schema by always
      using the schema.  If needed, a later patch could extend the API and
      add a flag to turn on to request schema validation, rather than having
      it forced (possibly just the validation of the <domain> sub-element
      during REDEFINE) - but if a user encounters XML that looks like it
      should be good but fails to validate with our RNG schema, they would
      either have to upgrade to a new libvirt that adds the new flag, or
      upgrade to a new libvirt that fixes the RNG schema, which implies
      adding such a flag won't help much.
      
      Also, the redefine flag requires the <domain> sub-element to be
      present, rather than catering to historical back-compat to older
      versions.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1a4df34a