1. 26 2月, 2013 10 次提交
    • J
      libvirt: fix error message when connection can't be opened · 633d859b
      Ján Tomko 提交于
      VIR_ERR_NO_CONNECT already contains "no connection driver available".
      
      This patch changes:
      no connection driver available for No connection for URI hello
      to:
      no connection driver available for hello
      
      Bug: https://bugzilla.redhat.com/show_bug.cgi?id=851413
      633d859b
    • P
      qemu: do not set unpriv_sgio if neither supported nor requested · 45dc3f17
      Paolo Bonzini 提交于
      Currently we call virSetDeviceUnprivSGIO with val == 0 if a block device
      has an sgio attribute.  But for sgio='filtered', we know that a
      kernel with no unpriv_sgio support will always behave as the user
      wanted.  In this case, there is no need to call the function and
      report a (bogus) error.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      45dc3f17
    • E
      tests: uniformly report test failures · dce95297
      Eric Blake 提交于
      testutils.c likes to print summaries after a test completes,
      including if it failed.  But if the test outright exit()s,
      this summary is skipped.  Enforce that we return instead of exit.
      
      * cfg.mk (sc_prohibit_exit_in_tests): New syntax check.
      * tests/commandhelper.c (main): Fix offenders.
      * tests/qemumonitorjsontest.c (mymain): Likewise.
      * tests/seclabeltest.c (main): Likewise.
      * tests/securityselinuxlabeltest.c (mymain): Likewise.
      * tests/securityselinuxtest.c (mymain): Likewise.
      * tests/testutils.h (VIRT_TEST_MAIN_PRELOAD): Likewise.
      * tests/testutils.c (virtTestMain): Likewise.
      (virtTestCaptureProgramOutput): Use symbolic name.
      dce95297
    • E
      tests: don't test json when not compiled in · f20b0476
      Eric Blake 提交于
      Now that the segfault is solved, we can skip instead of fail
      the test when yajl is not present.
      
      * tests/qemumonitorjsontest.c (mymain): Skip if no yajl.
      f20b0476
    • E
      tests: avoid segfault if json monitor not present · 848a3b1d
      Eric Blake 提交于
      On a machine without yajl headers, I was seeing random segfaults
      from qemumonitorjsontest (about 90% of the runs on my particular
      machine).  The segfault was inside virClassIsDerivedFrom, which
      points to a case of a race leading to unreferencing a stale
      pointer to an object that had already been freed.  I also noticed
      that if I got the segfault, I was seeing messages such as:
      
      2013-02-22 16:12:37.504+0000: 19833: error : virNetSocketWriteWire:1361 : Cannot write data: Bad file descriptor
      
      which is also evidence of deferencing a stale pointer.  I traced it
      to a race where qemuMonitorTestIO could execute late, after the
      main thread had already called qemuMonitorTestFree and called
      virNetSocketClose(test->client) but not clearing it out to NULL.
      Sure enough, after test->client has been closed, fd is -1, which
      causes an attempt to write to the socket to fail, which in turn
      triggers the error code of qemuMonitorTestIO that tries to re-close
      test->client.
      
      * tests/qemumonitortestutils.c (qemuMonitorTestIO): Don't attempt
      to free client again if test already quit.
      848a3b1d
    • E
      qemu: minor monitor lock cleanups · 6abd5ea1
      Eric Blake 提交于
      If virCondInit fails (okay, so that's unlikely), then we end up
      attempting a virObjectUnlock() on the cleanup path, even though
      we don't hold a lock.  This is not guaranteed to be safe.  While
      at it, I noticed a couple places where we were referencing mon->fd
      outside locks.
      
      * src/qemu/qemu_monitor.c (qemuMonitorOpenInternal): Minimize lock
      duration.  mon->watch doesn't need clean up on error.
      (qemuMonitorGetBlockExtent, qemuMonitorBlockResize): Don't
      dereference fd outside of lock.
      6abd5ea1
    • E
      qemu: don't override earlier json error · 29424d1a
      Eric Blake 提交于
      I built without yajl support, and noticed a strange failure message
      in qemumonitorjsontest:
      
      2013-02-22 16:12:37.503+0000: 19812: error : virJSONValueToString:1119 : internal error No JSON parser implementation is available
      2013-02-22 16:12:37.503+0000: 19812: error : qemuMonitorJSONCommandWithFd:253 : out of memory
      
      While a later patch will fix the test to skip when json is not present,
      this patch avoids overriding the more useful error message from
      virJSONValueToString returning NULL.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCommandWithFd):
      Don't override message.
      (qemuMonitorJSONCheckError): Don't print NULL.
      * src/qemu/qemu_agent.c (qemuAgentCommand): Don't override message.
      (qemuAgentCheckError): Don't print NULL.
      (qemuAgentArbitraryCommand): Properly fail on OOM.
      29424d1a
    • P
      conf: Avoid leaking of RNG device definition · 34f1a618
      Peter Krempa 提交于
      34f1a618
    • P
      qemu: Refactor qemuDomainSetMemoryParameters · 19c6ad9a
      Peter Krempa 提交于
      The new TypedParam helper APIs allow to simplify this function
      significantly.
      
      This patch integrates the fix in 75e5bec9
      by correctly ordering the setting functions instead of reordering the
      parameters.
      19c6ad9a
    • D
      interface: Fix udev backend bridge device display · 65bb1b97
      Doug Goldstein 提交于
      The bridge device was showing the vnet devices created for the domains
      as connected to the bridge. libvirt should only show host devices when
      trying to get the interface definition rather than the domain devices as
      well.
      65bb1b97
  2. 25 2月, 2013 18 次提交
  3. 24 2月, 2013 1 次提交
    • E
      run: license as LGPL · 448c93cf
      Eric Blake 提交于
      It makes no sense to prohibit reuse of the wrapper in other LGPL
      projects, since most of libvirt is designed to be LGPL.  Of
      course, when using the wrapper to wrap a GPL program, the combined
      result is still effectively GPL, but that shouldn't force us to
      license the wrapper as GPL in isolation.
      
      * run.in: Relicense to LGPLv2+.
      448c93cf
  4. 23 2月, 2013 11 次提交
    • M
      qemu_migration: Cancel running jobs on failed migration · 1e54685f
      Michal Privoznik 提交于
      If a migration fails, we need to stop all block jobs running so
      qemu doesn't try to send data to destination over and over again.
      1e54685f
    • M
      qemu_migration: Stop NBD server at Finish phase · ae21b9bd
      Michal Privoznik 提交于
      At the end of migration, it is important to stop NBD
      server and thus release all allocated resources.
      ae21b9bd
    • M
      qemu_migration: Introduce qemuMigrationDriveMirror · 7b7600b3
      Michal Privoznik 提交于
      This function does the source part of NBD magic. It
      invokes drive-mirror on each non shared and RW disk with
      a source and wait till the mirroring process completes.
      When it does we can proceed with migration.
      
      Currently, an active waiting is done: every 500ms libvirt
      asks qemu if block-job is finished or not.  However, once
      the job finishes, qemu doesn't report its progress so we
      can only assume if the job finished successfully or not.
      The better solution would be to listen to the event which
      is sent as soon as the job finishes. The event does
      contain the result of job.
      7b7600b3
    • M
      qemu_migration: Introduce qemuMigrationStartNBDServer() · 86d90b3a
      Michal Privoznik 提交于
      We need to start NBD server and feed it with all non-<shared/>,
      RW and source-full disks. Moreover, with new virPortAllocator we
      must ensure the borrowed port for NBD server will be returned if
      either migration completes or qemu process is torn down.
      86d90b3a
    • M
      qemu: Introduce nbd-server-stop command · f1748e34
      Michal Privoznik 提交于
      This will be used after all migration work is done
      to stop NBD server running on destination.  It
      doesn't take any arguments, just issues a command.
      f1748e34
    • M
      qemu: Introduce nbd-server-add command · c833d811
      Michal Privoznik 提交于
      This will be used with new migration scheme.
      This patch creates basically just monitor stub
      functions. Wiring them into something useful
      is done in later patches.
      c833d811
    • M
      qemu: Introduce nbd-server-start command · bb6359e8
      Michal Privoznik 提交于
      This will be used with new migration scheme.
      This patch creates basically just monitor stub
      functions. Wiring them into something useful
      is done in later patches.
      bb6359e8
    • M
      Introduce NBD migration cookie · 121d4cfb
      Michal Privoznik 提交于
      This migration cookie is meant for two purposes. The first is to be sent
      in begin phase from source to destination to let it know we support new
      implementation of VIR_MIGRATE_NON_SHARED_{DISK,INC} so destination can
      start NBD server. Then, the second purpose is, destination can let us
      know, on which port the NBD server is running.
      121d4cfb
    • M
      qemu: Introduce NBD_SERVER capability · e9a6704f
      Michal Privoznik 提交于
      This just keeps track whether qemu knows nbd-server-* commands
      so we can use it during migration or not.
      e9a6704f
    • P
      Add support for <option> tag in network config · 383ebc46
      Pieter Hollants 提交于
      This patch adds support for a new <option>-Tag in the <dhcp> block of
      network configs, based on a subset of the fifth proposal by Laine
      Stump in the mailing list discussion at
      https://www.redhat.com/archives/libvir-list/2012-November/msg01054.html.
      Any such defined option will result in a dhcp-option=<number>,"<value>"
      statement in the generated dnsmasq configuration file.
      
      Currently, DHCP options can be specified by number only and there is
      no whitelisting or blacklisting of option numbers, which should
      probably be added.
      Signed-off-by: NPieter Hollants <pieter@hollants.com>
      Signed-off-by: NLaine Stump <laine@laine.org>
      383ebc46
    • E
      run: use portable shell · 2795813c
      Eric Blake 提交于
      Nothing in run required bash, except for the shebang.  On systems
      where /bin/bash doesn't exist (I hit it on FreeBSD), using /bin/sh
      instead fixes a 'make check' failure:
      gmake[3]: Entering directory `/usr/home/dummy/libvirt/python'
        GEN    check-local
      /usr/local/bin/bash: ../run: /bin/bash: bad interpreter: No such file or directory
      
      * run.in: Use /bin/sh, not bash.
      2795813c