1. 10 7月, 2013 1 次提交
  2. 23 5月, 2013 1 次提交
  3. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  4. 24 4月, 2013 2 次提交
  5. 05 4月, 2013 4 次提交
    • P
      virCaps: get rid of defaultConsoleTargetType callback · 482e5f15
      Peter Krempa 提交于
      This patch refactors various places to allow removing of the
      defaultConsoleTargetType callback from the virCaps structure.
      
      A new console character device target type is introduced -
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE - to mark that no type was
      specified in the XML. This type is at the end converted to the standard
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL. Other types that are
      different from this default have to be processed separately in the
      device post parse callback.
      482e5f15
    • P
      conf callback: Rearrange function parameters · ad0d10b2
      Peter Krempa 提交于
      Move the xmlopt and caps arguments to the end of the argument list.
      ad0d10b2
    • P
      conf: Add post XML parse callbacks and prepare for cleaning of virCaps · 43b99fc4
      Peter Krempa 提交于
      This patch adds instrumentation that will allow hypervisor drivers to
      fill and validate domain and device definitions after parsed by the XML
      parser.
      
      With this patch, after the XML is parsed, a callback to the driver is
      issued requesting to fill and validate driver specific details of the
      configuration. This allows to use sensible defaults and checks on a per
      driver basis at the time the XML is parsed.
      
      Two callback pointers are stored in the new virDomainXMLConf object:
      * virDomainDeviceDefPostParseCallback (devicesPostParseCallback)
        - called for a single device parsed and for every single device in a
          domain config. A virDomainDeviceDefPtr is passed along with the
          domain definition and virCaps.
      
      * virDomainDefPostParseCallback, (domainPostParseCallback)
        - A callback that is meant to process the domain config after it's
        parsed.  A virDomainDefPtr is passed along with virCaps.
      
      Both types of callbacks support arbitrary opaque data passed for the
      callback functions.
      
      Errors may be reported in those callbacks resulting in a XML parsing
      failure.
      43b99fc4
    • P
      maint: Rename xmlconf to xmlopt and virDomainXMLConfig to virDomainXMLOption · e84b1931
      Peter Krempa 提交于
      This patch is the result of running:
      
      for i in $(git ls-files | grep -v html | grep -v \.po$ ); do
        sed -i -e "s/virDomainXMLConf/virDomainXMLOption/g" -e "s/xmlconf/xmlopt/g" $i
      done
      
      and a few manual tweaks.
      e84b1931
  6. 13 3月, 2013 1 次提交
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  7. 08 2月, 2013 1 次提交
  8. 21 12月, 2012 5 次提交
  9. 19 12月, 2012 1 次提交
  10. 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
  11. 02 11月, 2012 1 次提交
  12. 09 10月, 2012 1 次提交
    • M
      Call curl_global_init from virInitialize to avoid thread-safety issues · 458c4998
      Matthias Bolte 提交于
      curl_global_init is not thread-safe. curl_easy_init might call
      curl_global_init when it was no called before. But curl_easy_init
      can be called from different threads by the ESX driver. Therefore,
      call curl_global_init from virInitialize to stop curl_easy_init from
      calling it.
      
      Reported by Benjamin Wang.
      458c4998
  13. 21 9月, 2012 1 次提交
  14. 10 8月, 2012 1 次提交
    • E
      build: fix PROBE() usage of intptr_t · 51ee43aa
      Eric Blake 提交于
      Otherwise, in locations like virobject.c where PROBE is used,
      for certain configure options, the compiler warns:
      
      util/virobject.c:110:1: error: 'intptr_t' undeclared (first use in this function)
      
      As long as we are making this header always available, we can
      clean up several other files.
      
      * src/internal.h (includes): Pull in <stdint.h>.
      * src/conf/nwfilter_conf.h: Rely on internal.h.
      * src/storage/storage_backend.c: Likewise.
      * src/storage/storage_backend.h: Likewise.
      * src/util/cgroup.c: Likewise.
      * src/util/sexpr.h: Likewise.
      * src/util/virhashcode.h: Likewise.
      * src/util/virnetdevvportprofile.h: Likewise.
      * src/util/virnetlink.h: Likewise.
      * src/util/virrandom.h: Likewise.
      * src/vbox/vbox_driver.c: Likewise.
      * src/xenapi/xenapi_driver.c: Likewise.
      * src/xenapi/xenapi_utils.c: Likewise.
      * src/xenapi/xenapi_utils.h: Likewise.
      * src/xenxs/xenxs_private.h: Likewise.
      * tests/storagebackendsheepdogtest.c: Likewise.
      51ee43aa
  15. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  16. 19 7月, 2012 1 次提交
  17. 17 7月, 2012 1 次提交
  18. 28 6月, 2012 1 次提交
  19. 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
  20. 23 3月, 2012 3 次提交
  21. 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
  22. 25 2月, 2012 1 次提交
    • M
      Fixed URI parsing · 9f748277
      Martin Kletzander 提交于
      Function xmlParseURI does not remove square brackets around IPv6
      address when parsing. One of the solutions is making wrappers around
      functions working with xmlURI*. This assures that uri->server will be
      always properly assigned and it doesn't have to be changed when used
      on some new place in the code.
      For this purpose, functions virParseURI and virSaveURI were
      added. These function are wrappers around xmlParseURI and xmlSaveUri
      respectively.
      Also there is one new syntax check function to prohibit these functions
      anywhere else.
      
      File changes:
       - src/util/viruri.h        -- declaration
       - src/util/viruri.c        -- definition
       - src/libvirt_private.syms -- symbol export
       - src/Makefile.am          -- added source and header files
       - cfg.mk                   -- added sc_prohibit_xmlURI
       - all others               -- ID name and include fixes
      9f748277
  23. 28 1月, 2012 1 次提交
  24. 24 1月, 2012 1 次提交
    • D
      Add new virDomainShutdownFlags API · 0b7ddf9e
      Daniel P. Berrange 提交于
      Add a new API virDomainShutdownFlags and define:
      
          VIR_DOMAIN_SHUTDOWN_DEFAULT        = 0,
          VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = (1 << 0),
          VIR_DOMAIN_SHUTDOWN_GUEST_AGENT    = (1 << 1),
      
      Also define some flags for the reboot API
      
          VIR_DOMAIN_REBOOT_DEFAULT        = 0,
          VIR_DOMAIN_REBOOT_ACPI_POWER_BTN = (1 << 0),
          VIR_DOMAIN_REBOOT_GUEST_AGENT    = (1 << 1),
      
      Although these two APIs currently have the same flags, using
      separate enums allows them to expand separately in the future.
      
      Add stub impls of the new API for all existing drivers
      0b7ddf9e
  25. 24 11月, 2011 2 次提交
  26. 12 11月, 2011 1 次提交
    • E
      xenapi: remove unused variable · 787b0a22
      Eric Blake 提交于
        CC     libvirt_driver_xenapi_la-xenapi_driver.lo
      xenapi/xenapi_driver.c: In function 'xenapiDomainGetVcpus':
      xenapi/xenapi_driver.c:1209:21: error: variable 'cpus' set but not used [-Werror=unused-but-set-variable]
      
      * src/xenapi/xenapi_driver.c (xenapiDomainGetVcpus): Silence
      compiler warning.
      787b0a22
  27. 03 11月, 2011 1 次提交
    • 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
  28. 30 10月, 2011 1 次提交
    • M
      xenapi: Improve error reporting in xenapiOpen once again · 484460ec
      Matthias Bolte 提交于
      privP->session->error_description is a list and in order to get the
      complete error message all parts of the list should be concatenated.
      xenapiSessionErrorHandler does this when its third parameter is NULL.
      The current code discards all but the first part of the error message
      resulting in a potentially incomplete error message.
      
      This partly reverts 006be75e, that tried to avoid reporting
      a (null) in the error message. The actual problem is more general in
      returnErrorFromSession that might return NULL if there is no error.
      
      Make sure that returnErrorFromSession return non-NULL always. Also
      don't skip the last error message part.
      484460ec
  29. 14 10月, 2011 1 次提交
    • E
      build: add compiler attributes to virUUIDParse · 430156cf
      Eric Blake 提交于
      Coverity complained that most, but not all, clients of virUUIDParse
      were checking for errors.  Silence those coverity warnings by
      explicitly marking the cases where we trust the input, and fixing
      one instance that really should have been checking.  In particular,
      this silences a rather large percentage of the warnings I saw on my
      most recent Coverity analysis run.
      
      * src/util/uuid.h (virUUIDParse): Enforce rules.
      * src/util/uuid.c (virUUIDParse): Drop impossible check; at least
      Coverity will detect if we break rules and pass NULL.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreateXML)
      (xenapiDomainLookupByID, xenapiDomainLookupByName)
      (xenapiDomainDefineXML): Ignore return when we trust data source.
      * src/vbox/vbox_tmpl.c (nsIDtoChar, vboxIIDToUUID_v3_x)
      (vboxCallbackOnMachineStateChange)
      (vboxCallbackOnMachineRegistered, vboxStoragePoolLookupByName):
      Likewise.
      * src/node_device/node_device_hal.c (gather_system_cap): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxpr): Check for errors.
      430156cf