1. 11 9月, 2014 18 次提交
    • J
      nodeinfo: Resolve Coverity NEGATIVE_RETURNS · 34476d72
      John Ferlan 提交于
      If the virNumaGetNodeCPUs() call fails with -1, then jumping to cleanup
      with 'cpus == NULL' and calling virCapabilitiesClearHostNUMACellCPUTopology
      will cause issues.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      34476d72
    • J
      qemu: Resolve Coverity NEGATIVE_RETURNS · 35a50ea8
      John Ferlan 提交于
      In qemuProcessInitPCIAddresses() if qemuMonitorGetAllPCIAddresses()
      returns a negative (or zero) value, then no need to call the
      qemuProcessDetectPCIAddresses().
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      35a50ea8
    • J
      network_conf: Resolve Coverity FORWARD_NULL · 8ffab101
      John Ferlan 提交于
      The code compares def->forwarders when deciding to return 0 at a
      couple of points, then uses "def->nfwds" as a way to index into
      the def->forwarders array.  That reference results in Coverity
      complaining that def->forwarders being NULL was checked as part
      of an arithmetic OR operation where failure could be any one 5
      conditions, but that is not checked when entering the loop to
      dereference the array.  Changing the comparisons to use nfwds
      will clear the warnings
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      8ffab101
    • J
      qemu: Resolve Coverity FORWARD_NULL · e5baef83
      John Ferlan 提交于
      If the qemuMigrationEatCookie() fails to set mig, we jump to cleanup:
      which will call qemuMigrationCancelDriveMirror() without first checking
      if mig == NULL
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      e5baef83
    • J
      virstring: Resolve Coverity FORWARD_NULL · 114ebecd
      John Ferlan 提交于
      Perhaps a false positive, but since Coverity doesn't understand the
      relationship between the 'count' and the 'strings', rather than leave
      the chance the on input 'strings' is NULL and causes a deref - just
      check for it and return
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      114ebecd
    • J
      network: Resolve Coverity FORWARD_NULL · d3f0708e
      John Ferlan 提交于
      If the VIR_STRDUP(exptime,...) fails, then we will jump to cleanup,
      no need to check if exptime is set which causes Coverity to issue
      a complaint in the virStrToLong_ll call because there wasn't a check
      for a NULL value while there was one for the reference right after
      the VIR_STRDUP().
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      d3f0708e
    • J
      qemu: Resolve Coverity FORWARD_NULL · f28a31fc
      John Ferlan 提交于
      If we jump to cleanup before allocating the 'result', then the call
      to virBlkioDeviceArrayClear will deref result causing a problem.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f28a31fc
    • J
      lxc: Resolve Coverity FORWARD_NULL · 0311be94
      John Ferlan 提交于
      If we jump to cleanup before allocating 'result', then the call to
      virBlkioDeviceArrayClear() could dereference result
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      0311be94
    • J
      qemu: Resolve Coverity FORWARD_NULL · bf15f10a
      John Ferlan 提交于
      If the virJSONValueNewObject() fails, then rather than going to error
      and getting a Coverity false positive since it doesn't seem to understand
      the relationship between nkeywords, keywords, and values and seems to
      believe calling qemuFreeKeywords will cause a NULL deref - just return NULL
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      bf15f10a
    • J
      qemu: Resolve Coverity DEADCODE · 2676903f
      John Ferlan 提交于
      Add another 'dead_code_begin' - victims of our own coding practices
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      2676903f
    • J
      virfile: Resolve Coverity DEADCODE · 6825bdad
      John Ferlan 提交于
      Adjust the parentheses in/for the waitpid loops; otherwise, Coverity
      points out:
      
      (1) Event assignment:   Assigning: "waitret" = "waitpid(pid, &status, 0) == -1"
      (2) Event between:      At condition "waitret == -1", the value of "waitret"
                              must be between 0 and 1.
      (3) Event dead_error_condition:     The condition "waitret == -1" cannot
                              be true.
      (4) Event dead_error_begin:     Execution cannot reach this statement:
                              "ret = -*__errno_location();".
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      6825bdad
    • J
      storage: Resolve Coverity OVERFLOW_BEFORE_WIDEN · f832aa32
      John Ferlan 提交于
      Coverity complains that when multiplying to 32 bit values that eventually
      will be stored in a 64 bit value that it's possible the math could
      overflow unless one of the values being multiplied is type cast to
      the proper size.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f832aa32
    • J
      qemu: Resolve Coverity REVERSE_INULL · 9f845b11
      John Ferlan 提交于
      Coverity complains that checking for !domlist after setting doms = domlist
      and making a deref of doms just above
      
      It seems the call in question was intended to me made in the case that
      'doms' was passed in and not when the virDomainObjListExport() call
      allocated domlist and already called virConnectGetAllDomainStatsCheckACL().
      
      Thus rather than check for !domlist - check that "doms != domlist" in
      order to avoid the Coverity message.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      9f845b11
    • J
      vbox: Resolve Coverity UNUSED_VALUE · abddeb84
      John Ferlan 提交于
      Handle a few places where Coverity complains about the value being
      unused. For two of them (Close cases) - the comments above the close
      indicate there is no harm to ignore the error - so added an ignore_value.
      For the other condition, added an rc check like other callers.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      abddeb84
    • J
      storage: Resolve Coverity UNUSED_VALUE · 8ea809df
      John Ferlan 提交于
      Since cd4d5475
      
      Coverity notes that setting 'ret = -3' prior to the unconditional
      setting of 'ret = 0' will cause the value to be UNUSED.
      
      Since the comment indicates that it is expect to allow the code
      to continue, just remove the ret = -3 setting.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      8ea809df
    • J
      qemu_driver: Resolve Coverity COPY_PASTE_ERROR · f72f0642
      John Ferlan 提交于
      In qemuDomainSetBlkioParameters(), Coverity points out that the calls
      to qemuDomainParseBlkioDeviceStr() are slightly different and points
      out there may be a cut-n-paste error.
      
      In the first call (AFFECT_LIVE), the second parameter is "param->field";
      however, for the second call (AFFECT_CONFIG), the second parameter is
      "params->field".  It seems the "param->field" is correct especially since
      each path as a setting of "param" to "&params[i]".  Furthermore, there
      were a few more instances of using "params[i]" instead of "param->"
      which I cleaned up.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f72f0642
    • M
      selinux: Properly check TAP FD label · b635b7a1
      Michal Privoznik 提交于
      After a4431931 the TAP FDs ale labeled with image label instead
      of the process label. On the other hand, the commit was
      incomplete as a few lines above, there's still old check for the
      process label presence while it should be check for the image
      label instead.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b635b7a1
    • J
      qemu: remove leftover virResetLastError · 6c555027
      Ján Tomko 提交于
      As of commit 5d29ca06:
      qemu: switch PCI address set from hash table to an array
      
      There is no error to be reset.
      6c555027
  2. 10 9月, 2014 15 次提交
  3. 09 9月, 2014 2 次提交
    • M
    • E
      blockcopy: add a way to parse disk source · 37588b25
      Eric Blake 提交于
      The new blockcopy API wants to reuse only a subset of the disk
      hotplug parser - namely, we only care about the embedded
      virStorageSourcePtr inside a <disk> XML.  Strange as it may
      seem, it was easier to just parse an entire disk definition,
      then throw away everything but the embedded source, than it
      was to disentangle the source parsing code from the rest of
      the overall disk parsing function.  All that I needed was a
      couple of tweaks and a new internal flag that determines
      whether the normally-mandatory target element can be
      gracefully skipped, since everything else was already optional.
      
      * src/conf/domain_conf.h (virDomainDiskSourceParse): New
      prototype.
      * src/conf/domain_conf.c (VIR_DOMAIN_XML_INTERNAL_DISK_SOURCE):
      New flag.
      (virDomainDiskDefParseXML): Honor flag to make target optional.
      (virDomainDiskSourceParse): New function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      37588b25
  4. 08 9月, 2014 5 次提交