1. 21 5月, 2011 1 次提交
  2. 20 5月, 2011 1 次提交
  3. 18 5月, 2011 1 次提交
  4. 17 5月, 2011 3 次提交
  5. 16 5月, 2011 2 次提交
  6. 13 5月, 2011 1 次提交
  7. 12 5月, 2011 2 次提交
    • 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
    • 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
  8. 07 5月, 2011 11 次提交
  9. 05 5月, 2011 1 次提交
    • E
      remote: avoid null dereference on error · 85cb2926
      Eric Blake 提交于
      Clang found three instances of uninitialized use of nparams in
      the cleanup path.  Unfortunately, one is a false positive: clang
      couldn't see that ret->params.params_val is guaranteed to be
      NULL unless allocated within a function, and that nparams is
      guaranteed to be assigned prior to the allocation; hoisting the
      assignment to nparams to be earlier in the function shuts up
      that false positive.  But two of the reports also happened to
      highlight a real bug - the error path can dereference NULL.
      
      Regression introduced in commit 158ba873.
      
      * daemon/remote.c (remoteDispatchDomainGetMemoryParameters)
      (remoteDispatchDomainGetBlkioParameters): Don't clear fields if
      array was not allocated.
      (remoteDispatchDomainGetSchedulerParameters): Initialize nparams
      earlier.
      85cb2926
  10. 27 4月, 2011 1 次提交
  11. 23 4月, 2011 1 次提交
  12. 18 4月, 2011 5 次提交
    • D
      Change some variable names to follow standard in daemon dispatcher · bf4883ca
      Daniel P. Berrange 提交于
      Replace some occurrances of
      
        virDomainPtr domain;
        virNetworkPtr network;
      
      With
      
        virDomainPtr dom;
        virNetworkPtr net;
      
      * daemon/remote.c: Fix variable naming to follow standard
      bf4883ca
    • D
      Write error check conditionals in more compact form for dispatcher · 05a6283c
      Daniel P. Berrange 提交于
      Replace cases of
      
           type = virConnectGetType(conn);
           if (type == NULL)
               goto cleanup;
      
      With
      
           if (!(type = virConnectGetType(conn)))
               goto cleanup;
      
      * daemon/remote.c: Write error checks in compat form
      05a6283c
    • D
      Remove curly braces on all single-line conditional jumps in dispatcher · 55c71a26
      Daniel P. Berrange 提交于
      Replace all occurrances of
      
         if (....) {
            goto cleanup;
         }
      
      With
      
         if (.....)
            goto cleanup;
      
      to save one line of code
      
      * daemon/remote.c: Remove curly braces on single line conditionals
      55c71a26
    • D
      Fix checking of return codes in dispatcher · c19295e5
      Daniel P. Berrange 提交于
      The libvirt APIs reserve any negative value for indicating an
      error. Thus checks
      
          if (virXXXX() == -1)
      
      Should instead be
      
          if (virXXXX() < 0)
      
      * daemon/remote.c: s/ == -1/ < 0/
      c19295e5
    • D
      Merge all returns paths from dispatcher into single path · 158ba873
      Daniel P. Berrange 提交于
      The dispatcher functions have numerous places where they
      return to the caller. This leads to duplicated cleanup
      code, often resulting in memory leaks. It makes it harder
      to ensure that errors are dispatched before freeing objects,
      which may overwrite the original error.
      
      The standard pattern is now
      
          remoteDispatchXXX(...) {
              int rv = -1;
      
              ....
              if (XXX < 0)
                goto cleanup;
              ...
              if (XXXX < 0)
                goto cleanup;
              ...
      
              rv = 0;
          cleanup:
              if (rv < 0)
                 remoteDispatchError(rerr);
              ...free all other stuff..
              return rv;
          }
      
      * daemon/remote.c: Centralize all cleanup paths
      * daemon/stream.c: s/remoteDispatchConnError/remoteDispatchError/
      * daemon/dispatch.c, daemon/dispatch.h: Replace
        remoteDispatchConnError with remoteDispatchError
        removing unused virConnectPtr
      158ba873
  13. 14 4月, 2011 4 次提交
  14. 05 4月, 2011 1 次提交
  15. 29 3月, 2011 1 次提交
    • D
      Remote protocol support for storage vol upload/download APIs · 230a5d8b
      Daniel P. Berrange 提交于
      * daemon/remote.c, src/remote/remote_driver.c: Implementation
        of storage vol upload/download APIs
      * src/remote/remote_protocol.x: Wire protocol definition for
        upload/download
      * daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
        daemon/remote_dispatch_table.h, src/remote/remote_protocol.h,
        src/remote/remote_protocol.c: Re-generate
      230a5d8b
  16. 25 3月, 2011 2 次提交
    • J
      daemon: Avoid resetting errors before they are reported · 55cc591f
      Jiri Denemark 提交于
      Commit f44bfb7f was supposed to make sure no additional libvirt API (esp.
      *Free) is called before remoteDispatchConnError() is called on error.
      However, the patch missed two instances.
      55cc591f
    • E
      command: properly diagnose process exit via signal · 208a044a
      Eric Blake 提交于
      Child processes don't always reach _exit(); if they die from a
      signal, then any messages should still be accurate.  Most users
      either expect a 0 status (thankfully, if status==0, then
      WIFEXITED(status) is true and WEXITSTATUS(status)==0 for all
      known platforms) or were filtering on WIFEXITED before printing
      a status, but a few were missing this check.  Additionally,
      nwfilter_ebiptables_driver was making an assumption that works
      on Linux (where WEXITSTATUS shifts and WTERMSIG just masks)
      but fails on other platforms (where WEXITSTATUS just masks and
      WTERMSIG shifts).
      
      * src/util/command.h (virCommandTranslateStatus): New helper.
      * src/libvirt_private.syms (command.h): Export it.
      * src/util/command.c (virCommandTranslateStatus): New function.
      (virCommandWait): Use it to also diagnose status from signals.
      * src/security/security_apparmor.c (load_profile): Likewise.
      * src/storage/storage_backend.c
      (virStorageBackendQEMUImgBackingFormat): Likewise.
      * src/util/util.c (virExecDaemonize, virRunWithHook)
      (virFileOperation, virDirCreate): Likewise.
      * daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesExecCLI):
      Likewise.
      208a044a
  17. 24 3月, 2011 1 次提交
    • J
      Make error reporting in libvirtd thread safe · f44bfb7f
      Jiri Denemark 提交于
      Bug https://bugzilla.redhat.com/show_bug.cgi?id=689374 reported libvirtd
      crash during error dispatch.
      
      The reason is that libvirtd uses remoteDispatchConnError() with non-NULL
      conn parameter which means that virConnGetLastError() is used instead of
      its thread safe replacement virGetLastError().
      
      So when several libvirtd threads are reporting errors at the same time,
      the errors can get mixed or corrupted or in case of bad luck libvirtd
      itself crashes.
      
      Since Daniel B. is going to rewrite this code from scratch on top of his
      RPC infrastructure, I tried to come up with a minimal fix. Thus,
      remoteDispatchConnError() now just ignores its conn argument and always
      calls virGetLastError(). However, several callers had to be touched as
      well, since no libvirt API is allowed to be called before dispatching
      the error. Doing so would reset the error and we would have nothing to
      dispatch. As a result of that, the code is not very nice but that
      doesn't really make daemon/remote.c worse than it is now :-) And it will
      all die soon, which is good.
      
      The bug report also contains a reproducer in C which detects both mixed
      up error messages and libvirtd crash. Before this patch, I was able to
      crash libvirtd in about 20 seconds up to 3 minutes depending on number
      of CPU cores (more is better) and luck.
      f44bfb7f
  18. 22 3月, 2011 1 次提交
    • D
      Wire up virDomainMigrateSetSpeed for the remote RPC driver · 118dd7d0
      Daniel P. Berrange 提交于
      * src/remote/remote_protocol.x: Define wire protocol
      * daemon/remote.c, src/remote/remote_driver.c: Add new
        functions for virDomainMigrateSetSpeed API
      * src/remote/remote_protocol.c, src/remote/remote_protocol.h,
        daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
        daemon/remote_dispatch_table.h: Re-generate files
      118dd7d0