1. 12 5月, 2011 7 次提交
    • 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
  2. 11 5月, 2011 27 次提交
  3. 10 5月, 2011 4 次提交
  4. 09 5月, 2011 2 次提交