1. 22 6月, 2009 1 次提交
  2. 19 6月, 2009 1 次提交
    • D
      extend the configuration parser for VMX syntax · 144276aa
      Daniel Veillard 提交于
      * qemud/qemud.c src/conf.c src/conf.h src/qemu_conf.c src/xen_unified.c
        src/xm_internal.c tests/conftest.c tests/xmconfigtest.c: extend
        the configuration parser for VMX syntax, patch by Matthias Bolte
      Daniel
      144276aa
  3. 29 1月, 2009 1 次提交
    • J
      error-reporting calls using VIR_ERR_NO_MEMORY: use virReportOOMError instead · bc18a91f
      Jim Meyering 提交于
      * src/uml_conf.c (VIR_FROM_THIS): Define to VIR_FROM_UML.
      * src/xs_internal.c (VIR_FROM_THIS): Define to VIR_FROM_XEN.
      * src/xml.c (VIR_FROM_THIS): Define to VIR_FROM_XML.
      * src/stats_linux.c (VIR_FROM_THIS): Define to VIR_FROM_STATS_LINUX.
      * src/datatypes.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
      * src/lxc_conf.c (VIR_FROM_THIS): Define to VIR_FROM_LXC.
      * src/libvirt.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
      * src/node_device_conf.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
      * src/openvz_conf.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
      * src/openvz_driver.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
      * src/conf.c (VIR_FROM_THIS): Define to VIR_FROM_CONF.
      Note: this loses config_filename:config_lineno diagnostics,
      but that's ok.
      * src/node_device.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
      * src/sexpr.c (VIR_FROM_THIS): Define to VIR_FROM_SEXPR.
      * po/POTFILES.in: remove src/sexpr.c and src/lxc_conf.c
      bc18a91f
  4. 13 1月, 2009 1 次提交
    • J
      diagnose "libvirtd --config=no-such-file" · 6954d44e
      Jim Meyering 提交于
      * qemud/qemud.c (remoteReadConfigFile): Don't return 0 (success)
      when the config file is unreadable or nonexistent
      Return -1, not 0, upon virConfReadFile failure.
      (main): If remote_config_file is not specified via --config(-f),
      use the default config file only if it exists.  Otherwise,
      use /dev/null.
      * src/conf.c (virConfReadFile): Don't diagnose virFileReadAll
      failure, since it already does that.
      6954d44e
  5. 17 11月, 2008 1 次提交
  6. 05 11月, 2008 1 次提交
  7. 17 9月, 2008 1 次提交
  8. 06 6月, 2008 1 次提交
  9. 30 5月, 2008 1 次提交
  10. 16 5月, 2008 1 次提交
    • J
      start using c-ctype functions · c1ee35af
      Jim Meyering 提交于
      Up to now, we've been avoiding ctype functions like isspace, isdigit,
      etc.  because they are locale-dependent.  Now that we have the c-ctype
      functions, we can start using *them*, to make the code more readable
      with changes like these:
      
      -        /* This may not work on EBCDIC. */
      -        if ((*p >= 'a' && *p <= 'z') ||
      -            (*p >= 'A' && *p <= 'Z') ||
      -            (*p >= '0' && *p <= '9'))
      +        if (c_isalnum(*p))
      
      -    while ((*cur >= '0') && (*cur <= '9')) {
      +    while (c_isdigit(*cur)) {
      
      Also, some macros in conf.c used names that conflicted with
      standard meaning of "BLANK" and "SPACE", so I've adjusted them
      to be in line with the definition of e.g., isblank.
      In addition, I've wrapped those statement macros with do {...} while (0),
      so that we can't forget the ";" after a use.  There was one like that
      already (fixed below).  The missing semicolon would mess up automatic
      indenting.
      * src/buf.c (virBufferURIEncodeString):
      * src/conf.c (IS_EOL, SKIP_BLANKS_AND_EOL, SKIP_BLANKS)
      (virConfParseLong, virConfParseValue, virConfParseName)
      (virConfParseSeparator, virConfParseStatement, IS_BLANK, IS_CHAR)
      (IS_DIGIT, IS_SPACE, SKIP_SPACES):
      * src/nodeinfo.c:
      * src/qemu_conf.c (qemudParseInterfaceXML):
      * src/qemu_driver.c (qemudDomainBlockStats):
      * src/sexpr.c:
      * src/stats_linux.c:
      * src/util.c (virParseNumber, virDiskNameToIndex):
      * src/uuid.c (hextobin, virUUIDParse):
      * src/virsh.c:
      * src/xml.c (parseCpuNumber, virParseCpuSet):
      c1ee35af
  11. 15 5月, 2008 1 次提交
  12. 28 4月, 2008 1 次提交
  13. 11 4月, 2008 2 次提交
  14. 04 4月, 2008 1 次提交
    • D
      typos fixes · a528e973
      Daniel Veillard 提交于
      * docs//* src/conf.c src/hash.c src/libvirt.c src/proxy_internal.c
       src/remote_internal.c src/virsh.c src/xen_internal.c
       src/xend_internal.c src/xml.c: applied patch from Atsushi SAKAI
       fixing a lot of typos
      Daniel
      a528e973
  15. 22 2月, 2008 1 次提交
    • J
      Use safewrite in place of write, in many cases. · b59d9c85
      Jim Meyering 提交于
      Also add "make syntax-check" rules to ensure no new uses sneak in.
      
      There are many uses of write like this:
      
          if (write (fd, xml, towrite) != towrite)
              return -1;
      
      The problem is that the syscall can succeed, yet write less than
      the requested number of bytes, so the caller should retry
      rather than simply failing.
      
      This patch changes most of them to use util.c's safewrite wrapper,
      which encapsulates the process.  Also, there were a few cases in
      which the retry loop was open-coded, and I replaced those, too.
      
      * Makefile.maint (sc_avoid_write): New rule, to avoid recurrence.
      * .x-sc_avoid_write: New file.  Record two legitimate exemptions.
      * qemud/qemud.c (sig_handler, qemudClientWriteBuf): Use safewrite, not write.
      * src/conf.c (__virConfWriteFile): Likewise.
      * src/qemu_conf.c (qemudSaveConfig, qemudSaveNetworkConfig): Likewise.
      * src/qemu_driver.c (qemudWaitForMonitor, qemudStartVMDaemon)
      (qemudVMData, PROC_IP_FORWARD): Likewise.
      * proxy/libvirt_proxy.c: Include "util.h".
      (proxyWriteClientSocket): Use safewrite.
      * src/test.c (testDomainSave, testDomainCoreDump): Likewise.
      * src/proxy_internal.c (virProxyWriteClientSocket): Likewise.
      * src/virsh.c: Include "util-lib.h".
      (vshOutputLogFile): Use safewrite.
      * src/console.c: Include "util-lib.h".
      (vshRunConsole): Use safewrite.
      b59d9c85
  16. 06 2月, 2008 1 次提交
  17. 05 2月, 2008 2 次提交
    • J
      Eliminate all uses of virBufferAdd with string literals. · fb66d5ab
      Jim Meyering 提交于
      * Makefile.maint (sc_prohibit_virBufferAdd_with_string_literal):
      New rule.
      * src/buf.h (virBufferAddLit): Define.
      * src/conf.c (virConfSaveValue): Use virBufferAddLit, in place
      of virBufferAdd everywhere possible.
      (virConfSaveEntry): Likewise.
      * src/qemu_conf.c (qemudGenerateXML, qemudGenerateNetworkXML): Likewise.
      * src/qemu_driver.c (qemudGetFeatures, qemudGetCapabilities): Likewise.
      * src/test.c (testDomainDumpXML, testNetworkDumpXML): Likewise.
      * src/xen_internal.c (xenHypervisorMakeCapabilitiesXML): Likewise.
      * src/xend_internal.c (xend_parse_sexp_desc_os): Likewise.
      (xend_parse_sexp_desc, sexpr_to_xend_topology_xml): Likewise.
      * src/xm_internal.c (xenXMDomainFormatXML, xenXMDomainPinVcpu): Likewise.
      * src/xml.c (virSaveCpuSet, virParseXenCpuTopology): Likewise.
      (virDomainParseXMLGraphicsDescImage): Likewise.
      (virDomainParseXMLGraphicsDescVFB, virDomainParseXMLOSDescHVM): Likewise.
      (virDomainParseXMLOSDescPV, virDomainParseXMLDiskDesc): Likewise.
      (virDomainParseXMLIfDesc, virDomainParseXMLDesc): Likewise.
      fb66d5ab
    • J
      Enable more checks for unmarked messages; fix violators. · ecaa6962
      Jim Meyering 提交于
      * Makefile.maint (sc_unmarked_diagnostics): Check for more functions.
      * src/conf.c (virConfParseValue): Remove trailing space in diagnostic.
      * src/libvirt.c (do_open, virDomainMigrate): Mark diagnostics.
      * src/xend_internal.c (do_connect, xenDaemonDomainDumpXMLByID): Likewise.
      (xenDaemonDomainDumpXMLByName, xenDaemonCreateLinux): Likewise.
      (xenDaemonDomainMigratePerform, xenDaemonDomainDefineXML): Likewise.
      * src/xml.c (virXPathString, virXPathNumber, virXPathLong): Likewise.
      (virXPathBoolean, virXPathNode, virXPathNodeSet): Likewise.
      (virDomainParseXMLOSDescHVM): Likewise.
      * src/xmlrpc.c (xmlRpcValueNew): Likewise.
      (xmlRpcValueUnmarshalDictElement): Likewise.
      ecaa6962
  18. 30 1月, 2008 2 次提交
    • J
      Enable the <config.h>-requiring test; fix violations · a3781881
      Jim Meyering 提交于
      Use <config.h>, not "config.h", per autoconf documentation.
      * Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
      * .x-sc_require_config_h: New file, to list exempted files.
      * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
      a3781881
    • J
      Given code like if (foo) free (foo); remove the useless "if (foo) " part. · acff2d11
      Jim Meyering 提交于
      Likewise, given if (foo != NULL) free (foo); remove the useless "if" test.
      
      * proxy/libvirt_proxy.c: Remove unnecessary "if" test before free.
      * python/generator.py: Likewise.
      * qemud/qemud.c: Likewise.
      * src/buf.c: Likewise.
      * src/conf.c: Likewise.
      * src/hash.c: Likewise.
      * src/iptables.c: Likewise.
      * src/libvirt.c: Likewise.
      * src/openvz_conf.c: Likewise.
      * src/qemu_conf.c: Likewise.
      * src/qemu_driver.c: Likewise.
      * src/remote_internal.c: Likewise.
      * src/test.c: Likewise.
      * src/virsh.c: Likewise.
      * src/virterror.c: Likewise.
      * src/xen_internal.c: Likewise.
      * src/xen_unified.c: Likewise.
      * src/xend_internal.c: Likewise.
      * src/xm_internal.c: Likewise.
      * src/xml.c: Likewise.
      * src/xmlrpc.c: Likewise.
      * src/xs_internal.c: Likewise.
      * tests/testutils.c: Likewise.
      * tests/xencapstest.c: Likewise.
      * tests/xmconfigtest.c: Likewise.
      acff2d11
  19. 07 1月, 2008 1 次提交
  20. 12 12月, 2007 1 次提交
    • J
      Use a variable name as sizeof argument, not a type name. · 49230350
      Jim Meyering 提交于
      Given code like: T *var = calloc (n, sizeof (T));
      Convert to this: T *var = calloc (n, sizeof (*var));
      This first-cut change adjusts all malloc, calloc, and
      realloc statements.
      
      The only binary differences are in remote_internal.c
      (due to the bug fix) and in xmlrpc.c (due to factorization).
      
      * python/libvir.c: As above.
      * qemud/event.c: Likewise.
      * qemud/mdns.c: Likewise.
      * qemud/qemud.c: Likewise.
      * qemud/remote.c: Likewise.
      * src/bridge.c: Likewise.
      * src/buf.c: Likewise.
      * src/conf.c: Likewise.
      * src/hash.c: Likewise.
      * src/iptables.c: Likewise.
      * src/openvz_conf.c: Likewise.
      * src/qemu_conf.c: Likewise.
      * src/qemu_driver.c: Likewise.
      * src/test.c: Likewise.
      * src/xen_internal.c: Likewise.
      * src/xen_unified.c: Likewise.
      * src/xm_internal.c: Likewise.
      * src/xml.c: Likewise.
      * tests/qemuxml2argvtest.c: Likewise.
      * src/xmlrpc.c (xmlRpcValuePtr): Likewise, and minor factorization.
      * src/remote_internal.c (remoteAuthMakeCredentials): Use the right
      type when allocating space for an array of cred _pointers_.
      49230350
  21. 06 12月, 2007 1 次提交
    • J
      Use gnulib, starting with its physmem and getaddrinfo modules. · 261e7581
      Jim Meyering 提交于
      New files go into these directories:
        gnulib/lib
        gnulib/m4
        gnulib/tests
      
      * bootstrap: A wrapper around gnulib-tool.
      * configure.in: Invoke gl_EARLY and gl_INIT, being careful to put gl_EARLY
      before any macro that uses AC_COMPILE_IFELSE.
      (AC_OUTPUT): Add lib/Makefile and gl-tests/Makefile.  Remove m4/Makefile.
      * Makefile.am (SUBDIRS): Add gnulib/lib and remove m4.  Add gnulib/tests
      early enough that those tests run before any libvirt unit tests.
      * m4/Makefile.am: Remove file.  Not needed.
      * src/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
      (LDADDS, libvirt_la_LIBADD): Add ../gnulib/lib/libgnu.la.
      * src/nodeinfo.c: Include "physmem.h".
      * qemud/qemud.c, src/remote_internal.c: Include "getaddrinfo.h".
      (MEMINFO_PATH, linuxNodeInfoMemPopulate): Remove definitions.
      (virNodeInfoPopulate): Use physmem_total, not linuxNodeInfoMemPopulate.
      * tests/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
      (LDADDS): Add ../gnulib/lib/libgnu.la.
      * qemud/Makefile.am (libvirtd_LDADD): Add ../gnulib/lib/libgnu.la.
      * tests/nodeinfotest.c (linuxTestCompareFiles): No longer read total
      memory from a file.
      Update expected output not to include "Memory: NNNN"
      * tests/nodeinfodata/linux-nodeinfo-1.txt:
      * tests/nodeinfodata/linux-nodeinfo-2.txt:
      * tests/nodeinfodata/linux-nodeinfo-3.txt:
      * tests/nodeinfodata/linux-nodeinfo-4.txt:
      * tests/nodeinfodata/linux-nodeinfo-5.txt:
      * tests/nodeinfodata/linux-nodeinfo-6.txt:
      * src/test.c [WITH_TEST]: Remove definition of _GNU_SOURCE that
      would conflict with the one now in "config.h".
      * autogen.sh: Add -I gnulib/m4.
      * src/conf.c, src/sexpr.c: Don't define _GNU_SOURCE.
      Instead, include "config.h".
      * qemud/qemud.c: Remove definition of _GNU_SOURCE.
      * src/openvz_driver.c: Likewise.
      * src/qemu_driver.c: Likewise.
      * src/remote_internal.c: Likewise.
      
      * configure.in: Use AC_CONFIG_AUX_DIR(build-aux), so that a bunch
      of gettextize-generated files go into build-aux/, rather than in
      the top-level directory.
      * .cvsignore: Adjust.
      * build-aux/.cvsignore: New file.
      
      
      Author: Jim Meyering <meyering@redhat.com>
      261e7581
  22. 19 10月, 2007 2 次提交
  23. 04 7月, 2007 1 次提交
  24. 27 6月, 2007 1 次提交
  25. 23 3月, 2007 1 次提交
  26. 10 3月, 2007 1 次提交
  27. 14 2月, 2007 1 次提交
    • M
      Tue Feb 14 15:37:17 EST 2007 Mark McLoughlin <markmc@redhat.com> · 8ce3203a
      Mark McLoughlin 提交于
              Note: potential ABI break here, but people should
              only really be using virError structs returned from
              libvirt itself.
      
              * include/libvirt/virterror.h: add virNetwork
              to virError
      
              * src/internal.h, src/virterror.c: add network param
              to __virRaiseError()
      
              * src/conf.c, src/hash.c, src/libvirt.c, src/proxy_internal.c,
              src/qemu_internal.c, src/sexpr.c, src/test.c, src/xen_internal.c,
              src/xend_internal.c, src/xm_internal.c, src/xml.c, src/xmlrpc.c,
              src/xs_internal.c: update.
      8ce3203a
  28. 20 1月, 2007 1 次提交
  29. 16 11月, 2006 1 次提交
  30. 21 9月, 2006 1 次提交
  31. 04 9月, 2006 1 次提交
  32. 30 8月, 2006 2 次提交