1. 30 3月, 2012 5 次提交
  2. 29 3月, 2012 3 次提交
    • Z
      private.syms: Add virNetDevMacVLanRestartWithVPortProfile · a1e50e82
      Zhou Peng 提交于
      virNetDevMacVLanRestartWithVPortProfile is omitted in src/libvirt_private.syms,
      which causes link err.
      a1e50e82
    • C
      qemu: Make migration fail when port profile association fails on the dst host · a02500d0
      Christian Benvenuti 提交于
      In the current V3 migration protocol, Libvirt does not
      check the result of the function
      
        qemuMigrationVPAssociatePortProfiles
      
      This means that it is possible for a migration to complete
      successfully even when the VM loses network connectivity on
      the destination host.
      
      With this change libvirt aborts the migration
      (during the "finish" step) when the above function fails, that
      is to say when at least one of the port profile associations fails.
      
      Signed-off by: Christian Benvenuti <benve@cisco.com>
      a02500d0
    • C
      Set default name for SPICE agent channel · b0e2bb33
      Christophe Fergeau 提交于
      libvirt documentation for channels with type 'spicevmc' says that the
      'target' child node has:
      "an optional attribute name controls how the guest will have access
       to the channel, and defaults to name='com.redhat.spice.0'."
      
      However, this default value is never set in libvirt code base,
      there's only a check in qemu_command.c to error out if the name
      attribute doesn't have the expected value (if it's set).
      
      This commit sets a default target name for spicevmc channels during
      the domain configuration parsing so that the code agrees with the
      documentation.
      b0e2bb33
  3. 28 3月, 2012 6 次提交
    • A
      virsh: plug memory leaks on failure path · 03ca3317
      Alex Jia 提交于
      Leaks are introduced in commit 1cf0e3db and fe383bb5.
      
      Fixing memory leaks, in addition, the patch also fixes a potential missing
      return value issue in 'if (from)' statement, without the fixing, although
      the programming met a error, the subsequent codes will be executed
      continually.
      
      * tools/virsh.c (cmdSnapshotList): fix memory leaks and missing return value.
      
      * How to reproduce?
      
      % virsh snapshot-list <domain> --parent --roots
      % virsh snapshot-list <domain> --parent --tree
      % virsh snapshot-list <domain> --roots --tree
      
      actual result:
      error: --parent and --roots are mutually exclusive
      error: Failed to disconnect from the hypervisor, 1 leaked reference(s)
      
      error: --parent and --tree are mutually exclusive
      error: Failed to disconnect from the hypervisor, 1 leaked reference(s)
      
      error: --roots and --tree are mutually exclusive
      error: Failed to disconnect from the hypervisor, 1 leaked reference(s)
      
      % virsh snapshot-create-as <domain> --name "hello"
      % virsh snapshot-create-as <domain> --name "libvirt"
      % virsh snapshot-list <domain> --roots --from "hello"
      
      actual result:
      error: --roots and --from are mutually exclusive
       Name                 Creation Time             State
      ------------------------------------------------------------
       libvirt              2012-03-28 13:46:51 +0800 running
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      03ca3317
    • G
      python: make python APIs use these helper functions · 1aeb3d9e
      Guannan Ren 提交于
          *setPyVirTypedParameter
          *libvirt_virDomainGetCPUStats
      1aeb3d9e
    • G
      python: Add new helper functions for python to C integral conversion · 384ebd3f
      Guannan Ren 提交于
          int libvirt_intUnwrap(PyObject *obj, int *val);
          int libvirt_uintUnwrap(PyObject *obj, unsigned int *val);
          int libvirt_longUnwrap(PyObject *obj, long *val);
          int libvirt_ulongUnwrap(PyObject *obj, unsigned long *val);
          int libvirt_longlongUnwrap(PyObject *obj, long long *val);
          int libvirt_ulonglongUnwrap(PyObject *obj, unsigned long long *val);
          int libvirt_doubleUnwrap(PyObject *obj, double *val);
          int libvirt_boolUnwrap(PyObject *obj, bool *val);
      384ebd3f
    • E
      snapshot: fix virsh docs · 3ff4b069
      Eric Blake 提交于
      Commit d42a2ffc forgot to touch up virsh documentation, and commit
      4e9953a4 mis-spelled the option name.
      
      * tools/virsh.pod (snapshot-create, snapshot-create-as): Fix typo
      and match recent change in flag meaning.
      3ff4b069
    • D
      Enable all warnings permanently & default to -Werror for GIT builds · 851117bd
      Daniel P. Berrange 提交于
      Given that we auto-detect whether each -Wxxxx flag is supported by
      GCC, and we are warning-free and use automake silent rules, there
      is no compelling reason to allow compile warnings to be disabled.
      
      Replace the --enable-compile-warnings flag with a simpler
      --enable-werror flag, which defaults to 'yes' if building
      from GIT, or 'no' if building from tar.gz
      
      This helps ensure that everyone writing patches for libvirt will
      take care to fix their warning problems before submitting for
      review
      
      * autobuild.sh: Force -Werror
      * configure.ac: Update for LIBVIRT_COMPILE_WARNINGS macro change
      * m4/virt-compile-warnings.m4: Permanently enable all warnings,
        auto-enable Werror for GIT builds
      851117bd
    • D
      Enable build of test suite programs by default for GIT checkouts · 3a2fc277
      Daniel P. Berrange 提交于
      Add a new flag '--with-test-suite' to configure to control whether
      the test suite binaries are built by default. ie built with a
      plain 'make', as opposed to delayed until 'make check'
      
      For builds from tar.gz tests will not be built by default. For
      builds from GIT, tests with be on by default, to try and ensure
      that patch developers don't accidentally break the test suites
      without noticing.
      
      * configure.ac: Add --with-test-suite
      * tests/Makefile.am: Use noinst_PROGRAMS instead of check_PROGRAMS
        if building tests by default. Consolidate setting of TESTS and
        {noinst,check}_PROGRAMS to avoid duplication
      3a2fc277
  4. 27 3月, 2012 13 次提交
    • S
      Change the default of mdns_adv to false · 53e1d56d
      Stef Walter 提交于
       * Don't advertise information on the network without consent of
         the user, either through manual configuration, or a user
         interface that drives this option.
       * Since libvirtd must be configured for network access anyway
         (for all but ssh), this setting was not useful "out of the box",
         so changing this default setting does not remove "out of the box"
         functionality.
      53e1d56d
    • E
      snapshot: don't pass NULL to QMP command creation · a14eda31
      Eric Blake 提交于
      Commit d42a2ffc caused a regression in creating a disk-only snapshot
      of a qcow2 disk; by passing the wrong variable to the monitor call,
      libvirt ended up creating JSON that looked like "format":null instead
      of the intended "format":"qcow2".
      
      To make it easier to diagnose this in the future, make JSON creation
      error out if "s:arg" is paired with NULL (it is still possible to
      use "n:arg" in the rare cases where qemu will accept a null).
      
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotCreateSingleDiskActive): Pass correct value.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMakeCommandRaw):
      Improve error message.
      a14eda31
    • D
      Add LXC XML files to schema test & fix problems this uncovers · 72c50731
      Daniel P. Berrange 提交于
      * docs/schemas/domaincommon.rng: Add missing lxc & openvz
        console target types. Allow arch on LXC <os> type element
      * tests/domainschematest: Include tests/lxcxml2xmldata/
      72c50731
    • D
      Add support for setting init argv for LXC · c91cff25
      Daniel P. Berrange 提交于
      Pass argv to the init binary of LXC, using a new <initarg> element.
      
      * docs/formatdomain.html.in: Document <os> usage for containers
      * docs/schemas/domaincommon.rng: Add <initarg> element
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
        formatting of <initarg>
      * src/lxc/lxc_container.c: Setup LXC argv
      * tests/Makefile.am, tests/lxcxml2xmldata/lxc-systemd.xml,
        tests/lxcxml2xmltest.c, tests/testutilslxc.c,
        tests/testutilslxc.h: Test parsing/formatting of LXC related
        XML parts
      c91cff25
    • D
      Detect location fo selinux mount point · eb8f31c1
      Daniel P. Berrange 提交于
      The SELinux mount point moved from /selinux to /sys/fs/selinux
      when systemd came along.
      
      * configure.ac: Probe for SELinux mount point
      * src/lxc/lxc_container.c: Use SELinux mount point determined
        by configure.ac
      eb8f31c1
    • D
      Expand docs for timer tick policy · 05e981df
      Daniel P. Berrange 提交于
      05e981df
    • D
      qemu,util: on restart of libvirt restart vepa callbacks · bd6b0a05
      D. Herrendoerfer 提交于
      When libvirtd is restarted, also restart the netlink event
      message callbacks for existing VEPA connections and send
      a message to lldpad for these existing links, so it learns
      the new libvirtd pid.
      Signed-off-by: ND. Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
      bd6b0a05
    • J
      qemu: Avoid entering monitor with locked driver · 2067e31b
      Jiri Denemark 提交于
      This avoids possible deadlock of the qemu driver in case a domain is
      begin migrated (in Begin phase) and unrelated connection to qemu driver
      is closed at the right time.
      
      I checked all callers of qemuDomainCheckEjectableMedia() and they are
      calling this function with qemu driver locked.
      2067e31b
    • L
      build: fix "missing initializer" error in qemu_process.c · ecb4d92d
      Laine Stump 提交于
      Found when attempting to build on Fedora 17 alpha with:
      
         ./autogen.sh --system --enable-compile-warnings=error
      
      (this same build command works without problem on Fedora 16). Since
      the consumer of the qemuProcessReconnectData doesn't assume that the
      other fields of the struct are initialized (although it uses them
      internally), the simpler solution is to just switch to C99-style
      struct initialization (which doesn't require specification of all
      fields).
      ecb4d92d
    • L
      build: fix "missing initializer" errors in virsh.c · 05c25e60
      Laine Stump 提交于
      Found when attempting to build on Fedora 17 alpha with:
      
         ./autogen.sh --system --enable-compile-warnings=error
      
      (this same build command works without problem on Fedora 16). All
      other struct initializers for this struct have the extra field filled
      in (almost always to 0), so the two errant ones were fixed by adding
      in the extra 0 field.
      05c25e60
    • L
      build: avoid frame size error when building without -O2 · cf57d345
      Laine Stump 提交于
      libvirt always adds -Werror-frame-larger-than=4096 to the flags when
      it builds. When building on Fedora 17, two functions with multiple
      1024 buffers declared inside if {} blocks would generate frame size
      errors; apparently the version of gcc on Fedora 16 will merge these
      multiple buffers into a single buffer even when optimization is off,
      but Fedora 17 won't.
      
      The fix is to declare a single 1024 buffer at the top of the two
      offending functions, and reuse the single buffer throughout the
      functions.
      cf57d345
    • M
      Added syntax-check rule for return with parentheses · f0944525
      Martin Kletzander 提交于
      After cleanup introduced with previous commit, there is a need for
      syntax-check rule taking care of return(). Regexp used in 'prohibit'
      parameter is taken from the cleanup commit and modified so it fits
      'grep -E' format. Semicolon at the end is needed, otherwise the regexp
      could match return with cast.
      
      Exception is created for python source files because we don't have any
      documentation restricting the use of return that matches this case.
      f0944525
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  5. 26 3月, 2012 1 次提交
    • E
      Fix and test round-trip of query parameters · 70c07e01
      Eric Blake 提交于
      When qparams support was dropped in commit bc1ff160, we forgot
      to add tests to ensure that viruri can do the same round trip
      handling of a URI. This round trip was broken, due to use
      of the old 'query' field of xmlUriPtr, instead of the new
      'query_raw'
      
      Also, we forgot to report an OOM error.
      
      * tests/viruritest.c (mymain): Add tests based on just-deleted
      qparamtest.
      (testURIParse): Allow difference in input and expected output.
      * src/util/viruri.c (virURIFormat): Add missing error. Use
        query_raw, instead of query for xmlUriPtr object.
      70c07e01
  6. 24 3月, 2012 11 次提交
    • O
      spec: Add missed dependancy for numad · beb76e37
      Osier Yang 提交于
      numad is available since Fedora 17 and RHEL6.X. And it's not supported
      on s390[x] and ARM.
      beb76e37
    • E
      snapshot: improve qemu handling of reused snapshot targets · d42a2ffc
      Eric Blake 提交于
      The oVirt developers have stated that the real reasons they want
      to have qemu reuse existing volumes when creating a snapshot are:
      1. the management framework is set up so that creation has to be
      done from a central node for proper resource tracking, and having
      libvirt and/or qemu create things violates the framework, and
      2. qemu defaults to creating snapshots with an absolute path to
      the backing file, but oVirt wants to manage a backing chain that
      uses just relative names, to allow for easier migration of a chain
      across storage locations.
      
      When 0.9.10 added VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT (commit
      4e9953a4), it only addressed point 1, but libvirt was still using
      O_TRUNC which violates point 2.  Meanwhile, the new qemu
      'transaction' monitor command includes a new optional mode argument
      that will force qemu to reuse the metadata of the file it just
      opened (with the burden on the caller to have valid metadata there
      in the first place).  So, this tweaks the meaning of the flag to
      cover both points as intended for use by oVirt.  It is not strictly
      backward-compatible to 0.9.10 behavior, but it can be argued that
      the O_TRUNC of 0.9.10 was a bug.
      
      Note that this flag is all-or-nothing, and only selects between
      'existing' and the default 'absolute-paths'.  A more flexible
      approach that would allow per-disk selections, as well as adding
      support for the 'no-backing-file' mode, would be possible by
      extending the <domainsnapshot> xml to have a per-disk mode, but
      until we have a management application expressing a need for that
      additional complexity, it is not worth doing.
      
      * src/libvirt.c (virDomainSnapshotCreateXML): Tweak documentation.
      * src/qemu/qemu_monitor.h (qemuMonitorDiskSnapshot): Add
      parameters.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskSnapshot):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorDiskSnapshot): Pass them
      through.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot): Use
      new monitor command arguments.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive)
      (qemuDomainSnapshotCreateSingleDiskActive): Adjust callers.
      (qemuDomainSnapshotDiskPrepare): Allow qed, modify rules on reuse.
      d42a2ffc
    • E
      snapshot: wire up qemu transaction command · 0436d328
      Eric Blake 提交于
      The hardest part about adding transactions is not using the new
      monitor command, but undoing the partial changes we made prior
      to a failed transaction.
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive): Use
      transaction when available.
      (qemuDomainSnapshotUndoSingleDiskActive): New function.
      (qemuDomainSnapshotCreateSingleDiskActive): Pass through actions.
      (qemuDomainSnapshotCreateXML): Adjust caller.
      0436d328
    • E
      snapshot: add support for qemu transaction command · 64d5e815
      Eric Blake 提交于
      QEmu 1.1 is adding a 'transaction' command to the JSON monitor.
      Each element of a transaction corresponds to a top-level command,
      with the additional guarantee that the transaction flushes all
      pending I/O, then guarantees that all actions will be successful
      as a group or that failure will roll back the state to what it
      was before the monitor command.  The difference between a
      top-level command:
      
      { "execute": "blockdev-snapshot-sync", "arguments":
        { "device": "virtio0", ... } }
      
      and a transaction:
      
      { "execute": "transaction", "arguments":
        { "actions": [
          { "type": "blockdev-snapshot-sync", "data":
            { "device": "virtio0", ... } } ] } }
      
      is just a couple of changed key names and nesting the shorter
      command inside a JSON array to the longer command.  This patch
      just adds the framework; the next patch will actually use a
      transaction.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMakeCommand): Move
      guts...
      (qemuMonitorJSONMakeCommandRaw): ...into new helper.  Add support
      for array element.
      (qemuMonitorJSONTransaction): New command.
      (qemuMonitorJSONDiskSnapshot): Support use in a transaction.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskSnapshot): Add
      argument.
      (qemuMonitorJSONTransaction): New declaration.
      * src/qemu/qemu_monitor.h (qemuMonitorTransaction): Likewise.
      (qemuMonitorDiskSnapshot): Add argument.
      * src/qemu/qemu_monitor.c (qemuMonitorTransaction): New wrapper.
      (qemuMonitorDiskSnapshot): Pass argument on.
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotCreateSingleDiskActive): Update caller.
      64d5e815
    • E
      snapshot: rudimentary qemu support for atomic disk snapshot · 4c4cc1b9
      Eric Blake 提交于
      Taking an external snapshot of just one disk is atomic, without having
      to pause and resume the VM.  This also paves the way for later patches
      to interact with the new qemu 'transaction' monitor command.
      
      The various scenarios when requesting atomic are:
      online, 1 disk, old qemu - safe, allowed by this patch
      online, more than 1 disk, old qemu - failure, this patch
      offline snapshot - safe, once a future patch implements offline disk snapshot
      online, 1 or more disks, new qemu - safe, once future patch uses transaction
      
      Taking an online system checkpoint snapshot is atomic, since it is
      done via a single 'savevm' monitor command.  Taking an offline system
      checkpoint snapshot is atomic, thanks to the previous patch.
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Support
      new flag for single-disk setups.
      (qemuDomainSnapshotDiskPrepare): Check for atomic here.
      (qemuDomainSnapshotCreateDiskActive): Skip pausing the VM when
      atomic supported.
      (qemuDomainSnapshotIsAllowed): Use bool instead of int.
      4c4cc1b9
    • E
      snapshot: make offline qemu snapshots atomic · 922d498e
      Eric Blake 提交于
      Offline internal snapshots can be rolled back with just a little
      bit of refactoring, meaning that we are now automatically atomic.
      
      * src/qemu/qemu_domain.c (qemuDomainSnapshotForEachQcow2): Move
      guts...
      (qemuDomainSnapshotForEachQcow2Raw): ...to new helper, to allow
      rollbacks.
      922d498e
    • E
      snapshot: add atomic create flag · 4d5533ca
      Eric Blake 提交于
      Right now, it is appallingly easy to cause qemu disk snapshots
      to alter a domain then fail; for example, by requesting a two-disk
      snapshot where the second disk name resides on read-only storage.
      In this failure scenario, libvirt reports failure, but modifies
      the live domain XML in-place to record that the first disk snapshot
      was taken; and places a difficult burden on the management app
      to grab the XML and reparse it to see which disks, if any, were
      altered by the partial snapshot.
      
      This patch adds a new flag where implementations can request that
      the hypervisor make snapshots atomically; either no changes to
      XML occur, or all disks were altered as a group.  If you request
      the flag, you either get outright failure up front, or you take
      advantage of hypervisor abilities to make an atomic snapshot. Of
      course, drivers should prefer the atomic means even without the
      flag explicitly requested.
      
      There's no way to make snapshots 100% bulletproof - even if the
      hypervisor does it perfectly atomic, we could run out of memory
      during the followup tasks of updating our in-memory XML, and report
      a failure.  However, these sorts of catastrophic failures are rare
      and unlikely, and it is still nicer to know that either all
      snapshots happened or none of them, as that is an easier state to
      recover from.
      
      * include/libvirt/libvirt.h.in
      (VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC): New flag.
      * src/libvirt.c (virDomainSnapshotCreateXML): Document it.
      * tools/virsh.c (cmdSnapshotCreate, cmdSnapshotCreateAs): Expose it.
      * tools/virsh.pod (snapshot-create, snapshot-create-as): Document
      it.
      4d5533ca
    • E
      snapshot: add qemu capability for 'transaction' command · 311357d9
      Eric Blake 提交于
      We need a capability bit to gracefully error out if some of the
      additions in future patches can't be implemented by the running qemu.
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_TRANSACTION): New cap.
      * src/qemu/qemu_capabilities.c (qemuCaps): Name it.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
      it.
      311357d9
    • E
      build: drop obsolete qparams test · 98ada9ab
      Eric Blake 提交于
      Otherwise, 'make check' breaks since commit bc1ff160 deleted
      qparams.h.  A later patch will ensure that viruri takes over
      what qparams used to do.
      
      * tests/qparamtest.c (mymain): Delete, now that we have viruri.
      * tests/Makefile.am (check_PROGRAMS, TESTS, qparamtest_SOURCES):
      Delete old test.
      * .gitignore: Add recent test additions.
      98ada9ab
    • E
      build: fix incorrect enum declaration · 9b6860f5
      Eric Blake 提交于
      Recent changes have caused build failures on systems where pdwtags works:
      commit a26a1969 mistakenly exported a public variable
      commits a26a1969, 57ddcc23, 487c0633 all had copy-paste bugs in
      hand-updating the golden API rather than rerunning pdwtags
      
      * include/libvirt/libvirt.h.in (virDomainEventTrayChangeReason):
      Make this a typedef, not external storage.
      * src/remote_protocol-structs (remote_procedure): Fix spelling.
      9b6860f5
    • L
      Add qemu support for ppc64 on FC16 or above for rpm packaging · 81203257
      Li Zhang 提交于
      On Fedora16 or above, qemu is supported now. So it is added
      in rpm packaging.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      81203257
  7. 23 3月, 2012 1 次提交