1. 17 8月, 2011 5 次提交
    • D
      Ensure stream is aborted when exiting console · 3cf37700
      Daniel P. Berrange 提交于
      After running 'virsh console' in interactive mode, there was a
      missing call to virStreamAbort, which meant the server kept the
      stream resources open
      
      * tools/console.c: Abort stream when exiting
      3cf37700
    • S
      maint: fix some compilation issues on non-linux platforms (part 2) · 57c7b40b
      Stefan Berger 提交于
      Get rid of the #if __linux__ check in virPidFileReadPathIfAlive that
      was preventing a check of a symbolic link in /proc/<pid>/exe on
      non-linux platforms against an expected executable. Replace
      this with a run-time check testing whether the /proc/<pid>/exe is a
      symbolic link and if so call the function doing the comparison
      against the expected file the link is supposed to point to.
      57c7b40b
    • S
      maint: fix some compilation issues on non-linux platforms · f4765b69
      Stefan Berger 提交于
      This patch fixes *some* compilation issues on non-Linux platforms (cygwin).
      f4765b69
    • P
      daemon: Add early libvirtd start verbose errors. · 6452b1eb
      Peter Krempa 提交于
      Early errors during start of libvirtd didn't have
      an error reporting mechanism and caused libvirtd
      to exit silently (only the return value indicated
      an error).
      
      Libvirt logging is initialized very early using
      enviroment variables and the internal error reporting
      API is used to report early errors.
      
       v2 changes:
       - print errors unconditionaly before logging starts
       - fix message to US spelling
       v2.5 changes:
       - initialize logging from enviroment
       - log all early errors using VIR_ERROR
       v3 changes:
       - move virSetLogFromEnv() after virInitialize()
      
      fixes: https://bugzilla.redhat.com/show_bug.cgi?id=728654
      6452b1eb
    • S
      maint: add missing symbols · 34a01fc4
      Stefan Berger 提交于
      Add missing symbols to libvirt_private.syms.
      34a01fc4
  2. 16 8月, 2011 5 次提交
  3. 15 8月, 2011 10 次提交
    • L
      qemu: support event_idx parameter for virtio disk and net devices · 73c0a148
      Laine Stump 提交于
      In some versions of qemu, both virtio-blk-pci and virtio-net-pci
      devices can have an event_idx setting that determines some details of
      event processing. When it is enabled, it "reduces the number of
      interrupts and exits for the guest". qemu will automatically enable
      this feature when it is available, but there may be cases where this
      new feature could actually make performance worse (NB: no such case
      has been found so far).
      
      As a safety switch in case such a situation is encountered in the
      field, this patch adds a new attribute "event_idx" to the <driver>
      element of both disk and interface devices. event_idx can be set to
      "on" (to force event_idx on in case qemu has it disabled by default)
      or "off" (for force event_idx off). In the case that event_idx support
      isn't present in qemu, the attribute is ignored (this on the advice of
      the qemu developer).
      
      docs/formatdomain.html.in: document the new flag (marking it as
         "don't mess with this!"
      docs/schemas/domain.rng: add event_idx in appropriate places
      src/conf/domain_conf.[ch]: add event_idx to parser and formatter
      src/libvirt_private.syms: export
         virDomainVirtioEventIdx(From|To)String
      src/qemu/qemu_capabilities.[ch]: detect and report event_idx in
         disk/net
      src/qemu/qemu_command.c: add event_idx parameter to qemu commandline
          when appropriate.
      tests/qemuxml2argvdata/qemuxml2argv-event_idx.args,
      tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml,
      tests/qemuxml2argvtest.c,
      tests/qemuxml2xmltest.c: test cases for event_idx.
      73c0a148
    • P
      qemu: error message should show uri instead of (null) · d17101e0
      Peter Krempa 提交于
      Fix pointer for error message uri if domain migration fails.
      
      BZ# 730244
      d17101e0
    • J
      qemu: Use fd: protocol for migration · 32617617
      Jiri Denemark 提交于
      By opening a connection to remote qemu process ourselves and passing the
      socket to qemu we get much better errors than just "migration failed"
      when the connection is opened by qemu.
      32617617
    • J
      qemu: Use virNetSocket for tunneled migration · e8989ae4
      Jiri Denemark 提交于
      e8989ae4
    • J
      qemu: Refactor do{Tunnel,Native}Migrate functions · 52e2918a
      Jiri Denemark 提交于
      The core of these two functions is very similar and most of it is even
      exactly the same. Factor out the core functionality into a separate
      function to remove code duplication and make further changes easier.
      52e2918a
    • J
      Support changing UNIX socket owner in virNetSocketNewListenUNIX · 5d30db09
      Jiri Denemark 提交于
      This patch allows owner's UID to be changed as well.
      5d30db09
    • J
      Add backlog parameter to virNetSocketListen · 70e4295b
      Jiri Denemark 提交于
      So that callers can change the default value.
      70e4295b
    • D
      Add API for duplicating a socket/client file descriptor · f4287c76
      Daniel P. Berrange 提交于
      * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add
        virNetSocketDupFD()
      * src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add
        virNetClientDupFD() and virNetClientGetFD()
      f4287c76
    • D
      libvirtd.init.in: stop/restart() - wrong return value in case of failure · 841a403f
      Douglas Schilling Landgraf 提交于
      The function stop() was always returning 0 (OK) from killproc() even
      in case of error.
      841a403f
    • O
      daemon: Fix regression of libvirtd reloading support · 9e093f0b
      Osier Yang 提交于
      This is introduced by commit df0b57a9, which forgot to
      add signal handler for SIGHUP.
      
      A simple reproduce method:
      
      1) Create a domain XML under /etc/libvirt/qemu
      2) % kill -SIGHUP $(pidof libvirtd)
      3) % virsh list --all (the new created domain XML is not listed)
      9e093f0b
  4. 13 8月, 2011 10 次提交
    • E
      maint: let emacs avoid tabs in rng files · 2a48b59d
      Eric Blake 提交于
      * .dir-locals.el: Add nxml-mode preferences.
      2a48b59d
    • P
      Swap virDomain / virFomainSnapshot declaration · 24d3738f
      Philipp Hahn 提交于
      In preparation for storing the domain description with the snapshot,
      swap the order of declaration.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      24d3738f
    • E
      build: fix recent build failures · be427e8b
      Eric Blake 提交于
      With gcc 4.5.1:
      
      util/virpidfile.c: In function 'virPidFileAcquirePath':
      util/virpidfile.c:308:66: error: nested extern declaration of '_gl_verify_function2' [-Wnested-externs]
      
      Then in tests/commandtest.c, the new virPidFile APIs need to be used.
      
      * src/util/virpidfile.c (virPidFileAcquirePath): Move verify to
      top level.
      * tests/commandtest.c: Use new pid APIs.
      be427e8b
    • D
      Convert libvirtd to use crash-safe pidfile APIs · c8a3a265
      Daniel P. Berrange 提交于
      Remove the current libvirtd pidfile handling code, in favour of
      calling out to the new APIs. This ensures libvirtd's pidfile
      handling is crashsafe
      
      This also means that the non-root libvirtd instances (for handling
      qemu:///session URIs) can now safely use pidfiles without racing
      
      * daemon/libvirtd.c: Switch to use virPidFileAcquire and
        virPidFileRelease
      c8a3a265
    • D
      Add some APIs which use locking for crashsafe pidfile handling · e1da464d
      Daniel P. Berrange 提交于
      In daemons using pidfiles to protect against concurrent
      execution there is a possibility that a crash may leave a stale
      pidfile on disk, which then prevents later restart of the daemon.
      
      To avoid this problem, introduce a pair of APIs which make
      use of virFileLock to ensure crash-safe & race condition-safe
      pidfile acquisition & releae
      
      * src/libvirt_private.syms, src/util/virpidfile.c,
        src/util/virpidfile.h: Add virPidFileAcquire and virPidFileRelease
      e1da464d
    • D
      Introduce functions for checking whether a pidfile is valid · b7e5ca48
      Daniel P. Berrange 提交于
      In some cases the caller of virPidFileRead might like extra checks
      to determine whether the pid just read is really the one they are
      expecting. This adds virPidFileReadIfAlive which will check whether
      the pid is still alive with kill(0, -1), and (on linux only) will
      look at /proc/$PID/path
      
      * libvirt_private.syms, util/virpidfile.c, util/virpidfile.h: Add
        virPidFileReadIfValid and virPidFileReadPathIfValid
      * network/bridge_driver.c: Use new APIs to check PID validity
      b7e5ca48
    • D
      Move pidfile functions into util/virpidfile.{c,h} · f80a4ed7
      Daniel P. Berrange 提交于
      The functions for manipulating pidfiles are in util/util.{c,h}.
      We will shortly be adding some further pidfile related functions.
      To avoid further growing util.c, this moves the pidfile related
      functions into a dedicated virpidfile.{c,h}. The functions are
      also all renamed to have 'virPidFile' as their name prefix
      
      * util/util.h, util/util.c: Remove all pidfile code
      * util/virpidfile.c, util/virpidfile.h: Add new APIs for pidfile
        handling.
      * lxc/lxc_controller.c, lxc/lxc_driver.c, network/bridge_driver.c,
        qemu/qemu_process.c: Add virpidfile.h include and adapt for API
        renames
      f80a4ed7
    • D
      Add virFileLock and virFileUnlock APIs · e4842705
      Daniel P. Berrange 提交于
      Add some simple wrappers around the fcntl() discretionary file
      locking capability.
      
      * src/util/util.c, src/util/util.h, src/libvirt_private.syms: Add
        virFileLock and virFileUnlock APIs
      e4842705
    • E
      virsh: fix dead store · e08adab3
      Eric Blake 提交于
      Two copy-and-paste bugs in a row.  :(
      
      * tools/virsh.c (cmdUndefine): Also avoid dead store.
      e08adab3
    • E
      virsh: fix logic bug · 2cc1ad61
      Eric Blake 提交于
      Bug introduced in commit 9a0ec363.
      
      * tools/virsh.c (cmdUndefine): Add missing line.
      2cc1ad61
  5. 12 8月, 2011 10 次提交
    • E
      vbox, xenapi: add virDomainUndefineFlags · cfe35a88
      Eric Blake 提交于
      We forgot to add virDomainUndefineFlags for a couple of hypervisors.
      This wires up trivial versions (since neither hypervisor supports
      managed save yet, they do not need to support any flags).
      
      * src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Update caller.
      (vboxDomainUndefine): Move guts...
      (vboxDomainUndefineFlags): ...to new function.
      * src/xenapi/xenapi_driver.c (xenapiDomainUndefine)
      (xenapiDomainUndefineFlags): Likewise.
      cfe35a88
    • E
      virsh: don't reject undefine on active domain · 9a0ec363
      Eric Blake 提交于
      The public API documents that undefine may be used to transition a
      running persistent domain into a transient one.  Many drivers still
      do not support this usage, but virsh shouldn't be getting in the
      way of those that do support it.
      
      This also drops a redundant conditional; vshCommandOptString
      guaranteed that name was non-NULL.
      
      * tools/virsh.c (cmdUndefine): Allow undefine on active domains;
      the drivers may still reject it, but it is a valid API usage.
      * tests/undefine (error): Fix the test to match.
      9a0ec363
    • P
      Improve tokenizing of linkable terms · ce7244a0
      Philipp Hahn 提交于
      Currently only tabs and blanks are used for tokenizing the description,
      which breaks when a term is at the end of a line or has () appended to
      it.
      1. Use also other white space characters such as new-lines and carriage
         return for splitting.
      2. Remove some common non-word characters from the token before lookup.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      ce7244a0
    • D
      Add some docs about the RPC protocol and APIs · 977ba059
      Daniel P. Berrange 提交于
      * remote.html.in: Remove obsolete notes about internals of the
        RPC protocol
      * internals/rpc.html.in: Extensive docs on RPC protocol/API
      * sitemap.html.in: Add new page
      977ba059
    • P
      Align table cells on top · 447e4c46
      Philipp Hahn 提交于
      When the description of an entry is too long and needs multiple lines,
      all other table cells of the same row are currently vertically aligned
      on center. Without row borders or different background colors for
      alternating rows this is hard to read.
      
      Change the style-sheet to align the table cells of a row on top.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      447e4c46
    • P
      virsh: Add dir type for listing volumes with vol-list · 594f564c
      Peter Krempa 提交于
      Fix of output of detailed volume list. BZ #727088
      594f564c
    • P
      storage: Directory shouldn't be listed as type 'file' · 6c55124f
      Peter Krempa 提交于
      Fix internals of libvirt for new storage volume type.
      Libvirt reported an invalid type of the volume.
      
      BZ #727088
      6c55124f
    • E
      virsh: add snapshot-parent · 98369d31
      Eric Blake 提交于
      Down the road, I want to add virDomainSnapshotGetParent, and use
      the new API rather than xml scraping; but this virsh command can
      be implemented even without the new API.
      
      * tools/virsh.c (cmdSnapshotParent): New command.
      * tools/virsh.pod (snapshot-parent): Document it.
      98369d31
    • E
      qemu: silence clang false positive · 398ce48d
      Eric Blake 提交于
      Our logic throws off analyzer tools:
      
      ptr var = NULL;
      if (flags == 0) flags = live ? _LIVE : _CONFIG;
      if (flags & _LIVE) do stuff
      if (flags & _CONFIG) var = non-null;
      if (flags & _LIVE) do more stuff
      else if (flags & _CONFIG) use var
      
      the tools keep thinking that var can still be NULL in the last
      if clause, adding the hint shuts them up.
      
      * src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Add a
      static analysis hint.
      398ce48d
    • L
      network: eliminate potential memory leak on parse failure · 4a6ffae3
      Laine Stump 提交于
      While the first encountered dns host record is being parsed, it's
      possible for virNetworkDef::hosts to point to memory that has been
      allocated, but virNetworkDef::nhosts to still be 0. If there is a
      failure during that time, virNetworkDef::hosts will be leaked.
      
      Although this isn't currently the case for virNetworkDef::txtrecords,
      it could become that way through future re-factoring, and it hurts
      nothing to restructure the freeing of txtrecord data to match that of
      hosts data.
      4a6ffae3