1. 07 9月, 2012 1 次提交
  2. 06 9月, 2012 2 次提交
    • D
      Remove duplicate symbols and add test case · f299ddd6
      Daniel P. Berrange 提交于
      When the event symbols were added to the public API, not all
      of them were removed from the private exports list. Solaris
      gets unhappy when there are duplicated symbols. Extend the
      symfile check to test for this scenario
      f299ddd6
    • O
      list: Add helpers for listing storage pool objects · 84208a4a
      Osier Yang 提交于
      src/conf/storage_conf.c: Add virStoragePoolMatch to filter the
      pools; Add virStoragePoolList to iterate over the pool objects
      with filter.
      
      src/conf/storage_conf.h: Declare virStoragePoolMatch,
      virStoragePoolList, and the macros for filters.
      
      src/libvirt_private.syms: Export helper virStoragePoolList.
      84208a4a
  3. 03 9月, 2012 1 次提交
    • M
      Add per-guest S3/S4 state configuration · 09cd8f2d
      Martin Kletzander 提交于
      There is a new <pm/> element implemented that can control what ACPI
      sleeping states will be advertised by BIOS and allowed to be switched
      to by libvirt. The default keeps defaults on hypervisor, otherwise
      forces chosen setting.
      The documentation of the pm element is added as well.
      09cd8f2d
  4. 31 8月, 2012 1 次提交
  5. 24 8月, 2012 2 次提交
    • E
      snapshot: rename an enum · 1385c9cd
      Eric Blake 提交于
      The name 'virDomainDiskSnapshot' didn't fit in with our normal
      conventions of using a prefix hinting that it is related to a
      virDomainSnapshotPtr.  Also, a future patch will reuse the
      enum for declaring where the VM memory is stored.
      
      * src/conf/snapshot_conf.h (virDomainDiskSnapshot): Rename...
      (virDomainSnapshotLocation): ...to this.
      (_virDomainSnapshotDiskDef): Update clients.
      * src/conf/domain_conf.h (_virDomainDiskDef): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Likewise.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Likewise.
      * src/conf/snapshot_conf.c: (virDomainSnapshotDiskDefParseXML)
      (virDomainSnapshotAlignDisks, virDomainSnapshotDefFormat):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotDiskPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotCreateDiskActive, qemuDomainSnapshotCreateXML):
      Likewise.
      1385c9cd
    • E
      snapshot: make virDomainSnapshotObjList opaque · 3211deba
      Eric Blake 提交于
      We were failing to react to allocation failure when initializing
      a snapshot object list.  Changing things to store a pointer
      instead of a complete object adds one more possible point of
      allocation failure, but at the same time, will make it easier to
      react to failure now, as well as making it easier for a future
      patch to split all virDomainSnapshotPtr handling into a separate
      file, as I continue to add even more snapshot code.
      
      Luckily, there was only one client outside of domain_conf.c that
      was actually peeking inside the object, and a new wrapper function
      was easy.
      
      * src/conf/domain_conf.h (_virDomainObj): Use a pointer.
      (virDomainSnapshotObjListInit): Rename.
      (virDomainSnapshotObjListFree, virDomainSnapshotForEach): New
      declarations.
      (_virDomainSnapshotObjList): Move definitions...
      * src/conf/domain_conf.c: ...here.
      (virDomainSnapshotObjListInit, virDomainSnapshotObjListDeinit):
      Rename...
      (virDomainSnapshotObjListNew, virDomainSnapshotObjListFree): ...to
      these.
      (virDomainSnapshotForEach): New function.
      (virDomainObjDispose, virDomainListPopulate): Adjust callers.
      * src/qemu/qemu_domain.c (qemuDomainSnapshotDiscard)
      (qemuDomainSnapshotDiscardAllMetadata): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad)
      (qemuDomainUndefineFlags, qemuDomainSnapshotCreateXML)
      (qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
      (qemuDomainListAllSnapshots)
      (qemuDomainSnapshotListChildrenNames)
      (qemuDomainSnapshotNumChildren)
      (qemuDomainSnapshotListAllChildren)
      (qemuDomainSnapshotLookupByName, qemuDomainSnapshotGetParent)
      (qemuDomainSnapshotGetXMLDesc, qemuDomainSnapshotIsCurrent)
      (qemuDomainSnapshotHasMetadata, qemuDomainRevertToSnapshot)
      (qemuDomainSnapshotDelete): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Export new function.
      3211deba
  6. 22 8月, 2012 8 次提交
  7. 21 8月, 2012 4 次提交
  8. 20 8月, 2012 1 次提交
  9. 18 8月, 2012 2 次提交
  10. 16 8月, 2012 3 次提交
    • D
      Move some SASL symbols into libvirt_sasl.syms · eed537c5
      Daniel P. Berrange 提交于
      Previous commit:
      
        commit 9093ab77
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Wed Jul 18 17:03:17 2012 +0100
      
          Add lots of internal symbols to libvirt_private.syms
      
      mistakenly put some conditional SASL symbols in libvirt_private.syms
      instead of libvirt_sasl.syms
      eed537c5
    • L
      conf: add <vlan> element to network and domain interface elements · 3f9274a5
      Laine Stump 提交于
      The following config elements now support a <vlan> subelements:
      
      within a domain: <interface>, and the <actual> subelement of <interface>
      within a network: the toplevel, as well as any <portgroup>
      
      Each vlan element must have one or more <tag id='n'/> subelements.  If
      there is more than one tag, it is assumed that vlan trunking is being
      requested. If trunking is required with only a single tag, the
      attribute "trunk='yes'" should be added to the toplevel <vlan>
      element.
      
      Some examples:
      
        <interface type='hostdev'/>
          <vlan>
            <tag id='42'/>
          </vlan>
          <mac address='52:54:00:12:34:56'/>
          ...
        </interface>
      
        <network>
          <name>vlan-net</name>
          <vlan trunk='yes'>
            <tag id='30'/>
          </vlan>
          <virtualport type='openvswitch'/>
        </network>
      
        <interface type='network'/>
          <source network='vlan-net'/>
          ...
        </interface>
      
        <network>
          <name>trunk-vlan</name>
          <vlan>
            <tag id='42'/>
            <tag id='43'/>
          </vlan>
          ...
        </network>
      
        <network>
          <name>multi</name>
          ...
          <portgroup name='production'/>
            <vlan>
              <tag id='42'/>
            </vlan>
          </portgroup>
          <portgroup name='test'/>
            <vlan>
              <tag id='666'/>
            </vlan>
          </portgroup>
        </network>
      
        <interface type='network'/>
          <source network='multi' portgroup='test'/>
          ...
        </interface>
      
      IMPORTANT NOTE: As of this patch there is no backend support for the
      vlan element for *any* network device type. When support is added in
      later patches, it will only be for those select network types that
      support setting up a vlan on the host side, without the guest's
      involvement. (For example, it will be possible to configure a vlan for
      a guest connected to an openvswitch bridge, but it won't be possible
      to do that for one that is connected to a standard Linux host bridge.)
      3f9274a5
    • L
      util: add virNetDevVlanType · cfbdd005
      Laine Stump 提交于
      To allow for the possibility of vlan "trunks", which have more than
      one vlan tag associated with them, we need a vlan struct. Since it
      will be used by multiple files in src/util, src/conf, src/network, and
      src/qemu, it must be defined in src/util. Unfortunately there isn't
      currently a common file for simple netdev data definitions, so I
      created a new file.
      cfbdd005
  11. 15 8月, 2012 5 次提交
    • D
      Refactor RPC client private data setup · 39b5e4d4
      Daniel P. Berrange 提交于
      Currently there is a hook function that is invoked when a
      new client connection comes in, which allows an app to
      setup private data. This setup will make it difficult to
      serialize client state during process re-exec(). Change to
      a model where the app registers a callback when creating
      the virNetServerPtr instance, which is used to allocate
      the client private data immediately during virNetClientPtr
      construction.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      39b5e4d4
    • D
      Allow sync IO and keepalives to be skipped in RPC client setup · 86f5457d
      Daniel P. Berrange 提交于
      Currently the virNetClientPtr constructor will always register
      the async IO event handler and the keepalive objects. In the
      case of the lock manager, there will be no event loop available
      nor keepalive support required. Split this setup out of the
      constructor and into separate methods.
      
      The remote driver will enable async IO and keepalives, while
      the LXC driver will only enable async IO
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      86f5457d
    • D
      Change interaction when accepting new RPC client connections · 95e49be5
      Daniel P. Berrange 提交于
      Currently the virNetServerServicePtr is responsible for
      creating the virNetServerClientPtr instance when accepting
      a new connection. Change this so that the virNetServerServicePtr
      merely gives virNetServerPtr a virNetSocketPtr instance. The
      virNetServerPtr can then create the virNetServerClientPtr
      as it desires
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      95e49be5
    • D
      Add APIs for virThreadPoolPtr to query some config params · 2241582c
      Daniel P. Berrange 提交于
      It is desirable to be able to query the config params of
      the thread pool, in order to save the server state. Add
      virThreadPoolGetMinWorkers, virThreadPoolGetMaxWorkers
      and virThreadPoolGetPriorityWorkers APIs.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2241582c
    • L
      util: utility functions for virNetDevVPortProfile · 1c02ed14
      Laine Stump 提交于
      This patch adds three utility functions that operate on
      virNetDevVPortProfile objects.
      
      * virNetDevVPortProfileCheckComplete() - verifies that all attributes
          required for the type of the given virtport are specified.
      
      * virNetDevVPortProfileCheckNoExtras() - verifies that there are no
          attributes specified which are inappropriate for the type of the
          given virtport.
      
      * virNetDevVPortProfileMerge3() - merges 3 virtports into a single,
          newly allocated virtport. If any attributes are specified in
          more than one of the three sources, and do not exactly match,
          an error is logged and the function fails.
      
      These new functions depend on new fields in the virNetDevVPortProfile
      object that keep track of whether or not each attribute was
      specified. Since the higher level parse function doesn't yet set those
      fields, these functions are not actually usable yet (but that's okay,
      because they also aren't yet used - all of that functionality comes in
      a later patch.)
      
      Note that these three functions return 0 on success and -1 on
      failure. This may seem odd for the first two Check functions, since
      they could also easily return true/false, but since they actually log
      an error when the requested condition isn't met (and should result in
      a failure of the calling function), I thought 0/-1 was more
      appropriate.
      1c02ed14
  12. 14 8月, 2012 2 次提交
    • D
      Add virRandom() API to generate numbers with non-power-of-2 limit · aa5bd8b9
      Daniel P. Berrange 提交于
      The current virRandomBits() API is only usable if the caller wants
      a random number in the range [0, n-1) where n is a power of two.
      This adds a virRandom() API which generates a double in the
      range [0.0,1.0) with 48 bits of entropy. It then also adds a
      virRandomInt(uint32_t max) API which generates an unsigned
      in the range [0,@max)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aa5bd8b9
    • M
      json: fix interface locale dependency · 43bfa23e
      Martin Kletzander 提交于
      libvirt creates invalid commands if wrong locale is selected. For
      example with locale that uses comma as a decimal point, JSON commands
      created with decimal numbers are invalid because comma separates the
      entries in JSON. Fortunately even when decimal point is affected,
      thousands grouping is not, because for grouping to be enabled with
      *printf, there has to be an apostrophe flag specified (and supported).
      
      This patch adds specific internal function for converting doubles to
      strings with C locale.
      43bfa23e
  13. 10 8月, 2012 1 次提交
    • L
      nwfilter: fix crash during filter define when lxc driver failed startup · b8a56f12
      Laine Stump 提交于
      The meat of this patch is just moving the calls to
      virNWFilterRegisterCallbackDriver from each hypervisor's "register"
      function into its "initialize" function. The rest is just code
      movement to allow that, and a new virNWFilterUnRegisterCallbackDriver
      function to undo what the register function does.
      
      The long explanation:
      
      There is an array in nwfilter called callbackDrvArray that has
      pointers to a table of functions for each hypervisor driver that are
      called by nwfilter. One of those function pointers is to a function
      that will lock the hypervisor driver. Entries are added to the table
      by calling each driver's "register" function, which happens quite
      early in libvirtd's startup.
      
      Sometime later, each driver's "initialize" function is called. This
      function allocates a driver object and stores a pointer to it in a
      static variable that was previously initialized to NULL. (and here's
      the important part...) If the "initialize" function fails, the driver
      object is freed, and that pointer set back to NULL (but the entry in
      nwfilter's callbackDrvArray is still there).
      
      When the "lock the driver" function mentioned above is called, it
      assumes that the driver was successfully loaded, so it blindly tries
      to call virMutexLock on "driver->lock".
      
      BUT, if the initialize never happened, or if it failed, "driver" is
      NULL. And it just happens that "lock" is always the first field in
      driver so it is also NULL.
      
      Boom.
      
      To fix this, the call to virNWFilterRegisterCallbackDriver for each
      driver shouldn't be called until the end of its (*already guaranteed
      successful*) "initialize" function, not during its "register" function
      (which is currently the case). This implies that there should also be
      a virNWFilterUnregisterCallbackDriver() function that is called in a
      driver's "shutdown" function (although in practice, that function is
      currently never called).
      b8a56f12
  14. 07 8月, 2012 7 次提交