1. 11 9月, 2014 7 次提交
    • 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 19 次提交
  3. 09 9月, 2014 3 次提交
    • E
      virsh: additional scaled output units · 2ad38fdb
      Eric Blake 提交于
      The parser accepts P and E, so the formatter should too.
      
      * tools/virsh.c (vshPrettyCapacity): Handle larger units.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2ad38fdb
    • 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 8 次提交
  5. 07 9月, 2014 3 次提交
    • S
      selinux: Avoid label reservations for type = none · a48362cd
      Shivaprasad G Bhat 提交于
      For security type='none' libvirt according to the docs should not
      generate seclabel be it for selinux or any model. So, skip the
      reservation of labels when type is none.
      Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
      a48362cd
    • E
      blockcopy: remote implementation for new API · 1069e3b9
      Eric Blake 提交于
      Fairly straightforward - I got lucky that the generated functions
      worked out of the box :)
      
      * src/remote/remote_protocol.x (remote_domain_block_copy_args):
      New struct.
      (REMOTE_PROC_DOMAIN_BLOCK_COPY): New RPC.
      * src/remote/remote_driver.c (remote_driver): Wire it up.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1069e3b9
    • E
      blockcopy: expose new API in virsh · c1d75dee
      Eric Blake 提交于
      Expose the new power of virDomainBlockCopy through virsh (well,
      all but the finer-grained bandwidth, as that is its own can of
      worms for a later patch).  Continue to use the older API where
      possible, for maximum compatibility.
      
      The command now requires either --dest (with optional --format
      and --blockdev), to directly describe the file destination, or
      --xml, to name a file that contains an XML description such as:
      
      <disk type='network'>
        <driver type='raw'/>
        <source protocol='gluster' name='vol1/img'>
          <host name='red'/>
        </source>
      </disk>
      
      [well, it may be a while before the qemu driver is actually patched
      to act on that particular xml beyond just parsing it, but the virsh
      interface won't need changing at that time]
      
      Non-zero option parameters are converted into virTypedParameters,
      and if anything requires the new API, the command can synthesize
      appropriate XML even if the --dest option was used instead of --xml.
      
      The existing --raw flag remains for back-compat, but the preferred
      spelling is now --format=raw, since the new API now allows us
      to specify all formats rather than just a boolean raw to suppress
      probing.
      
      I hope I did justice in describing the effects of granularity and
      buf-size on how they get passed through to qemu.
      
      * tools/virsh-domain.c (cmdBlockCopy): Add new options --xml,
      --granularity, --buf-size, --format. Make --raw an alias for
      --format=raw. Call new API if new parameters are in use.
      * tools/virsh.pod (blockcopy): Document new options.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c1d75dee