1. 26 2月, 2013 7 次提交
    • 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 14 次提交
    • 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
    • S
      storage: use f_frsize, not f_bsize, for calculating available space · c2092abf
      Sage Weil 提交于
      The bfree and blocks fields are supposed to be in units of frsize.  We were
      calculating capacity correctly using those units, but the available
      calculation was using bsize instead.  Most file systems report these as the
      same value specifically because many programs are buggy, but that is no
      reason to rely on that behavior, or to behave inconsistently.
      
      This bug has been present since e266ded2 (2008) and aa296e6c, when the code
      was originally introduced (the latter via cut and paste).
      Signed-off-by: NSage Weil <sage@newdream.net>
      c2092abf
    • E
      maint: check all symfiles for sorting · 91ffb42c
      Eric Blake 提交于
      On FreeBSD, I got a 'make check' failure:
        GEN    check-symsorting
      Symbol block at ./libvirt_atomic.syms:4: viratomic.h not found
      
      * src/Makefile.am (SYM_FILES): New define.
      (check-symsorting): Check on all symfiles, even when not used.
      * src/libvirt_atomic.syms: Fix offender.
      91ffb42c
    • J
      qemu: Implement virDomainMigrate*CompressionCache · 492afb82
      Jiri Denemark 提交于
      492afb82