You need to sign in or sign up before continuing.
  1. 22 1月, 2013 1 次提交
  2. 21 12月, 2012 7 次提交
  3. 19 12月, 2012 1 次提交
  4. 10 11月, 2012 1 次提交
    • V
      capabilities: defaultConsoleTargetType can depend on architecture · b1c88c14
      Viktor Mihajlovski 提交于
      For S390, the default console target type cannot be of type 'serial'.
      It is necessary to at least interpret the 'arch' attribute
      value of the os/type element to produce the correct default type.
      
      Therefore we need to extend the signature of defaultConsoleTargetType
      to account for architecture. As a consequence all the drivers
      supporting this capability function must be updated.
      
      Despite the amount of changed files, the only change in behavior is
      that for S390 the default console target type will be 'virtio'.
      
      N.B.: A more future-proof approach could be to to use hypervisor
      specific capabilities to determine the best possible console type.
      For instance one could add an opaque private data pointer to the
      virCaps structure (in case of QEMU to hold capsCache) which could
      then be passed to the defaultConsoleTargetType callback to determine
      the console target type.
      Seems to be however a bit overengineered for the use case...
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      b1c88c14
  5. 02 11月, 2012 1 次提交
  6. 24 10月, 2012 1 次提交
    • J
      Fix detection of Xen sysctl version 9 · 9785f2b6
      Jim Fehlig 提交于
      In commit 371ddc98, I mistakenly added the check for sysctl
      version 9 after setting the hypercall version to 1, which will
      fail with
      
      error : xenHypervisorDoV1Op:967 : Unable to issue hypervisor
      ioctl 3166208: Function not implemented
      
      This check should be included along with the others that use
      hypercall version 2.
      9785f2b6
  7. 27 9月, 2012 1 次提交
  8. 21 9月, 2012 1 次提交
  9. 27 7月, 2012 1 次提交
    • O
      maint: Use consistent copyright. · a4bcefbc
      Osier Yang 提交于
      This is a follow up patch of commit f9ce7dad, it modifies all
      the files which declare the copyright like "See COPYING.LIB for
      the License of this software" to use the detailed/consistent one.
      
      And deserts the outdated comments like:
      
       * libvirt-qemu.h:
       * Summary: qemu specific interfaces
       * Description: Provides the interfaces of the libvirt library to handle
       *              qemu specific methods
       *
       * Copy:  Copyright (C) 2010, 2012 Red Hat, Inc.
      
      Uses the more compact style like:
      
       * libvirt-qemu.h: Interfaces specific for QEMU/KVM driver
       *
       * Copyright (C) 2010, 2012 Red Hat, Inc.
      a4bcefbc
  10. 20 7月, 2012 3 次提交
  11. 04 5月, 2012 1 次提交
    • O
      Coverity: Fix resource leak in xen driver · e91e0ab6
      Osier Yang 提交于
      Coverity logs:
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:103: alloc_fn: Calling allocation function "xenDaemonLookupByUUID".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2534: alloc_fn: Storage is returned from allocation function "virGetDomain".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:191: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:210: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2534: var_assign: Assigning: "ret" = "virGetDomain(conn, name, uuid)".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2541: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:103: var_assign: Assigning: "dom" =  storage returned from "xenDaemonLookupByUUID(conn, rawuuid)".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:126: leaked_storage: Variable "dom" going out of scope leaks the storage it points to.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2742: alloc_fn: Calling allocation function "fopen".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2742: var_assign: Assigning: "cpuinfo" =  storage returned from "fopen("/proc/cpuinfo", "r")".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2763: noescape: Variable "cpuinfo" is not freed or pointed-to in function "xenHypervisorMakeCapabilitiesInternal".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2574:45: noescape: "xenHypervisorMakeCapabilitiesInternal" does not free or save its pointer parameter "cpuinfo".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2768: leaked_storage: Variable "cpuinfo" going out of scope leaks the storage it points to.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2752: alloc_fn: Calling allocation function "fopen".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2752: var_assign: Assigning: "capabilities" =  storage returned from "fopen("/sys/hypervisor/properties/capabilities", "r")".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2763: noescape: Variable "capabilities" is not freed or pointed-to in function "xenHypervisorMakeCapabilitiesInternal".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2574:60: noescape: "xenHypervisorMakeCapabilitiesInternal" does not free or save its pointer parameter "capabilities".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2768: leaked_storage: Variable "capabilities" going out of scope leaks the storage it points to.
      e91e0ab6
  12. 30 3月, 2012 1 次提交
  13. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  14. 08 3月, 2012 1 次提交
    • E
      xml: use long long internally, to centralize overflow checks · 73b99771
      Eric Blake 提交于
      On 64-bit platforms, unsigned long and unsigned long long are
      identical, so we don't have to worry about overflow checks.
      On 32-bit platforms, anywhere we narrow unsigned long long back
      to unsigned long, we have to worry about overflow; it's easier
      to do this in one place by having most of the code use the same
      or wider types, and only doing the narrowing at the last minute.
      Therefore, the memory set commands remain unsigned long, and
      the memory get command now centralizes the overflow check into
      libvirt.c, so that drivers don't have to repeat the work.
      
      This also fixes a bug where xen returned the wrong value on
      failure (most APIs return -1 on failure, but getMaxMemory
      must return 0 on failure).
      
      * src/driver.h (virDrvDomainGetMaxMemory): Use long long.
      * src/libvirt.c (virDomainGetMaxMemory): Raise overflow.
      * src/test/test_driver.c (testGetMaxMemory): Fix driver.
      * src/rpc/gendispatch.pl (name_to_ProcName): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorGetMaxMemory): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainGetMaxMemory): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainGetMaxMemory):
      Likewise.
      * src/xen/xend_internal.h (xenDaemonDomainGetMaxMemory):
      Likewise.
      * src/xen/xm_internal.c (xenXMDomainGetMaxMemory): Likewise.
      * src/xen/xm_internal.h (xenXMDomainGetMaxMemory): Likewise.
      * src/xen/xs_internal.c (xenStoreDomainGetMaxMemory): Likewise.
      * src/xen/xs_internal.h (xenStoreDomainGetMaxMemory): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainGetMaxMemory):
      Likewise.
      * src/esx/esx_driver.c (esxDomainGetMaxMemory): Likewise.
      * src/libxl/libxl_driver.c (libxlDomainGetMaxMemory): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainGetMaxMemory): Likewise.
      * src/lxc/lxc_driver.c (lxcDomainGetMaxMemory): Likewise.
      * src/uml/uml_driver.c (umlDomainGetMaxMemory): Likewise.
      73b99771
  15. 23 1月, 2012 1 次提交
  16. 21 1月, 2012 1 次提交
  17. 20 1月, 2012 2 次提交
    • E
      error: drop old-style error reporting · c2551bea
      Eric Blake 提交于
      While we still don't want to enable gcc's new -Wformat-literal
      warning, I found a rather easy case where the warning could be
      reduced, by getting rid of obsolete error-reporting practices.
      This is the last place where we were passing the (unused) net
      and conn arguments for constructing an error.
      
      * src/util/virterror_internal.h (virErrorMsg): Delete prototype.
      (virReportError): Delete macro.
      * src/util/virterror.c (virErrorMsg): Make static.
      * src/libvirt_private.syms (virterror_internal.h): Drop export.
      * src/util/conf.c (virConfError): Convert to macro.
      (virConfErrorHelper): New function, and adjust error calls.
      * src/xen/xen_hypervisor.c (virXenErrorFunc): Delete.
      (xenHypervisorGetSchedulerType)
      (xenHypervisorGetSchedulerParameters)
      (xenHypervisorSetSchedulerParameters)
      (xenHypervisorDomainBlockStats)
      (xenHypervisorDomainInterfaceStats)
      (xenHypervisorDomainGetOSType)
      (xenHypervisorNodeGetCellsFreeMemory, xenHypervisorGetVcpus):
      Update callers.
      c2551bea
    • E
      util: use new virTypedParameter helpers · 9e48c225
      Eric Blake 提交于
      Reusing common code makes things smaller; it also buys us some
      additional safety, such as now rejecting duplicate parameters
      during a set operation.
      
      * src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters)
      (qemuDomainSetMemoryParameters, qemuDomainSetNumaParameters)
      (qemuSetSchedulerParametersFlags)
      (qemuDomainSetInterfaceParameters, qemuDomainSetBlockIoTune)
      (qemuDomainGetBlkioParameters, qemuDomainGetMemoryParameters)
      (qemuDomainGetNumaParameters, qemuGetSchedulerParametersFlags)
      (qemuDomainBlockStatsFlags, qemuDomainGetInterfaceParameters)
      (qemuDomainGetBlockIoTune): Use new helpers.
      * src/esx/esx_driver.c (esxDomainSetSchedulerParametersFlags)
      (esxDomainSetMemoryParameters)
      (esxDomainGetSchedulerParametersFlags)
      (esxDomainGetMemoryParameters): Likewise.
      * src/libxl/libxl_driver.c
      (libxlDomainSetSchedulerParametersFlags)
      (libxlDomainGetSchedulerParametersFlags): Likewise.
      * src/lxc/lxc_driver.c (lxcDomainSetMemoryParameters)
      (lxcSetSchedulerParametersFlags, lxcDomainSetBlkioParameters)
      (lxcDomainGetMemoryParameters, lxcGetSchedulerParametersFlags)
      (lxcDomainGetBlkioParameters): Likewise.
      * src/test/test_driver.c (testDomainSetSchedulerParamsFlags)
      (testDomainGetSchedulerParamsFlags): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorSetSchedulerParameters)
      (xenHypervisorGetSchedulerParameters): Likewise.
      9e48c225
  18. 05 1月, 2012 1 次提交
    • J
      Support Xen domctl v8 · 49d8c8bc
      Jim Fehlig 提交于
      xen-unstable c/s 23874:651aed73b39c added another member to
      xen_domctl_getdomaininfo struct and bumped domctl version to 8.
      Add a corresponding domctl v8 struct in xen hypervisor sub-driver
      and detect domctl v8 during initialization.
      49d8c8bc
  19. 04 12月, 2011 1 次提交
    • E
      maint: fix improper use of 'an' · 3a9ce767
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=648855 mentioned a
      misuse of 'an' where 'a' is proper; that has since been fixed,
      but a search found other problems (some were a spelling error for
      'and', while most were fixed by 'a').
      
      * daemon/stream.c: Fix grammar.
      * src/conf/domain_conf.c: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/esx/esx_driver.c: Likewise.
      * src/esx/esx_vi.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * src/rpc/virnetserverprogram.c: Likewise.
      * src/storage/storage_backend_fs.c: Likewise.
      * src/util/conf.c: Likewise.
      * src/util/dnsmasq.c: Likewise.
      * src/util/iptables.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * src/xen/xs_internal.c: Likewise.
      * tools/virsh.c: Likewise.
      3a9ce767
  20. 30 11月, 2011 1 次提交
  21. 03 11月, 2011 3 次提交
    • D
      Fix default console type setting · 209c2880
      Daniel P. Berrange 提交于
      The default console type may vary based on the OS type. ie a Xen
      paravirt guests wants a 'xen' console, while a fullvirt guests
      wants a 'serial' console.
      
      A plain integer default console type in the capabilities does
      not suffice. Instead introduce a callback that is passed the
      OS type.
      
      * src/conf/capabilities.h: Use a callback for default console
        type
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Use callback
        for default console type. Add missing LXC/OpenVZ console types.
      * src/esx/esx_driver.c, src/libxl/libxl_conf.c,
        src/lxc/lxc_conf.c, src/openvz/openvz_conf.c,
        src/phyp/phyp_driver.c, src/qemu/qemu_capabilities.c,
        src/uml/uml_conf.c, src/vbox/vbox_tmpl.c,
        src/vmware/vmware_conf.c, src/xen/xen_hypervisor.c,
        src/xenapi/xenapi_driver.c: Set default console type callback
      209c2880
    • E
      xen: allow getting < max typed parameters · fbae3d6f
      Eric Blake 提交于
      Allow the user to call with nparams too small, per API documentation.
      
      * src/xen/xen_hypervisor.c (xenHypervisorGetSchedulerParameters):
      Allow fewer than max.
      * src/xen/xend_internal.c (xenDaemonGetSchedulerParameters):
      Likewise.
      fbae3d6f
    • E
      API: document scheduler parameter names · 319992d4
      Eric Blake 提交于
      Document the parameter names that will be used by
      virDomain{Get,Set}SchedulerParameters{,Flags}, rather than
      hard-coding those names in each driver, to match what is
      done with memory, blkio, and blockstats parameters.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_SCHEDULER_CPU_SHARES)
      (VIR_DOMAIN_SCHEDULER_VCPU_PERIOD)
      (VIR_DOMAIN_SCHEDULER_VCPU_QUOTA, VIR_DOMAIN_SCHEDULER_WEIGHT)
      (VIR_DOMAIN_SCHEDULER_CAP, VIR_DOMAIN_SCHEDULER_RESERVATION)
      (VIR_DOMAIN_SCHEDULER_LIMIT, VIR_DOMAIN_SCHEDULER_SHARES): New
      field name macros.
      * src/qemu/qemu_driver.c (qemuSetSchedulerParametersFlags)
      (qemuGetSchedulerParametersFlags): Use new defines.
      * src/test/test_driver.c (testDomainGetSchedulerParamsFlags)
      (testDomainSetSchedulerParamsFlags): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorGetSchedulerParameters)
      (xenHypervisorSetSchedulerParameters): Likewise.
      * src/xen/xend_internal.c (xenDaemonGetSchedulerParameters)
      (xenDaemonSetSchedulerParameters): Likewise.
      * src/lxc/lxc_driver.c (lxcSetSchedulerParametersFlags)
      (lxcGetSchedulerParametersFlags): Likewise.
      * src/esx/esx_driver.c (esxDomainGetSchedulerParametersFlags)
      (esxDomainSetSchedulerParametersFlags): Likewise.
      * src/libxl/libxl_driver.c (libxlDomainGetSchedulerParametersFlags)
      (libxlDomainSetSchedulerParametersFlags): Likewise.
      319992d4
  22. 14 10月, 2011 2 次提交
    • P
      Xen: Fake versions in xencapstest · 435b9d99
      Philipp Hahn 提交于
      virInitialize() → xenRegister() → xenhypervisorInit() determines the
      version of the Hypervisor. This breaks xencapstest when building as root
      on a dom0 system, since xenHypervisorBuildCapabilities() adds the "hap"
      and "viridian" features based on the detected version.
      
      Add an optional parameter to xenhypervisorInit() to disable automatic
      detection of the Hypervisor version. The passed in arguments are used
      instead.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      435b9d99
    • P
      Xen: move versions to struct · 618758c9
      Philipp Hahn 提交于
      Calling virInitialize() → xenRegister() → xenhypervisorInit() directly
      opens a connection to the Xen Hypervisor, which breaks some unit tests.
      
      Move all static variables into a struct to make it easier to override
      them when testing.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      618758c9
  23. 23 8月, 2011 1 次提交
  24. 29 7月, 2011 2 次提交
    • E
      xen: drop unused callbacks · 1b3765fd
      Eric Blake 提交于
      Found by:
      
      for f in $(sed -n 's/.*Drv[^ ]* \([^;]*\);.*/\1/p' src/xen/xen_driver.h)
      do
        git grep "\(\.\|->\)$f\b" src/xen
      done | cat
      
      and looking through the resulting list to see which callback struct
      members are still necessary.
      
      * src/xen/xen_driver.h (xenUnifiedDriver): Drop all callbacks that
      are only used directly.
      * src/xen/xen_hypervisor.c (xenHypervisorDriver): Shrink list.
      * src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
      * src/xen/xend_internal.c (xenDaemonDriver): Likewise.
      * src/xen/xm_internal.c (xenXMDriver): Likewise.
      * src/xen/xs_internal.c (xenStoreDriver): Likewise.
      1b3765fd
    • E
      xen: cleanup callback struct · f859919f
      Eric Blake 提交于
      Using C99 initializers and xen-specific prefixes will make it
      so that future patches are less likely to add callback members
      to the xenUnifiedDriver struct, since the goal is to get rid
      of the callback struct in the first place.
      
      * src/xen/xen_driver.h (xenUnifiedDriver): Rename all struct
      members, to make it obvious which ones are still in use.
      * src/xen/xen_driver.c: Update all callers.
      * src/xen/xen_hypervisor.c (xenHypervisorDriver): Rewrite with C99
      initializers.
      * src/xen/xend_internal.c (xenDaemonDriver): Likewise.
      * src/xen/xs_internal.c (xenStoreDriver): Likewise.
      * src/xen/xm_internal.c (xenXMDriver): Likewise.
      * src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
      f859919f
  25. 22 7月, 2011 3 次提交
    • E
      build: fix bugs with destroyFlags patches · 934fdcb3
      Eric Blake 提交于
      Build failure on xenapi_driver from compiler warnings (flags was unused).
      
      Build failure on xen (incorrect number of arguments).  And in fixing
      that, I obeyed the comments of struct xenUnifiedDriver that state
      that we want to minimize the number of callback functions in that
      struct, not add to it.
      
      * src/xen/xen_driver.c (xenUnifiedDomainDestroyFlags): Use correct
      arguments.
      (xenUnifiedDomainDestroy): Simplify.
      * src/xen/xen_driver.h (xenUnifiedDriver): Remove unused callback.
      * src/xen/xen_hypervisor.c (xenHypervisorDestroyDomain): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainDestroy): Likewise.
      * src/xen/xend_internal.h (xenDaemonDomainDestroyFlags): Likewise.
      * src/xen/xm_internal.c (xenXMDriver): Likewise.
      * src/xen/xs_internal.c (xenStoreDriver): Likewise.
      * src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainDestroyFlags): Reject
      unknown flags.
      934fdcb3
    • M
      destroy: Implement internal API for xen driver · 1edf5cc5
      Michal Privoznik 提交于
      1edf5cc5
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089