1. 13 5月, 2011 15 次提交
    • C
      test: Use virDomainEventState helpers · 4d7297f8
      Cole Robinson 提交于
      v3:
          Adjust for new virDomainEventStateNew argument
      4d7297f8
    • C
      lxc: Use virDomainEventState helpers · 1ded8942
      Cole Robinson 提交于
      v3:
          Adjust for new virDomainEventStateNew argument
      1ded8942
    • C
      qemu: Use virDomainEventState helpers · 42a3687f
      Cole Robinson 提交于
      v2:
          Drop libvirt_private.syms changes
      
      v3:
          Adjust for new virDomainEventStateNew argument
      42a3687f
    • C
      domain_event: Add common domain event queue/flush helpers · 227d67ca
      Cole Robinson 提交于
      The same code for queueing, flushing, and deregistering events exists
      in multiple drivers, which will soon use these common functions.
      
      v2:
          Adjust libvirt_private.syms
          isDispatching bool fixes
          NONNULL tagging
      
      v3:
          Add requireTimer parameter to virDomainEventStateNew
      227d67ca
    • C
      domain_event: Add virDomainEventState structure · aaf2b70b
      Cole Robinson 提交于
      This structure will be used to unify lots of duplicated event handling code
      across the state drivers.
      
      v2:
          Check for state == NULL in StateFree
          Add NONNULL tagging
          Use bool for isDispatching
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      aaf2b70b
    • C
      xml: Use virXMLParse* helpers everywhere · b9e51e56
      Cole Robinson 提交于
      virt-aa-helper isn't even compile tested since I don't have the setup for
      it.
      
      v2:
          virt-aa-helper fixes from Eric
      b9e51e56
    • C
      domain: Require <init> for container guests · 34639a3f
      Cole Robinson 提交于
      Use capabilities to allow a driver to register a default <init> if none
      is specified in the XML. Openvz was already open-coding this to be /sbin/init
      
      LXC currently falls over if no init is specified, so an explicit error is
      an improvement IMO.
      
      (Side note: I don't think we can set a default value for LXC. If we use
      /sbin/init but the user doesn't specify a separate root FS for their guest,
      the container will rerun the host's init which can be traumatic :). For
      virt-install I'm thinking of defaulting to /sbin/init if a root FS has
      been specified, otherwise require the user to manually specify <init>)
      34639a3f
    • C
      xml: Make sure virXpathNodeSet always sets an error · 0571c3af
      Cole Robinson 提交于
      And update callers to actually respect the error
      0571c3af
    • M
      vbox: Implement the driver methods · 11d54887
      Michal Privoznik 提交于
      * src/vbox/vbox_tmpl.c: New vboxDomainScreenshot() function
      11d54887
    • M
      qemu: Implement the driver methods · 9936aecf
      Michal Privoznik 提交于
      * src/qemu/qemu_driver.c: new qemuDomainScreenshot() function
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Monitor command
      9936aecf
    • M
      virFDStream: Add option for delete file after it's opening · 6a1f5f56
      Michal Privoznik 提交于
      This is needed if we want to transfer a temporary file. If the
      transfer is done with iohelper, we might run into a race condition,
      where we unlink() file before iohelper is executed.
      
      * src/fdstream.c, src/fdstream.h,
        src/util/iohelper.c: Add new option
      * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
        src/storage/storage_driver.c, src/uml/uml_driver.c,
        src/xen/xen_driver.c: Expand existing function calls
      6a1f5f56
    • M
      screenshot: Implementing the remote protocol · 2c6efac9
      Michal Privoznik 提交于
      * src/remote/remote_protocol.x: Wire protocol definition
      * daemon/remote.c: Daemon part
      * src/remote/remote_driver.c: Client part
      * src/remote_protocol-structs: Add structures
      2c6efac9
    • M
      screenshot: Implementing the public API · 1f9f1214
      Michal Privoznik 提交于
      * src/libvirt.c: new function virDomainScreenshot
      1f9f1214
    • M
      screenshot: Defining the internal API · 3c386643
      Michal Privoznik 提交于
      * src/driver.h: Stub code for new API
      * src/esx/esx_driver.c, src/libxl/libxl_driver.c,
        src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
        src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
        rc/remote/remote_driver.c, rc/test/test_driver.c,
        src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/vmware/vmware_driver.c, src/xen/xen_driver.c,
        src/xen/xen_driver.h, src/xen/xen_hypervisor.c,
        src/xen/xen_inotify.c, src/xen/xend_internal.c,
        src/xen/xm_internal.c, src/xen/xs_internal.c,
        src/xenapi/xenapi_driver.c: Add dummy entries in driver
        table for new APIs
      3c386643
    • M
      screenshot: Defining the public API · 6a1fcd9f
      Michal Privoznik 提交于
      Add public API for taking screenshots of current domain console.
      
      * include/libvirt/libvirt.h.in: add virDomainScreenshot
      * src/libvirt_public.syms: Export new symbol
      6a1fcd9f
  2. 12 5月, 2011 13 次提交
    • W
      build: avoid compiler warning during configure · 1ba6e2d9
      Wen Congyang 提交于
      There is no need to redefine _GNU_SOURCE in tests that occur after
      gl_INIT, since that macro already AC_DEFINE'd it for us.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1ba6e2d9
    • O
      docs: Fix documentation for cputune parameters · 81cfe719
      Osier Yang 提交于
      This re-adds the example section originally written by Osier Yang,
      and indicates the version in which the cputune parameters became
      available in libvirt.
      Signed-off-by: NIgor Serebryany <igor47@moomers.org>
      81cfe719
    • M
      remote generator: Add skipgen/autogen flags to .x files · 2a5251e2
      Matthias Bolte 提交于
      Make procedure parsing more robust, by allowing arbitrary
      amounts of whitespaces.
      
      Also make some error messages more verbose.
      2a5251e2
    • E
      nwfilter: drop unused flag argument · 88d03d4f
      Eric Blake 提交于
      The public API and RPC over-the-wire format have no flags argument,
      so neither should the internal callback API.  This simplifies the
      RPC generator.
      
      * src/driver.h (virDrvNWFilterDefineXML): Drop argument that does
      not match public API.
      * src/nwfilter/nwfilter_driver.c (nwfilterDefine): Likewise.
      * src/libvirt.c (virNWFilterDefineXML): Likewise.
      * daemon/remote_generator.pl: Drop special case.
      88d03d4f
    • E
      maint: omit translation for all VIR_INFO · cb84580a
      Eric Blake 提交于
      We were 31/73 on whether to translate; since less than 50% translated
      and since VIR_INFO is less than VIR_WARN which also doesn't translate,
      this makes sense.
      
      * cfg.mk (sc_prohibit_gettext_markup): Add VIR_INFO, since it
      falls between WARN and DEBUG.
      * daemon/libvirtd.c (qemudDispatchSignalEvent, remoteCheckAccess)
      (qemudDispatchServer): Adjust offenders.
      * daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
      * src/network/bridge_driver.c (networkReloadIptablesRules)
      (networkStartNetworkDaemon, networkShutdownNetworkDaemon)
      (networkCreate, networkDefine, networkUndefine): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainDefine)
      (qemudDomainUndefine): Likewise.
      * src/storage/storage_driver.c (storagePoolCreate)
      (storagePoolDefine, storagePoolUndefine, storagePoolStart)
      (storagePoolDestroy, storagePoolDelete, storageVolumeCreateXML)
      (storageVolumeCreateXMLFrom, storageVolumeDelete): Likewise.
      * src/util/bridge.c (brProbeVnetHdr): Likewise.
      * po/POTFILES.in: Drop src/util/bridge.c.
      cb84580a
    • E
      build: wrap macro body in one-shot do-while loop · 5c129f74
      Eric Blake 提交于
      * src/libvirt.c (VIR_DOMAIN_DEBUG_1): Convert to single statement.
      Suggested by Jiri Denemark.
      5c129f74
    • E
      build: drop need for VIR_DOMAIN_DEBUG0() · 5bc168ed
      Eric Blake 提交于
      This one's tricker than the VIR_DEBUG0() removal, but the end
      result is still C99 compliant, and reasonable with enough comments.
      
      * src/libvirt.c (VIR_ARG10, VIR_HAS_COMMA)
      (VIR_DOMAIN_DEBUG_EXPAND, VIR_DOMAIN_DEBUG_PASTE): New macros.
      (VIR_DOMAIN_DEBUG): Rewrite to handle one argument, moving
      multi-argument guts to...
      (VIR_DOMAIN_DEBUG_1): New macro.
      (VIR_DOMAIN_DEBUG0): Rename to VIR_DOMAIN_DEBUG_0.
      5bc168ed
    • C
      fix xdr detection and use with recent glibc · 29d753c8
      Christophe Fergeau 提交于
      glibc 2.13.90 has obsoleted its rpc implementation in favour of
      the one provided by the TI-RPC library:
      
      > * The RPC implementation in libc is obsoleted.  Old programs keep working
      >   but new programs cannot be linked with the routines in libc anymore.
      >   Programs in need of RPC functionality must be linked against TI-RPC.
      >   The TI-RPC implemtation is IPv6 enabled and there are other benefits.
      >
      >   Visible changes of this change include (obviously) the inability to
      >   link
      >   programs using RPC functions without referencing the TI-RPC library,
      >   the
      >   removal of the RPC headers from the glibc headers, and the lack of
      >   symbols defined in <rpc/netdb.h> when <netdb.h> is installed.
      >   Implemented by Ulrich Drepper.
      (from glibc NEWS)
      
      Thus with recent glibc, we need to try linking with -ltirpc when looking
      for the XDR functions. The daemon also needs to use XDR_CFLAGS to be able
      to find the XDR headers stored in /usr/include/tirpc.
      
      When using TI-RPC, there are some warnings about redundant declarations, but
      the fix probably belongs in other modules:
      
      /usr/include/tirpc/rpc/rpcent.h:68:13: warning: redundant redeclaration of
      'setrpcent' [-Wredundant-decls]
      /usr/include/rpc/netdb.h:53:13: note: previous declaration of 'setrpcent'
      was here
      
      /usr/include/tirpc/rpc/rpcent.h:69:13: warning: redundant redeclaration of
      'endrpcent' [-Wredundant-decls]
      /usr/include/rpc/netdb.h:54:13: note: previous declaration of 'endrpcent'
      was here
      
      /usr/include/tirpc/rpc/rpc.h:84:12: warning: redundant redeclaration of
      'bindresvport' [-Wredundant-decls]
      /usr/include/netinet/in.h:440:12: note: previous declaration of
      'bindresvport' was here
      29d753c8
    • E
      build: avoid gcc preprocessor extensions · bc6bfeaa
      Eric Blake 提交于
      Use of ',##__VA_ARGS__' is a gcc extension not guaranteed by
      C99; thankfully, we can avoid it by lumping the format argument
      into the var-args set.
      
      * src/util/logging.h (VIR_DEBUG_INT, VIR_INFO_INT, VIR_WARN_INT)
      (VIR_ERROR_INT, VIR_DEBUG, VIR_INFO, VIR_WARN, VIR_ERROR): Stick
      to C99 var-arg macro syntax.
      * examples/domain-events/events-c/event-test.c (VIR_DEBUG):
      Simplify.
      bc6bfeaa
    • L
      libvirt,logging: cleanup VIR_XXX0() · b65f37a4
      Lai Jiangshan 提交于
      These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead.
      
      How do these coversions works? The magic is using the gcc extension of ##.
      When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to
      avoid compile error.
      
      example: origin				after CPP
      	high_level_api("%d", a_int)	low_level_api("%d", a_int)
      	high_level_api("a  string")	low_level_api("a  string")
      
      About 400 conversions.
      
      8 special conversions:
      VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions
      VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions
      VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal)
        (for security) 6 conversions
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      b65f37a4
    • E
      maint: avoid a couple of gnulib regressions · 0e5a7ace
      Eric Blake 提交于
      Double-close regression in upstream gnulib fclose was introduced
      to libvirt in commit 9d8e01a1.
      
      Meanwhile, adding rpcgen as a bootstrap prerequisite in commit
      fb1e8d9c prevented RHEL 5 from running bootstrap.
      
      * .gnulib: Update to latest, for fclose and bootstrap fixes.
      * bootstrap: Synchronize from upstream.
      0e5a7ace
    • E
      node_device: avoid null dereference on error · 98cd17bd
      Eric Blake 提交于
      If we plow on after udev_device_get_syspath fails, we will hit a NULL
      dereference.  Clang found one due to strdup later in udevSetParent,
      but in fact we hit a NULL dereference sooner because of the use of
      STREQ within virNodeDeviceFindBySysfsPath.
      
      * src/conf/node_device_conf.h (virNodeDeviceFindBySysfsPath): Mark
      path argument non-null.
      * src/node_device/node_device_udev.c (udevSetParent): Avoid null
      dereference.
      98cd17bd
    • E
      build: remove some dead assignments · 4c6ae9ae
      Eric Blake 提交于
      No syntactic effect; this merely silences some clang warnings.
      
      * src/libxl/libxl_driver.c (libxlDomainSetVcpusFlags): Drop
      redundant ret=0 statement.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextDriveDel):
      Likewise.
      4c6ae9ae
  3. 11 5月, 2011 12 次提交
    • E
      tests: avoid crash when run under gcov · 70ea7dec
      Eric Blake 提交于
      Running ./autobuild.sh failed when gcov is installed, because
      commandtest ended up crashing during gcov's getenv() call after
      exit() had already started.  I traced this nasty bug back to
      a scoping issue present since the test introduction.
      
      * tests/commandtest.c (mymain): Move newenv...
      (newenv): ...to a scope that is still useful during exit().
      70ea7dec
    • E
      build: fix VPATH build with distributed generated files · ba13a37c
      Eric Blake 提交于
      * daemon/Makefile.am (DAEMON_GENERATED, remote_dispatch_*.h)
      (qemu_dispatch_*.h): Update to live in srcdir, since they are
      distributed.
      Detected by Daniel P. Berrange's autobuilder.
      ba13a37c
    • E
      docs: avoid double 'the' · 2c287175
      Eric Blake 提交于
      * docs/testsuites.html.in: Keep 'make syntax-check' happy.
      2c287175
    • D
      Add documentation about test suites · ef82932b
      Daniel Veillard 提交于
      Create a new top level entry, add a new page listing the 3
      test suites, and then one page for the TCK and one page for
      libvirt-test-API
      ef82932b
    • D
      Allow destroying QEMU VM even if a job is active · cbf9f2f2
      Daniel P. Berrange 提交于
      Introduce a virProcessKill function that can be safely called
      even when the job mutex is held. This allows virDomainDestroy
      to kill any VM even if it is asleep in a monitor job. The PID
      will die and the thread asleep on the monitor will then wake
      up releasing the job mutex.
      
      * src/qemu/qemu_driver.c: Kill process before using qemuProcessStop
        to ensure job is released
      * src/qemu/qemu_process.c: Add virProcessKill for killing off
        QEMU processes
      cbf9f2f2
    • D
      Add support for YAJL version 2 API/ABI · 9f5d3a91
      Daniel P. Berrange 提交于
      Version 2.0.0 or yajl changed API. It is fairly trivial for us to
      cope with both APIs in libvirt, so adapt.
      
      * configure.ac: Probe for yajl2 API
      * src/util/json.c: Conditional support for yajl2 API
      9f5d3a91
    • P
      libxl: support enabling the HPET · 761a742a
      Paolo Bonzini 提交于
      libxl accepts hpet configuration in its domain info struct.  Parse the
      domain definition's <clock> element in order to set the value.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      
      Apologies from Eric Blake, for mistakenly committing the broken
      intermediate version.
      761a742a
    • P
      libxl: support enabling the HPET · 0fd3fac5
      Paolo Bonzini 提交于
      libxl accepts hpet configuration in its domain info struct.  Parse the
      domain definition's <clock> element in order to set the value.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0fd3fac5
    • P
      xen: parse and generate hpet item in sxpr · e547e44c
      Paolo Bonzini 提交于
      Recent versions of Xen disable the virtual HPET by default.  This is
      usually more precise because tick policies are not implemented for
      the HPET in Xen.  However, there may be several reasons to control
      the HPET manually: 1) to test the emulation; 2) because distros may
      provide the knob while leaving the default to "enabled" for compatibility
      reasons.
      
      This patch provides support for the hpet item in both sexpr and xm
      formats, and translates it to a <timer> element.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e547e44c
    • D
      docs: updates to CA cert and client cert/key info · fa473272
      Doug Goldstein 提交于
      Update the documentation to mention that the CA certificate and the
      client cert/key pair can come from the user's location or the global
      location independent of each other.
      Signed-off-by: NDoug Goldstein <cardoe@gentoo.org>
      fa473272
    • D
      virsh: flexibility in CA cert and user cert/key · 343c69db
      Doug Goldstein 提交于
      Allow the CA certificate to come from the user's home directory or from
      the global location independently of the client certificate/key pair.
      
      Mostly for the case when each user on a system has their own cert/key
      pair but the system as a whole shares the same CA.
      Signed-off-by: NDoug Goldstein <cardoe@gentoo.org>
      343c69db
    • M
      remote generator: Make parsing stricter · 8c6df913
      Matthias Bolte 提交于
      Anchor matches at the beginning of a line.
      
      Specialize some general matches.
      
      Add some comments to special cases.
      8c6df913