1. 29 11月, 2012 2 次提交
    • O
      node_memory: Do not fail if there is parameter unsupported · ebdbe25a
      Osier Yang 提交于
      It makes no sense to fail the whole getting command if there is
      a parameter unsupported by the kernel. This patch fixes it by
      omitting the unsupported parameter for getMemoryParameters.
      
      And for setMemoryParameters, this checks if there is an unsupported
      parameter up front of the setting, and just returns failure if not
      all parameters are supported.
      ebdbe25a
    • M
      maint: Fix use of invalid reboot flags · 4ded3fb1
      Michal Privoznik 提交于
      Throughout the code, we've always used VIR_DOMAIN_SHUTDOWN* flags
      even for virDomainReboot() API and its implementation. Fortunately,
      the appropriate macros has the same value. But if we want to keep
      things consistent, we should be using the correct macros. This
      patch doesn't break anything, luckily.
      4ded3fb1
  2. 28 11月, 2012 1 次提交
    • M
      Introduce virDomainFSTrim() public API · 0fbf3704
      Michal Privoznik 提交于
      This will call FITRIM within guest. The API has 4 arguments,
      however, only 2 will be used for now (@dom and @minumum).
      The rest two are there if in future qemu guest agent learns them.
      0fbf3704
  3. 19 11月, 2012 1 次提交
    • E
      snapshot: add two more filter sets to API · e9028f4b
      Eric Blake 提交于
      As we enable more modes of snapshot creation, it becomes more important
      to be able to quickly filter based on snapshot properties.  This patch
      introduces new filter flags; subsequent patches will introduce virsh
      back-compat filtering, as well as actual libvirt filtering.
      
      * include/libvirt/libvirt.h.in (virDomainSnapshotListFlags): Add
      five new flags in two new groups.
      * src/libvirt.c (virDomainSnapshotNum, virDomainSnapshotListNames)
      (virDomainListAllSnapshots, virDomainSnapshotNumChildren)
      (virDomainSnapshotListChildrenNames)
      (virDomainSnapshotListAllChildren): Document them.
      * src/conf/snapshot_conf.h (VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS)
      (VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION): Add new convenience filter
      collection macros.
      * tools/virsh-snapshot.c (cmdSnapshotList): Add 5 new flags.
      * tools/virsh.pod (snapshot-list): Document them.
      e9028f4b
  4. 12 11月, 2012 1 次提交
  5. 03 11月, 2012 1 次提交
    • P
      snapshot: Add flag to enable creating checkpoints in live state · 5f75bd4b
      Peter Krempa 提交于
      The default behavior while creating external checkpoints is to pause the
      guest while the memory state is captured. We want the users to sacrifice
      space saving for creating the memory save image while the guest is live
      to minimize downtime.
      
      This patch adds a flag that causes the guest not to be paused before
      taking the snapshot.
       *include/libvirt/libvirt.h.in:
          - add new paused reason: VIR_DOMAIN_PAUSED_SNAPSHOT
          - add new flag for taking snapshot: VIR_DOMAIN_SNAPSHOT_CREATE_LIVE
       *tools/virsh-domain-monitor.c:
          - add string representation for VIR_DOMAIN_PAUSED_SNAPSHOT
       *tools/virsh-snapshot.c:
          - add support for VIR_DOMAIN_SNAPSHOT_CREATE_LIVE
       *tools/virsh.pod:
          - add docs for --live option added to use
          VIR_DOMAIN_SNAPSHOT_CREATE_LIVE flag
      5f75bd4b
  6. 02 11月, 2012 1 次提交
  7. 31 10月, 2012 1 次提交
    • E
      maint: log xml during volume creation · 270a9fef
      Eric Blake 提交于
      I noticed this while answering a list question about Java bindings
      of volume creation.  All other functions that take xml logged xmlDesc.
      
      * src/libvirt.c (virStorageVolCreateXML)
      (virStorageVolCreateXMLFrom): Use consistent spelling of xmlDesc,
      and log the argument.
      270a9fef
  8. 27 10月, 2012 1 次提交
    • E
      blockjob: return appropriate event and info · edecd45c
      Eric Blake 提交于
      Handle the new type of block copy event and info.  Of course,
      this patch does nothing until a later patch actually allows the
      creation/abort of a block copy job.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_JOB_READY): New
      block job status.
      * src/libvirt.c (virDomainBlockRebase): Document the event.
      * src/qemu/qemu_monitor_json.c (eventHandlers): New event.
      (qemuMonitorJSONHandleBlockJobReady): New function.
      (qemuMonitorJSONGetBlockJobInfoOne): Translate new job type.
      (qemuMonitorJSONHandleBlockJobImpl): Handle new event and job type.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Recognize
      the event to minimize snooping.
      * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Snoop a successful
      info query to save effort on a pivot request.
      edecd45c
  9. 24 10月, 2012 1 次提交
    • V
      virNodeGetCPUMap: Define public API. · 7ecc1d81
      Viktor Mihajlovski 提交于
      Adding a new API to obtain information about the
      host node's present, online and offline CPUs.
      
      int virNodeGetCPUMap(virConnectPtr conn,
                           unsigned char **cpumap,
                           unsigned int *online,
                           unsigned int flags);
      
      The function will return the number of CPUs present on the host
      or -1 on failure;
      If cpumap is non-NULL virNodeGetCPUMap will allocate an array
      containing a bit map representation of the online CPUs. It's
      the callers responsibility to deallocate cpumap using free().
      If online is non-NULL, the variable pointed to will contain
      the number of online host node CPUs.
      The variable flags has been added to support future extensions
      and must be set to 0.
      
      Extend the driver structure by nodeGetCPUMap entry in support of the
      new API virNodeGetCPUMap.
      Added implementation of virNodeGetCPUMap to libvirt.c
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7ecc1d81
  10. 22 10月, 2012 1 次提交
    • J
      migrate: v2: use VIR_DOMAIN_XML_MIGRATABLE when available · b6ab7a06
      Ján Tomko 提交于
      In v2 migration protocol, XML is obtained by calling domainGetXMLDesc.
      This includes the default USB controller in XML, which breaks migration
      to older libvirt (before 0.9.2).
      
      Commit 409b5f54
          qemu: Emit compatible XML when migrating a domain
      only fixed this for v3 migration.
      
      This patch uses the new VIR_DOMAIN_XML_MIGRATABLE flag (detected by
      VIR_DRV_FEATURE_XML_MIGRATABLE) to obtain XML without the default controller,
      enabling backward v2 migration.
      b6ab7a06
  11. 20 10月, 2012 1 次提交
    • E
      blockjob: implement shallow commit flag in qemu · 0a220e22
      Eric Blake 提交于
      Now that we can crawl the chain of backing files, we can do
      argument validation and implement the 'shallow' flag.  In
      testing this, I discovered that it can be handy to pass the
      shallow flag and an explicit base, as a means of validating
      that the base is indeed the file we expected.
      
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Crawl through
      chain to implement shallow flag.
      * src/libvirt.c (virDomainBlockCommit): Relax API.
      0a220e22
  12. 16 10月, 2012 1 次提交
    • D
      Make virInitialize thread safe · d507f8f9
      Daniel P. Berrange 提交于
      Currently there is a restriction that multi-threaded applications
      must manually call virInitialize, before threads start using
      libvirt, because it is not thread-safe. By switching it to use
      a virOnceControl initializer we gain thread safety, and thus
      applications no longer need to manually call it. They can rely
      on virConnectOpen invoking it for them.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d507f8f9
  13. 12 10月, 2012 1 次提交
  14. 09 10月, 2012 1 次提交
    • M
      Call curl_global_init from virInitialize to avoid thread-safety issues · 458c4998
      Matthias Bolte 提交于
      curl_global_init is not thread-safe. curl_easy_init might call
      curl_global_init when it was no called before. But curl_easy_init
      can be called from different threads by the ESX driver. Therefore,
      call curl_global_init from virInitialize to stop curl_easy_init from
      calling it.
      
      Reported by Benjamin Wang.
      458c4998
  15. 27 9月, 2012 1 次提交
    • E
      build: avoid older gcc warning · 3da355e8
      Eric Blake 提交于
      Jim Fehlig reported a compilation error with older gcc 4.3.4:
      
      libvirt.c: In function 'virDomainGetEmulatorPinInfo':
      libvirt.c:9111: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
      
      It looks like someone programmed via too much copy-and-paste.
      
      * src/libvirt.c (virDomainGetEmulatorPinInfo): Multiplying by 1 is
      a no-op, and thus will never overflow.
      3da355e8
  16. 25 9月, 2012 1 次提交
    • O
      node_memory: Improve the docs · bb145701
      Osier Yang 提交于
      To declare that it's not recommended to use the tuning API while
      the outside tuning program (such as ksmtuned under Linux) is running.
      bb145701
  17. 21 9月, 2012 1 次提交
  18. 18 9月, 2012 2 次提交
    • L
      network: define new API virNetworkUpdate · 574b9bc6
      Laine Stump 提交于
      This patch adds a new public API virNetworkUpdate that will permit
      updating an existing network configuration without requiring that the
      network be destroyed/restarted for the changes to take effect.
      574b9bc6
    • E
      blockjob: add virDomainBlockCommit · ef1e024d
      Eric Blake 提交于
      A block commit moves data in the opposite direction of block pull.
      Block pull reduces the chain length by dropping backing files after
      data has been pulled into the top overlay, and is always safe; block
      commit reduces the chain length by dropping overlays after data has
      been committed into the backing file, and any files that depended
      on base but not on top are invalidated at any point where they have
      unallocated data that is now pointing to changed contents in base.
      Both directions are useful, however: a qcow2 layer that is more than
      50% allocated will typically be faster with a pull operation, while
      a qcow2 layer with less than 50% allocation will be faster as a
      commit operation.  Committing across multiple layers can be more
      efficient than repeatedly committing one layer at a time, but
      requires extra support from the hypervisor.
      
      This API matches Jeff Cody's proposed qemu command 'block-commit':
      https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02226.html
      
      Jeff's command is still in the works for qemu 1.3, and may gain
      further enhancements, such as the ability to control on-error
      handling (it will be comparable to the error handling Paolo is
      adding to 'drive-mirror', so a similar solution will be needed
      when I finally propose virDomainBlockCopy with more functionality
      than the basics supported by virDomainBlockRebase).  However, even
      without qemu support, this API will be useful for _offline_ block
      commits, by wrapping qemu-img calls and turning them into a block
      job, so this API is worth committing now.
      
      For some examples of how this will be implemented, all starting
      with the chain: base <- snap1 <- snap2 <- active
      
      + These are equivalent:
       virDomainBlockCommit(dom, disk, NULL, NULL, 0, 0)
       virDomainBlockCommit(dom, disk, NULL, "active", 0, 0)
       virDomainBlockCommit(dom, disk, "base", NULL, 0, 0)
       virDomainBlockCommit(dom, disk, "base", "active", 0, 0)
      but cannot be implemented for online qemu with round 1 of
      Jeff's patches; and for offline images, it would require
      three back-to-back qemu-img invocations unless qemu-img
      is patched to allow more efficient multi-layer commits;
      the end result would be 'base' as the active disk with
      contents from all three other files, where 'snap1' and
      'snap2' are invalid right away, and 'active' is invalid
      once any further changes to 'base' are made.
      
      + These are equivalent:
       virDomainBlockCommit(dom, disk, "snap2", NULL, 0, 0)
       virDomainBlockCommit(dom, disk, NULL, NULL, 0, _SHALLOW)
      they cannot be implemented for online qemu, but for offline,
      it is a matter of 'qemu-img commit active', so that 'snap2'
      is now the active disk with contents formerly in 'active'.
      
      + Similarly:
       virDomainBlockCommit(dom, disk, "snap2", NULL, 0, _DELETE)
      for an offline domain will merge 'active' into 'snap2', then
      delete 'active' to avoid leaving a potentially invalid file
      around.
      
      + This version:
       virDomainBlockCommit(dom, disk, NULL, "snap2", 0, _SHALLOW)
      can be implemented online with 'block-commit' passing a base of
      snap1 and a top of snap2; and can be implemented offline by
      'qemu-img commit snap2' followed by 'qemu-img rebase -u
      -b snap1 active'
      
      * include/libvirt/libvirt.h.in (virDomainBlockCommit): New API.
      * src/libvirt.c (virDomainBlockCommit): Implement it.
      * src/libvirt_public.syms (LIBVIRT_0.10.2): Export it.
      * src/driver.h (virDrvDomainBlockCommit): New driver callback.
      * docs/apibuild.py (CParser.parseSignature): Add exception.
      ef1e024d
  19. 17 9月, 2012 4 次提交
    • O
      node_memory: Define the APIs to get/set memory parameters · 12ad7435
      Osier Yang 提交于
      * include/libvirt/libvirt.h.in: (Add macros for the param fields,
        declare the APIs).
      * src/driver.h: (New methods for the driver struct)
      * src/libvirt.c: (Implement the public APIs)
      * src/libvirt_public.syms: (Export the public symbols)
      12ad7435
    • O
      list: Define new API virConnectListAllSecrets · 7a236982
      Osier Yang 提交于
      This is to list the secret objects. Supports to filter the secrets
      by its storage location, and whether it's private or not.
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllSecretFlags
                                    and virConnectListAllSecrets.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllSecrets)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      7a236982
    • O
      list: Define new API virConnectListAllNWFilters · 6498f76e
      Osier Yang 提交于
      This is to list the network filter objects. No flags are supported
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllNWFilterFlags
                                    and virConnectListAllNWFilters.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllNWFilters)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      6498f76e
    • O
      list: Define new API virConnectListAllNodeDevices · c6a3be5d
      Osier Yang 提交于
      This is to list the node device objects, supports to filter the results
      by capability types.
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllNodeDeviceFlags
                                    and virConnectListAllNodeDevices.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllNodeDevices)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      c6a3be5d
  20. 14 9月, 2012 1 次提交
  21. 12 9月, 2012 1 次提交
    • O
      list: Define new API virConnectListAllInterfaces · f4af202f
      Osier Yang 提交于
      This is to list the interface objects, supported filtering flags
      are: active|inactive.
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllInterfaceFlags
                                    and virConnectListAllInterfaces.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllInterfaces)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      f4af202f
  22. 11 9月, 2012 2 次提交
  23. 10 9月, 2012 1 次提交
    • O
      list: Define new API virStoragePoolListAllVolumes · a42eac60
      Osier Yang 提交于
      Simply returns the storage volume objects. No supported filter
      flags.
      
      include/libvirt/libvirt.h.in: Declare the API
      python/generator.py: Skip the function for generating. virStoragePool.py
                           will be added in later patch.
      src/driver.h: virDrvStoragePoolListVolumesFlags
      src/libvirt.c: Implementation for the API.
      src/libvirt_public.syms: Export the symbol to public
      a42eac60
  24. 06 9月, 2012 1 次提交
    • O
      list: Define new API virStorageListAllStoragePools · 075c754a
      Osier Yang 提交于
      This introduces a new API to list the storage pool objects,
      4 groups of flags are provided to filter the returned pools:
      
        * Active or not
      
        * Autostarting or not
      
        * Persistent or not
      
        * And the pool type.
      
      include/libvirt/libvirt.h.in: New enum virConnectListAllStoragePoolFlags;
                                    Declare the API.
      python/generator.py: Skip the generating
      src/driver.h: (virDrvConnectListAllStoragePools)
      src/libvirt.c: Implementation for the API.
      src/libvirt_public.syms: Export the symbol.
      075c754a
  25. 23 8月, 2012 1 次提交
    • M
      qemu: forbid suspend if already pmsuspended · 385ee0e9
      Michal Privoznik 提交于
      If a domain is pmsuspended then virsh suspend will succeed. Beside
      obvious flaw, virsh resume will report success and change domain
      state to running which is another mistake. Therefore we must forbid
      any attempts for suspend and resume when pmsuspended.
      385ee0e9
  26. 22 8月, 2012 2 次提交
  27. 21 8月, 2012 1 次提交
  28. 07 8月, 2012 1 次提交
    • D
      Convert public datatypes to inherit from virObject · 46ec5f85
      Daniel P. Berrange 提交于
      This converts the following public API datatypes to use the
      virObject infrastructure:
      
        virConnectPtr
        virDomainPtr
        virDomainSnapshotPtr
        virInterfacePtr
        virNetworkPtr
        virNodeDevicePtr
        virNWFilterPtr
        virSecretPtr
        virStreamPtr
        virStorageVolPtr
        virStoragePoolPtr
      
      The code is significantly simplified, since the mutex in the
      virConnectPtr object now only needs to be held when accessing
      the per-connection virError object instance. All other operations
      are completely lock free.
      
      * src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
        public datatypes to use virObject
      * src/conf/domain_event.c, src/phyp/phyp_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_process.c, src/storage/storage_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
        tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
        tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
        to use virObjectUnref/virObjectRef
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      46ec5f85
  29. 06 8月, 2012 1 次提交
    • E
      virrandom: make virRandomInitialize an automatic one-shot · 87de27b7
      Eric Blake 提交于
      All callers used the same initialization seed (well, the new
      viratomictest forgot to look at getpid()); so we might as well
      make this value automatic.  And while it may feel like we are
      giving up functionality, I documented how to get it back in the
      unlikely case that you actually need to debug with a fixed
      pseudo-random sequence.  I left that crippled by default, so
      that a stray environment variable doesn't cause a lack of
      randomness to become a security issue.
      
      * src/util/virrandom.c (virRandomInitialize): Rename...
      (virRandomOnceInit): ...and make static, with one-shot call.
      Document how to do fixed-seed debugging.
      * src/util/virrandom.h (virRandomInitialize): Drop prototype.
      * src/libvirt_private.syms (virrandom.h): Don't export it.
      * src/libvirt.c (virInitialize): Adjust caller.
      * src/lxc/lxc_controller.c (main): Likewise.
      * src/security/virt-aa-helper.c (main): Likewise.
      * src/util/iohelper.c (main): Likewise.
      * tests/seclabeltest.c (main): Likewise.
      * tests/testutils.c (virtTestMain): Likewise.
      * tests/viratomictest.c (mymain): Likewise.
      87de27b7
  30. 02 8月, 2012 1 次提交
  31. 01 8月, 2012 1 次提交
  32. 30 7月, 2012 2 次提交