1. 29 8月, 2014 4 次提交
    • J
      domain_conf: Add support for iothreads in disk definition · e2523de5
      John Ferlan 提交于
      Add a new disk "driver" attribute "iothread" to be parsed as the thread
      number for the disk to use. In order to more easily facilitate the usage
      and configuration of the iothread, a "zero" for the attribute indicates
      iothreads are not supported for the device and a positive value indicates
      the specific thread to try and use.
      e2523de5
    • J
      qemu: Add support for iothreads · 72edaae7
      John Ferlan 提交于
      Add a new capability to ensure the iothreads feature exists for the qemu
      emulator being run - requires the "query-iothreads" QMP command. Using the
      domain XML add correspoding command argument in order to generate the
      threads. The iothreads will use a name space "iothread#" where, the
      future patch to add support for using an iothread to a disk definition to
      merely define which of the available threads to use.
      
      Add tests to ensure the xml/argv processing is correct.  Note that no
      change was made to qemuargv2xmltest.c as processing the -object element
      would require knowing more than just iothreads.
      72edaae7
    • J
      domain_conf: Introduce iothreads XML · ee3a9620
      John Ferlan 提交于
      Introduce XML to allowing adding iothreads to the domain. These can be
      used by virtio-blk-pci devices in order to assign a specific thread to
      handle the workload for the device.  The iothreads are the official
      implementation of the virtio-blk Data Plane that's been in tech preview
      for QEMU.
      ee3a9620
    • J
      libxl_migration: Resolve Coverity NULL_RETURNS · 0322643e
      John Ferlan 提交于
      Coverity noted that all callers to libxlDomainEventQueue() could ensure
      the second parameter (event) was true before calling except this case.
      As I look at the code and how events are used - it seems that prior to
      generating an event for the dom == NULL condition, the resume/suspend
      event should be queue'd after the virDomainSaveStatus() call which will
      goto cleanup and queue the saved event anyway.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      0322643e
  2. 28 8月, 2014 36 次提交
    • P
      qemu: Implement bulk stats API and one of the stats groups to return · d1bde8ed
      Peter Krempa 提交于
      Implement the API function for virDomainListGetStats and
      virConnectGetAllDomainStats in a modular way and implement the
      VIR_DOMAIN_STATS_STATE group of statistics.
      
      Although it may look like the function looks universal I'd rather not
      expose it to other drivers as the coming stats groups are likely to do
      qemu specific stuff to obtain the stats.
      d1bde8ed
    • J
      qemu_command: Resolve Coverity DEADCODE · 84bfb11b
      John Ferlan 提交于
      One useless warning, but the other one rather pertinent. On entry
      the 'trans' variable is initialized to VIR_DOMAIN_DISK_TRANS_DEFAULT.
      When the "trans" was found in the parsing loop it def->geometry.trans
      was assigned to the return from virDomainDiskGeometryTransTypeFromString
      and then 'trans' was used to do the comparison to see if it was valid.
      
      So remove 'trans' and use def->geometry.trans properly
      84bfb11b
    • J
      qemu_driver: Resolve Coverity DEADCODE · ec10ff9e
      John Ferlan 提交于
      A bunch of false positives brought on by our own doings
      ec10ff9e
    • J
      domain_conf: Resolve Coverity DEADCODE · dad6ef18
      John Ferlan 提交于
      A bunch of a useless warnings brought on by our own doing.
      dad6ef18
    • J
      qemu_monitor: Resolve Coverity NESTING_INDENT_MISMATCH · ee8b6245
      John Ferlan 提交于
      The PROBE macro can expand to more than one line/statement - put curly
      braces around the if statement to be safe
      ee8b6245
    • J
      storage_conf: Resolve Coverity RESOURCE_LEAK · 91a60a56
      John Ferlan 提交于
      If there was a failure processing 'authdef' and the code went to cleanup
      before the setting to source->auth, then it'd be leaked.
      91a60a56
    • J
      qemu_driver: Resolve Coverity RESOURCE_LEAK · 69e433bc
      John Ferlan 提交于
      Coverity found that the 'buf' wasn't VIR_FREE'd at exit.
      69e433bc
    • J
      phyp_driver: Resolve Coverity RESOURCE_LEAK · bc992995
      John Ferlan 提交于
      Coverity determines that when jumping to the connected: label, the
      addressinfo (ai) is not free'd.
      bc992995
    • J
      libxl_migration: Resolve Coverity RESOURCE_LEAK · ad4966d9
      John Ferlan 提交于
      In libxlDomainMigrationPrepare() if the uri_in is false, then
      'hostname' is allocated and used "generically" in the routine,
      but not freed.  Conversely, if uri_in is true, then a uri is
      allocated and hostname is set to the uri->hostname value and
      likewise generically used.
      
      At function exit, hostname wasn't free'd in the !uri_in path,
      so that was added.  To just make it clearer on usage the else
      path became the call to virURIFree() although I suppose technically
      it didn't have to since it would be a call using (NULL)
      ad4966d9
    • J
      bridge_driver: Resolve Coverity RESOURCE_LEAK · 2a4e26bd
      John Ferlan 提交于
      In the error path the 'ipaddr' wasn't VIR_FREE'd before jumping to cleanup
      2a4e26bd
    • J
      virsh-network: Resolve Coverity RESOURCE_LEAK · adedda2c
      John Ferlan 提交于
      Need to free 'xmlFromFile' on/for the error path when current was
      returning false only
      adedda2c
    • J
      network_conf: Resolve Coverity RESOURCE_LEAK · 0cec79b9
      John Ferlan 提交于
      Need to VIR_FREE the startip/endip we allocated for the error message
      0cec79b9
    • J
      qemu_capabilities: Resolve Coverity RESOURCE_LEAK · 2f7ced36
      John Ferlan 提交于
      Coverity determined that on error path that 'mach' wouldn't be free'd
      Since virCapabilitiesFreeGuestMachine() isn't globally available, we'll
      insert first and then if the VIR_STRDUP's fail they it will eventually
      cause the 'mach' to be freed in the error path
      2f7ced36
    • J
      libxl_domain: Resolve Coverity RESOURCE_LEAK · 2cc03c80
      John Ferlan 提交于
      On the error path need to free the chrdef
      2cc03c80
    • J
      qemu_agent: Resolve Coverity RESOURCE_LEAK · 6f8a4f6d
      John Ferlan 提交于
      Coverity found that on error paths, the 'arg' value wasn't be cleaned
      up. Followed the example in qemuAgentSetVCPUs() where upon successful call
      to qemuAgentCommand() the 'cpus' is set to NULL; otherwise, when cleanup
      occurs the free the memory for 'arg'
      6f8a4f6d
    • J
      qemu_command: Resolve Coverity RESOURCE_LEAK · 461fb555
      John Ferlan 提交于
      In qemuParseISCSIString() if an error was returned, then the call
      to qemuParseDriveURIString() where the uri is free'd wouldn't be run
      461fb555
    • J
      cpu_x86: Resolve Coverity RESOURCE_LEAK · be7b82a2
      John Ferlan 提交于
      Coverity determined that the copied 'oldguest' would be leaked for
      both error and success paths.
      be7b82a2
    • J
      domain_conf: Resolve Coverity RESOURCE_LEAK · f9c827e3
      John Ferlan 提交于
      Resolve a few RESOURCE_LEAK's identified by Coverity
      f9c827e3
    • J
      daemon: Resolve Coverity NEGATIVE_RETURNS · 4f25146b
      John Ferlan 提交于
      In each of these cases, Coverity complains that the result count returned
      on error paths would be -1 disregarding that the count and the corresponding
      are "linked" together (it doesn't know that).  Simple enough to check and
      remove the warning
      4f25146b
    • P
      virsh: Implement command to excercise the bulk stats APIs · 5e542970
      Peter Krempa 提交于
      Add "domstats" command that excercises both of the new APIs depending if
      you specify a domain list or not. The output is printed as a key=value
      list of the returned parameters.
      5e542970
    • W
      qemu_capabilities: Resolve Coverity RESOURCE_LEAK · 6781d5b5
      Wang Rui 提交于
      In function virQEMUCapsParseMachineTypesStr, VIR_STRNDUP allocates
      memory for 'name' in {do,while} loop. If 'name' isn't freed before
      'continue', its memory will be allocated again in the next loop.
      In this case the memory allocated for 'name' in privious loop is
      useless and not freed. Free it before continue this loop to fix that.
      Signed-off-by: NWang Rui <moon.wangrui@huawei.com>
      6781d5b5
    • W
      tests: Resolve Coverity RESOURCE_LEAK · 64cef432
      Wang Rui 提交于
      The 'lib' handle will be leaked if 'dlsym' condition fails.
      So close the handle before return.
      Signed-off-by: NWang Rui <moon.wangrui@huawei.com>
      64cef432
    • W
      util: Resolve Coverity RESOURCE_LEAK · 8879185c
      Wang Rui 提交于
      Coverity determined that 'conflict' would be leaked.
      Signed-off-by: NWang Rui <moon.wangrui@huawei.com>
      8879185c
    • P
      remote: Implement bulk domain stats APIs in the remote driver · 89a70668
      Peter Krempa 提交于
      Implement the remote driver support for shuffling the domain stats
      around.
      89a70668
    • P
      lib: Add few flags for the bulk stats APIs · 1438807b
      Peter Krempa 提交于
      Add domain list filtering functions and a flag to enforce checking
      whether the remote daemon supports the requested stats groups.
      1438807b
    • P
      conf: Add helper to free domain list · e4151224
      Peter Krempa 提交于
      Add helper to free a list of virDomainPtrs without raising or clearing
      errors. Use it in one place and prepare it for reuse.
      e4151224
    • E
      virsh: fix keepalive error msg · f284ee54
      Erik Skultety 提交于
      resolves https://bugzilla.redhat.com/show_bug.cgi?id=1132305:
      
      The error message for an out-of-range argument was confusing:
      
      virsh -k 9999999999
      error: option --k requires a positive numeric argument
      
      After this patch, it is:
      
      error: Invalid value for option -k
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f284ee54
    • J
      qemu_capabilities: Resolve Coverity NULL_RETURNS · cabebc0c
      John Ferlan 提交于
      Adjust the initialization of qemuCaps() to check for a NULL before
      attempting to dereference like other callers/users do.
      cabebc0c
    • J
      qemu_driver: Resolve Coverity CONSTANT_EXPRESSION_RESULT · 9d7254de
      John Ferlan 提交于
      The call to virDomainSnapshotRedefinePrep() had a spurrious ! in front of
      it which caused Coverity to complan that the expression is always false.
      9d7254de
    • J
      domain_conf: Resolve Coverity REVERSE_INULL · 0c5ca985
      John Ferlan 提交于
      Coverity complains that checking for domain->def being non NULL in the
      if (live) path of virDomainObjAssignDef() would be unnecessary or a
      NULL deref since the call to virDomainObjIsActive() would already
      dereference domain->def when checking if the def->id field was != -1.
      
      Checked all callers to virDomainObjAssignDef() and each at some point
      dereferences (vm)->def->{field} prior to calling when live is true.
      0c5ca985
    • J
      qemu_command: Resolve Coverity REVERSE_INULL · 39b9c121
      John Ferlan 提交于
      In qemuNetworkIfaceConnect() a call to virNetDevBandwidthSet() is
      made where the function prototype requires the first parameter
      (net->ifname) to be non NULL.  Coverity complains that the subsequent
      non NULL check for net->ifname prior to the next call gets flagged as
      an unnecessary check.  Resolve by removing the extra check
      39b9c121
    • J
      domain_conf: Resolve Coverity REVERSE_INULL · 9ba04dec
      John Ferlan 提交于
      In virDomainActualNetDefFormat() a call to virDomainNetGetActualType(def)
      was made before a check for (!def) a few lines later. This triggered
      Coverity to note the possible NULL deref.  Just moving the initialization
      to after the !def checks resolves the issue
      9ba04dec
    • J
      storage_driver: Resolve Coverity REVERSE_INULL · bab35f74
      John Ferlan 提交于
      There were two occurrances of attempting to initialize actualType by
      calling virStorageSourceGetActualType(src) prior to a check if (!src)
      resulting in Coverity complaining about the possible NULL dereference
      in virStorageSourceGetActualType() of src.
      
      Resolve by moving the actualType setting until after checking !src
      bab35f74
    • J
      xen_xm: Resolve Coverity USE_AFTER_FREE · cfbbeb36
      John Ferlan 提交于
      If virDomainDiskDefFree(disk) is called in 'skipdisk:', then it's possible
      to either return to skipdisk without reallocating a new disk (via the if
      condition just prior) or to end the loop having deleted the disk. Since
      virDomainDiskDefFree() does not pass by reference, disk isn't changed in
      this context, thus the possible issue.
      cfbbeb36
    • J
      xen_common: Resolve Coverity USE_AFTER_FREE · 0454f23c
      John Ferlan 提交于
      There were two warnings in this module
      
        If the VIR_ALLOC_N(def->serials, 1) fails, then a virDomainChrDefFree(chr)
        is called and we jump to cleanup which makes the same call. Just remove
        the one after VIR_ALLOC_N()
      
        In the label "skipnic:" a virDomainNetDefFree(net) is made; however, if
        in going back to the top of the loop we jump back down to skipnic for any
        reason, the call will attempt to free an already freed structure since
        "net" was not passed by reference to virDomainNetDefFree().  Just set
        net = NULL in skipnic: to resolve the issue.
      0454f23c
    • J
      parallels: Resolve Coverity USE_AFTER_FREE · 0da9a8a8
      John Ferlan 提交于
      Coverity complains that calling virNetworkDefFree(def), then jumping
      to the cleanup: label which calls virNetworkDefFree(def) could result
      in a double_free.  Just remove the call from the if statement.
      0da9a8a8