1. 03 9月, 2015 1 次提交
    • M
      vshInit: Don't leak @histsize_env · 4fdd873f
      Michal Privoznik 提交于
      Caller is responsible for freeing the result of virStringJoin()
      when no longer needed:
      
      ==10701== 1 bytes in 1 blocks are definitely lost in loss record 1 of 806
      ==10701==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==10701==    by 0xAADB679: strdup (in /lib64/libc-2.20.so)
      ==10701==    by 0x4F18655: virStrdup (virstring.c:726)
      ==10701==    by 0x4F175AF: virStringJoin (virstring.c:165)
      ==10701==    by 0x131D4D: vshReadlineInit (vsh.c:2572)
      ==10701==    by 0x1322DF: vshInit (vsh.c:2736)
      ==10701==    by 0x1347C1: main (virsh.c:907)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4fdd873f
  2. 02 9月, 2015 1 次提交
    • J
      qemu: add udp interface support · 5c668a78
      Jonathan Toppins 提交于
      Adds a new interface type using UDP sockets, this seems only applicable
      to QEMU but have edited tree-wide to support the new interface type.
      
      The interface type required the addition of a "localaddr" (local
      address), this then maps into the following xml and qemu call.
      
      <interface type='udp'>
        <mac address='52:54:00:5c:67:56'/>
        <source address='127.0.0.1' port='11112'>
          <local address='127.0.0.1' port='22222'/>
        </source>
        <model type='virtio'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </interface>
      
      QEMU call:
      	-net socket,udp=127.0.0.1:11112,localaddr=127.0.0.1:22222
      
      Notice the xml "local" entry becomes the "localaddr" for the qemu call.
      
      reference:
      http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.htmlSigned-off-by: NJonathan Toppins <jtoppins@cumulusnetworks.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5c668a78
  3. 18 8月, 2015 2 次提交
  4. 15 8月, 2015 1 次提交
  5. 14 8月, 2015 3 次提交
    • E
      tools: Introduce new client generic module vsh · 834c5720
      Erik Skultety 提交于
      In order to share as much virsh' logic as possible with upcomming
      virt-admin client we need to split virsh logic into virsh specific and
      client generic features.
      
      Since majority of virsh methods should be generic enough to be used by
      other clients, it's much easier to rename virsh specific data to virshX
      than doing this vice versa. It moved generic virsh commands (including info
      and opts structures) to generic module vsh.c.
      
      Besides renaming methods and structures, this patch also involves introduction
      of a client specific control structure being referenced as private data in the
      original control structure, introduction of a new global vsh Initializer,
      which currently doesn't do much, but there is a potential for added
      functionality in the future.
      Lastly it introduced client hooks which are especially necessary during
      client connecting phase.
      834c5720
    • T
      Introduce new VIR_DOMAIN_EVENT_DEFINED_RENAMED event · 9877d840
      Tomas Meszaros 提交于
      This should be emitted whenever a domain is renamed.
      Signed-off-by: NTomas Meszaros <exo@tty.sk>
      9877d840
    • T
      virsh: Implement "domrename" command · ff486e0d
      Tomas Meszaros 提交于
      This patch implements new virsh command, domrename.
      
      Using domrename, it will be possible to rename domain from the virsh shell by
      calling virRenameDomain API.
      
      It takes two arguments, current domain name and new domain name.
      
      Example:
      
      virsh # list --all
       Id    Name                           State
       ----------------------------------------------------
        -     bar                            shut off
      
      virsh # domrename bar foo
      Domain successfully renamed
      
      virsh # list --all
       Id    Name                           State
       ----------------------------------------------------
        -     foo                            shut off
      
      virsh #
      Signed-off-by: NTomas Meszaros <exo@tty.sk>
      ff486e0d
  6. 12 8月, 2015 2 次提交
    • M
      cmdAttachInterface: Fully implement @floor support · 68b2405c
      Michal Privoznik 提交于
      In my previous commit d7f5c889 I tried to introduce support
      for inbound.floor. But the code change was incomplete. This is
      the change needed to fully enable the feature.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      68b2405c
    • P
      virsh: Refactor parseRateStr to avoid false-positive uninitialized variable · 73ca6f98
      Peter Krempa 提交于
      Commit 6983d6d2 tried to improve parseRateStr but broke the build
      instead for compilers that were not able to properly introspect the for
      loop indexed by the enum resulting into the following error:
      
      virsh-domain.c: In function 'parseRateStr':
      virsh-domain.c:916:13: error: 'field_name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                   vshError(ctl, _("malformed %s field"), field_name);
                   ^
      virsh-domain.c:915:13: error: 'tmp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
               if (virStrToLong_ullp(token, NULL, 10, tmp) < 0) {
                   ^
      Rather than trying to fix the code, refactor the function again by
      reusing virStringSplit.
      73ca6f98
  7. 11 8月, 2015 2 次提交
    • M
      virsh: Implement VIR_DOMAIN_BANDWIDTH_IN_FLOOR · d7f5c889
      Michal Privoznik 提交于
      We have a function parseRateStr() that parses --inbound and
      --outbound arguments to both attach-interface and domiftune.
      Now that we have all virTypedParams macros needed for QoS,
      lets parse even floor attribute. The extended format for the
      arguments looks like this then:
      
        --inbound average[,peak[,burst[,floor]]]
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      d7f5c889
    • M
      virsh: Rework parseRateStr · 6983d6d2
      Michal Privoznik 提交于
      The function is used to parse a tuple delimited by commas into
      virNetDevBandwidth structure. So far only three out of fore
      fields are supported: average, peak and burst. The single missing
      field is floor. Well, the parsing works, but I think we can do
      better. Especially when we will need to parse floor too in very
      close future.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6983d6d2
  8. 05 8月, 2015 1 次提交
  9. 21 7月, 2015 12 次提交
  10. 16 7月, 2015 1 次提交
  11. 15 7月, 2015 2 次提交
    • M
      virsh: Teach cmdFreepages to work with lxc driver · f69ece07
      Michal Privoznik 提交于
      Some drivers don't expose available huge page sizes in the
      capabilities XML. For instance, LXC driver is one of those.
      This has a downside that when virsh is trying to get
      aggregated info on free pages per all NUMA nodes, it fails.
      The problem is that the virNodeGetFreePages() API expects
      caller to pass an array of page sizes he is interested in.
      In virsh, this array is filled from the capabilities from
      '/capabilities/host/cpu/pages' XPath. As said, in LXC
      there's no such XPath and therefore virsh fails currently.
      But hey, we can fallback: the page sizes are exposed under
      '/capabilities/host/topology/cells/cell/pages'. The page
      size can be collected from there, and voilà the command
      works again. But now we must make sure that there are no
      duplicates in the array passed to the public API. Otherwise
      we won't get as beautiful output as we are getting now.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f69ece07
    • M
      cmdVcpuPin: Remove dead code · 416d0e94
      Michal Privoznik 提交于
      There's this condition:
      
      flags & VIR_DOMAIN_AFFECT_CURRENT && virDomainIsActive(dom)
      
      which can never be true since VIR_DOMAIN_AFFECT_CURRENT has hardcoded
      value of zero. Therefore virDomainIsActive() is a dead code. However,
      the condition could make sense if it is rewritten as the following:
      
      !(flags & VIR_DOMAIN_AFFECT_CONFIG) && virDomainIsActive(dom)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      416d0e94
  12. 02 7月, 2015 1 次提交
    • L
      virsh: report error if vcpu number exceed the guest maxvcpu number · 848ab685
      Luyao Huang 提交于
      Commit id '81dd81e4' caused a regression when attempting to print a
      specific vcpuid that is out of the range of the maximum vcpus for
      the guest, such as:
      
       $ virsh vcpupin $dom 1000
       VCPU: CPU Affinity
       ----------------------------------
      
       $
      
      Rather than just recover the old message, let's adjust the message based
      on what would be displayed for a similar failure in the set path, such as:
      
       $ virsh vcpupin $dom 1000
       error: vcpu 1000 is out of range of persistent cpu count 2
      
       $ virsh vcpupin $dom 1000 --live
       error: vcpu 1000 is out of range of live cpu count 2
      
       $
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      848ab685
  13. 24 6月, 2015 1 次提交
  14. 23 6月, 2015 3 次提交
  15. 22 6月, 2015 1 次提交
    • P
      virsh: blockcopy: Report error if the copy job fails · e7d3ff84
      Peter Krempa 提交于
      When the block job would fail while watching it using the "--wait"
      option for blockcopy, virsh would rather unhelpfully report:
      
      $ virsh blockcopy vm hdc /tmp/raw.img --granularity 4096 --verbose --wait
      
      Now in mirroring phase
      
      Add a special case when the block job vanishes while waiting for it to
      finish to improve the message:
      
      $ virsh blockcopy vm hdc /tmp/raw.img --granularity 8192 --verbose --wait
      error: Block Copy unexpectedly failed
      e7d3ff84
  16. 18 6月, 2015 1 次提交
  17. 16 6月, 2015 2 次提交
  18. 15 6月, 2015 1 次提交
  19. 12 6月, 2015 2 次提交