1. 02 11月, 2012 3 次提交
    • E
      snapshot: new XML for external system checkpoint · 4201a7ea
      Eric Blake 提交于
      Each <domainsnapshot> can now contain an optional <memory>
      element that describes how the VM state was handled, similar
      to disk snapshots.  The new element will always appear in
      output; for back-compat, an input that lacks the element will
      assume 'no' or 'internal' according to the domain state.
      
      Along with this change, it is now possible to pass <disks> in
      the XML for an offline snapshot; this also needs to be wired up
      in a future patch, to make it possible to choose internal vs.
      external on a per-disk basis for each disk in an offline domain.
      At that point, using the --disk-only flag for an offline domain
      will be able to work.
      
      For some examples below, remember that qemu supports the
      following snapshot actions:
      
      qemu-img: offline external and internal disk
      savevm: online internal VM and disk
      migrate: online external VM
      transaction: online external disk
      
      =====
      <domainsnapshot>
        <memory snapshot='no'/>
        ...
      </domainsnapshot>
      
      implies that there is no VM state saved (mandatory for
      offline and disk-only snapshots, not possible otherwise);
      using qemu-img for offline domains and transaction for online.
      
      =====
      <domainsnapshot>
        <memory snapshot='internal'/>
        ...
      </domainsnapshot>
      
      state is saved inside one of the disks (as in qemu's 'savevm'
      system checkpoint implementation).  If needed in the future,
      we can also add an attribute pointing out _which_ disk saved
      the internal state; maybe disk='vda'.
      
      =====
      <domainsnapshot>
        <memory snapshot='external' file='/path/to/state'/>
        ...
      </domainsnapshot>
      
      This is not wired up yet, but future patches will allow this to
      control a combination of 'virsh save /path/to/state' plus disk
      snapshots from the same point in time.
      
      =====
      
      So for 1.0.1 (and later, as needed), I plan to implement this table
      of combinations, with '*' designating new code and '+' designating
      existing code reached through new combinations of xml and/or the
      existing DISK_ONLY flag:
      
      domain  memory  disk   disk-only | result
      -----------------------------------------
      offline omit    omit   any       | memory=no disk=int, via qemu-img
      offline no      omit   any       |+memory=no disk=int, via qemu-img
      offline omit/no no     any       | invalid combination (nothing to snapshot)
      offline omit/no int    any       |+memory=no disk=int, via qemu-img
      offline omit/no ext    any       |*memory=no disk=ext, via qemu-img
      offline int/ext any    any       | invalid combination (no memory to save)
      online  omit    omit   off       | memory=int disk=int, via savevm
      online  omit    omit   on        | memory=no disk=default, via transaction
      online  omit    no/ext off       | unsupported for now
      online  omit    no     on        | invalid combination (nothing to snapshot)
      online  omit    ext    on        | memory=no disk=ext, via transaction
      online  omit    int    off       |+memory=int disk=int, via savevm
      online  omit    int    on        | unsupported for now
      online  no      omit   any       |+memory=no disk=default, via transaction
      online  no      no     any       | invalid combination (nothing to snapshot)
      online  no      int    any       | unsupported for now
      online  no      ext    any       |+memory=no disk=ext, via transaction
      online  int/ext any    on        | invalid combination (disk-only vs. memory)
      online  int     omit   off       |+memory=int disk=int, via savevm
      online  int     no/ext off       | unsupported for now
      online  int     int    off       |+memory=int disk=int, via savevm
      online  ext     omit   off       |*memory=ext disk=default, via migrate+trans
      online  ext     no     off       |+memory=ext disk=no, via migrate
      online  ext     int    off       | unsupported for now
      online  ext     ext    off       |*memory=ext disk=ext, via migrate+transaction
      
      * docs/schemas/domainsnapshot.rng (memory): New RNG element.
      * docs/formatsnapshot.html.in: Document it.
      * src/conf/snapshot_conf.h (virDomainSnapshotDef): New fields.
      * src/conf/domain_conf.c (virDomainSnapshotDefFree)
      (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
      Manage new fields.
      * tests/domainsnapshotxml2xmltest.c: New test.
      * tests/domainsnapshotxml2xmlin/*.xml: Update existing tests.
      * tests/domainsnapshotxml2xmlout/*.xml: Likewise.
      4201a7ea
    • D
      Document bracket whitespace rules & add syntax-check rule · a3e95abe
      Daniel P. Berrange 提交于
      This documents the following whitespace rules
      
            if(foo)   // Bad
            if (foo)  // Good
      
            int foo (int wizz)  // Bad
            int foo(int wizz)   // Good
      
            bar = foo (wizz);  // Bad
            bar = foo(wizz);   // Good
      
            typedef int (*foo) (int wizz);  // Bad
            typedef int (*foo)(int wizz);   // Good
      
            int foo( int wizz );  // Bad
            int foo(int wizz);    // Good
      
      There is a syntax-check rule extension to validate all these rules.
      Checking for 'function (...args...)' is quite difficult since it
      needs to ignore valid usage with keywords like 'if (...test...)'
      and while/for/switch. It must also ignore source comments and
      quoted strings.
      
      It is not possible todo this with a simple regex in the normal
      syntax-check style. So a short Perl script is created instead
      to analyse the source. In practice this works well enough. The
      only thing it can't cope with is multi-line quoted strings of
      the form
      
       "start of string\
      more lines\
      more line\
      the end"
      
      but this can and should be written as
      
       "start of string"
       "more lines"
       "more line"
       "the end"
      
      with this simple change, the bracket checking script does not
      have any false positives across libvirt source, provided it
      is only run against .c files. It is not practical to run it
      against .h files, since those use whitespace extensively to
      get alignment (though this is somewhat inconsistent and could
      arguably be fixed).
      
      The only limitation is that it cannot detect a violation where
      the first arg starts with a '*', eg
      
         foo(*wizz);
      
      since this generates too many false positives on function
      typedefs which can't be supressed efficiently.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a3e95abe
    • D
      Release of libvirt-1.0.0 · 2b435c15
      Daniel Veillard 提交于
      * configure.ac docs/news.html.in libvirt.spec.in: update for the new release
      * po/*.po*: update from transifex, a lot of added support e.g. Indian
        languages, and regenerate
      2b435c15
  2. 30 10月, 2012 1 次提交
  3. 26 10月, 2012 1 次提交
  4. 25 10月, 2012 1 次提交
    • M
      esx: Update version checks for vSphere 5.1 · 1e7cd395
      Matthias Bolte 提交于
      Also remove warnings for upcoming versions. There hadn't been any
      compatibility problems with new ESX version over the whole lifetime
      of the ESX driver, so I don't expect any in the future.
      
      Update documentation to mention vSphere 5.x support.
      1e7cd395
  5. 23 10月, 2012 1 次提交
  6. 22 10月, 2012 1 次提交
    • C
      daemon: Avoid 'Could not find keytab file' in syslog · fe772f24
      Cole Robinson 提交于
      On F17 at least, every time libvirtd starts we get this in syslog:
      
      libvirtd: Could not find keytab file: /etc/libvirt/krb5.tab: No such file or directory
      
      This comes from cyrus-sasl, and happens regardless of whether the
      gssapi plugin is requested, which is what actually uses
      /etc/libvirt/krb5.tab.
      
      While cyrus-sasl shouldn't complain, we can easily make it shut up by
      commenting out the keytab value by default.
      
      Also update the keytab comment to the more modern one from qemu's
      sasl config file.
      fe772f24
  7. 20 10月, 2012 1 次提交
    • E
      storage: match RNG to supported driver types · e2c41e48
      Eric Blake 提交于
      At one point, the code passed through arbitrary strings for file
      formats, which supposedly lets qemu handle a new file type even
      before libvirt has been taught to handle it.  However, to properly
      label files, libvirt has to learn the file type anyway, so we
      might as well make our life easier by only accepting file types
      that we are prepared to handle.  This patch lets the RNG validation
      ensure that only known strings are let through.
      
      * docs/schemas/domaincommon.rng (driverFormat): Limit to list of
      supported strings.
      * docs/schemas/domainsnapshot.rng (driver): Likewise.
      e2c41e48
  8. 18 10月, 2012 1 次提交
    • P
      conf: Add support for HyperV Enlightenment features · cc922fdd
      Peter Krempa 提交于
      Hypervisors are starting to support HyperV Enlightenment features that
      improve behavior of guests running Microsoft Windows operating systems.
      
      This patch adds support for the "relaxed" feature that improves timer
      behavior and also establishes a framework to add these features in
      future.
      cc922fdd
  9. 16 10月, 2012 1 次提交
  10. 15 10月, 2012 1 次提交
    • O
      doc: Sort out the relationship between <vcpu>, <vcpupin>, and <emulatorpin> · f108944a
      Osier Yang 提交于
      These 3 elements conflicts with each other in either the doc
      or the underlying codes.
      
      Current problems:
      
      Problem 1:
      
      The doc shouldn't simply say "These settings are superseded
      by CPU tuning. " for element <vcpu>. As except the tuning, <vcpu>
      allows to specify the current, maxmum vcpu number. Apart from that,
      <vcpu> also allows to specify the placement as "auto", which binds
      the domain process to the advisory nodeset from numad.
      
      Problem 2:
      
      Doc for <vcpu> says its "cpuset" specify the physical CPUs
      that the vcpus can be pinned. But it's not the truth, as
      actually it only pin domain process to the specified physical
      CPUs. So either it's a document bug, or code bug.
      
      Problem 3:
      
      Doc for <vcpupin> says it supersed "cpuset" of <vcpu>, it's
      not quite correct, as each <vcpupin> specify the pinning policy
      only for one vcpu. How about the ones which doesn't have
      <vcpupin> specified? it says the vcpu will be pinned to all
      available physical CPUs, but what's the meaning of attribute
      "cpuset" of <vcpu> then?
      
      Problem 4:
      
      Doc for <emulatorpin> says it pin the emulator threads (domain
      process in other context, perhaps another follow up patch to
      cleanup the inconsistency is needed) to the physical CPUs
      specified its attribute "cpuset". Which conflicts with
      <vcpu>'s "cpuset". And actually in the underlying codes,
      it set the affinity for domain process twice if both
      "cpuset" for <vcpu> and <emulatorpin> are specified,
      and <emulatorpin>'s pinning will override <vcpu>'s.
      
      Problem 5:
      
      When "placement" of <vcpu> is "auto" (I.e. uses numad to
      get the advisory nodeset to which the domain process is
      pinned to), it will also be overridden by <emulatorpin>,
      
      This patch is trying to sort out the conflicts or bugs by:
      
      1) Don't say <vcpu> is superseded by <cputune>
      
      2) Keep the semanteme for "cpuset" of <vcpu> (I.e. Still says it
         specify the physical CPUs the virtual CPUs). But modifying it
         to mention it also set the pinning policy for domain process,
         and the CPU placement of domain process specified by "cpuset"
         of <vcpu> will be ingored if <emulatorpin> specified, and
         similary, the CPU placement of vcpu thread will be ignored
         if it has <vcpupin> specified, for vcpu which doesn't have
         <vcpupin> specified, it inherits "cpuset" of <vcpu>.
      
      3) Don't say <vcpu> is supersed by <vcpupin>. If neither <vcpupin>
         nor "cpuset" of <vcpu> is specified, the vcpu will be pinned
         to all available pCPUs.
      
      4) If neither <emulatorpin> nor "cpuset" of <vcpu> is specified,
         the domain process (emulator threads in the context) will be
         pinned to all available pCPUs.
      
      5) If "placement" of <vcpu> is "auto", <emulatorpin> is not allowed.
      
      6) hotplugged vcpus will also inherit "cpuset" of <vcpu>
      
      Codes changes according to above document changes:
      
      1) Inherit def->cpumask for each vcpu which doesn't have <vcpupin>
         specified, during parsing.
      
      2) ping the vcpu which doesn't have <vcpupin> specified to def->cpumask
         either by cgroup for sched_setaffinity(2), which is actually done
         by 1).
      
      3) Error out if "placement" == "auto", and <emulatorpin> is specified.
         Otherwise, <emulatorpin> is honored, and "cpuset" of <cpuset> is
         ignored.
      
      4) Setup cgroup for each hotplugged vcpu, and setup the pinning policy
         by either cgroup or sched_setaffinity(2).
      
      5) Remove cgroup and <vcpupin> for each hot unplugged vcpu.
      
      Patches are following (6 in total except this patch)
      f108944a
  11. 12 10月, 2012 2 次提交
  12. 11 10月, 2012 6 次提交
    • J
      conf: Add support for startupPolicy for USB devices · e658daeb
      Jiri Denemark 提交于
      USB devices can disappear without OS being mad about it, which makes
      them ideal for startupPolicy. With this attribute, USB devices can be
      configured to be mandatory (the default), requisite (will disappear
      during migration if they cannot be found), or completely optional.
      e658daeb
    • J
      locking: Implement lock failure action in sanlock driver · 89364767
      Jiri Denemark 提交于
      While the changes to sanlock driver should be stable, the actual
      implementation of sanlock_helper is supposed to be replaced in the
      future. However, before we can implement a better sanlock_helper, we
      need an administrative interface to libvirtd so that the helper can just
      pass a "leases lost" event to the particular libvirt driver and
      everything else will be taken care of internally. This approach will
      also allow libvirt to pass such event to applications and use
      appropriate reasons when changing domain states.
      
      The temporary implementation handles all actions directly by calling
      appropriate libvirt APIs (which among other things means that it needs
      to know the credentials required to connect to libvirtd).
      89364767
    • J
      locking: Pass hypervisor driver name when acquiring locks · d236f3fc
      Jiri Denemark 提交于
      This is required in case a lock manager needs to contact libvirtd in
      case of an unexpected event.
      d236f3fc
    • J
      conf: Add on_lockfailure event configuration · 76f5bcab
      Jiri Denemark 提交于
      Using this new element, one can configure an action that should be
      performed when resource locks are lost.
      76f5bcab
    • J
      conf: Rename life cycle actions to event actions · d0ea530b
      Jiri Denemark 提交于
      While current on_{poweroff,reboot,crash} action configuration is about
      configuring life cycle actions, they can all be considered events and
      actions that need to be done on a particular event. Let's generalize the
      code by renaming life cycle actions to event actions so that it can be
      reused later for non-lifecycle events.
      d0ea530b
    • Z
      0ec6aebb
  13. 09 10月, 2012 1 次提交
  14. 05 10月, 2012 1 次提交
    • E
      docs: fix links in migration.html TOC · eeb8c924
      Eric Blake 提交于
      Use of the wrong attribute name caused the table of contents to
      be useless.  Fix suggested by Daniel P. Berrange.
      
      * docs/migration.html.in: Use correct anchoring attribute.
      eeb8c924
  15. 04 10月, 2012 2 次提交
  16. 03 10月, 2012 1 次提交
  17. 25 9月, 2012 1 次提交
  18. 24 9月, 2012 1 次提交
    • D
      Release of libvirt-0.10.2 · f8fbeb50
      Daniel Veillard 提交于
      * configure.ac docs/news.html.in libvirt.spec.in: update for the release
      * po/*.po*: update from transifex and regenerate
      f8fbeb50
  19. 21 9月, 2012 3 次提交
  20. 20 9月, 2012 2 次提交
    • M
      Add support for limiting guest coredump · 78f3666f
      Martin Kletzander 提交于
      Sometimes when guest machine crashes, coredump can get huge due to the
      guest memory. This can be limited using madvise(2) system call and is
      being used in QEMU hypervisor. This patch adds an option for configuring
      that in the domain XML and related documentation.
      78f3666f
    • M
      Add support for reboot-timeout · c33a922f
      Martin Kletzander 提交于
      Whenever the guest machine fails to boot, new parameter (reboot-timeout)
      controls whether it should reboot and after how many ms it should do so.
      
      Docs included.
      c33a922f
  21. 18 9月, 2012 4 次提交
    • M
      Fix minor details not only in apic eoi · e6bd3ce0
      Martin Kletzander 提交于
      The introduction of APIC EOI patches had a few little details that
      could look better, so this patch fixes that and one more place in the
      file as well (same problem).
      e6bd3ce0
    • R
      Add a ./run script for running programs from the local directory. · 5090c576
      Richard W.M. Jones 提交于
      With this script you can run libvirt programs without needing to
      install them first.  You just have to do for example:
      
        ./run ./tools/virsh [args ...]
      
      If you are already in the tools/ subdirectory, then the following
      command will also work:
      
        ../run ./virsh [...]
      
      You can also run the C programs under valgrind like this:
      
        ./run valgrind [valgrind opts...] ./program
      
      or under gdb:
      
        ./run gdb --args ./program
      
      This also works with sudo (eg. if you need root access for libvirt):
      
        sudo ./run ./tools/virsh list --all
      
      Derived from libguestfs and simplified.  The ./run script in
      libguestfs is much more sophisticated:
      
      https://github.com/libguestfs/libguestfs/blob/master/run.in
      5090c576
    • O
      schema: Add schema for disk <wwn> · dbb7df1f
      Osier Yang 提交于
      * docs/formatdomain.html.in: Add document.
      * docs/schemas/nodedev.rng: Move definition of "wwn" to ...
      * docs/schemas/basictypes.rng: ...Here
      * docs/schemas/domaincommon.rng: Add schema for disk <wwn>
      dbb7df1f
    • 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
  22. 14 9月, 2012 1 次提交
    • M
      Add support for EOI with APIC · 4a8b7cba
      Martin Kletzander 提交于
      New options is added to support EOI (End of Interrupt) exposure for
      guests. As it makes sense only when APIC is enabled, I added this into
      the <apic> element in <features> because this should be tri-state
      option (cannot be handled as standalone feature).
      4a8b7cba
  23. 13 9月, 2012 2 次提交
  24. 12 9月, 2012 1 次提交