1. 18 5月, 2015 1 次提交
  2. 14 5月, 2015 1 次提交
    • L
      virsh: Report an error when cpulist parsing fails · 60107346
      Luyao Huang 提交于
      When parsing a cpulist, the virBitmapParse is used. On an invalid
      bitmap an error is reported, but the error gets cleared
      immediately by subsequent public APIs call, e.g. virDomainFree().
      Moreover, we don't check whether bitmap fits into maximal CPU ID
      on the host. Therefore the following examples failed without any
      error:
      
       # virsh vcpupin test3 1 aaa
      
       # virsh vcpupin test3 1 1000
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      60107346
  3. 12 5月, 2015 1 次提交
  4. 11 5月, 2015 1 次提交
    • P
      util: Make the virDomainListFree helper more universal · a5e89ae1
      Peter Krempa 提交于
      Extend it to a universal helper used for clearing lists of any objects.
      Note that the argument type is specifically void * to allow implicit
      typecasting.
      
      Additionally add a helper that works on non-NULL terminated arrays once
      we know the length.
      a5e89ae1
  5. 04 5月, 2015 3 次提交
  6. 28 4月, 2015 1 次提交
    • J
      virsh: Add iothreadadd and iothreaddel commands · 1f7e8112
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1161617
      
      Add command to allow adding and removing IOThreads from the domain including
      the configuration and live domain.
      
      $ virsh iothreadadd --help
        NAME
          iothreadadd - add an IOThread to the guest domain
      
        SYNOPSIS
          iothreadadd <domain> <id> [--config] [--live] [--current]
      
        DESCRIPTION
          Add an IOThread to the guest domain.
      
        OPTIONS
          [--domain] <string>  domain name, id or uuid
          [--id] <number>  iothread for the new IOThread
          --config         affect next boot
          --live           affect running domain
          --current        affect current domain
      
      $ virsh iothreaddel --help
        NAME
          iothreaddel - delete an IOThread from the guest domain
      
        SYNOPSIS
          iothreaddel <domain> <id> [--config] [--live] [--current]
      
        DESCRIPTION
          Delete an IOThread from the guest domain.
      
        OPTIONS
          [--domain] <string>  domain name, id or uuid
          [--id] <number>  iothread_id for the IOThread to delete
          --config         affect next boot
          --live           affect running domain
          --current        affect current domain
      
      Assuming a running $dom with multiple IOThreads assigned and that
      that the $dom has disks assigned to IOThread 1 and IOThread 2:
      
      $ virsh iothreadinfo $dom
       IOThread ID     CPU Affinity
       ---------------------------------------------------
        1               2
        2               3
        3               0-1
      
      $ virsh iothreadadd $dom 1
      error: invalid argument: an IOThread is already using iothread_id '1' in iothreadpids
      
      $ virsh iothreadadd $dom 1 --config
      error: invalid argument: an IOThread is already using iothread_id '1' in persistent iothreadids
      
      $ virsh iothreadadd $dom 4
      $ virsh iothreadinfo $dom
       IOThread ID     CPU Affinity
       ---------------------------------------------------
        1               2
        2               3
        3               0-1
        4               0-3
      
      $ virsh iothreadinfo $dom --config
       IOThread ID     CPU Affinity
       ---------------------------------------------------
        1               2
        2               3
        3               0-1
      
      $ virsh iothreadadd $dom 4 --config
      $ virsh iothreadinfo $dom --config
       IOThread ID     CPU Affinity
        ---------------------------------------------------
          1               2
          2               3
          3               0-1
          4               0-3
      
      Assuming the same original configuration
      
      $ virsh iothreaddel $dom 1
      error: invalid argument: cannot remove IOThread 1 since it is being used by disk 'vde'
      
      $ virsh iothreaddel $dom 3
      
      $ virsh iothreadinfo $dom
       IOThread ID     CPU Affinity
       ---------------------------------------------------
        1               2
        2               3
      
      $ virsh iothreadinfo $dom --config
       IOThread ID     CPU Affinity
       ---------------------------------------------------
        1               2
        2               3
        3               0-1
      1f7e8112
  7. 24 4月, 2015 1 次提交
    • J
      migration: Usable time statistics without requiring NTP · aa9f1395
      Jiri Denemark 提交于
      virDomainGetJobStats is able to report statistics of a completed
      migration, however to get usable downtime and total time statistics both
      hosts have to keep synchronized time. To provide at least some
      estimation of the times even when NTP daemons are not running on both
      hosts we can just ignore the time needed to transfer a migration cookie
      to the destination host. The result will be also inaccurate but a bit
      more predictable. The total/down time will just be at least what we
      report.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1213434
      aa9f1395
  8. 15 4月, 2015 2 次提交
    • J
      Add VIR_DOMAIN_EVENT_ID_DEVICE_ADDED event · 1882c0bd
      Ján Tomko 提交于
      The counterpart to VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1206114
      1882c0bd
    • E
      virsh: fix regression in 'virsh event' by domain · 31ef0836
      Eric Blake 提交于
      Commit a0670aef caused a regression in 'virsh event' and
      'virsh qemu-monitor-event' - if a user tries to filter the
      command to a specific domain, an error message is printed:
      
      $ virsh event dom --loop
      error: internal error: virsh qemu-monitor-event: no domain VSH_OT_DATA option
      
      and then the command continues as though no domain had been
      supplied (giving events for ALL domains, instead of the
      requested one).  This is because the code was incorrectly
      assuming that all "domain" options would be supplied via a
      mandatory VSH_OT_DATA, even though "domain" is optional for
      these two commands, so we had changed them to VSH_OT_STRING
      to quit failing for other reasons (ever since it was decided
      that VSH_OT_DATA and VSH_OT_STRING should no longer be
      synonyms).
      
      In looking at the situation, though, the code for looking up
      a domain was making a pointless check for whether the option
      exists prior to finding the option's string value, as
      vshCommandOptStringReq does just fine at reporting any errors
      when looking up a string whether or not the option was present.
      
      So this is a case of regression fixing by pure code deletion :)
      
      * tools/virsh-domain.c (vshCommandOptDomainBy): Drop useless filter.
      * tools/virsh-interface.c (vshCommandOptInterfaceBy): Likewise.
      * tools/virsh-network.c (vshCommandOptNetworkBy): Likewise.
      * tools/virsh-nwfilter.c (vshCommandOptNWFilterBy): Likewise.
      * tools/virsh-secret.c (vshCommandOptSecret): Likewise.
      * tools/virsh.h (vshCmdHasOption): Drop unused function.
      * tools/virsh.c (vshCmdHasOption): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      31ef0836
  9. 14 4月, 2015 1 次提交
  10. 13 4月, 2015 2 次提交
    • J
      Rewrite vshParseCPUList · ff6d2314
      Ján Tomko 提交于
      Use virBitmap helpers that were added after this function.
      
      Change cpumaplen to int and fill it out by this function.
      ff6d2314
    • J
      Rewrite vshPrintPinInfo · 4c4b821e
      Ján Tomko 提交于
      Use virBitmapDataToString instead of constructing the ranges bit
      by bit, remove the checking of parameters (that is already done
      by the callers).
      
      Let the callers choose the right bitmap, since there's only
      one that uses this helper on a matrix-in-an-array.
      4c4b821e
  11. 07 4月, 2015 1 次提交
  12. 03 4月, 2015 2 次提交
    • J
      6b55c18f
    • L
      virsh: Fix domifaddr output in quiet mode · 156fde0b
      Luyao Huang 提交于
      In virsh we have two printing functions: vshPrint() which prints a
      string onto stdout and vshPrintExtra() which does not print anything
      if virsh is run in quiet mode. Usually, the former is used to print
      actual results, while the latter to print strings like table headers
      and other formatting stuff. However, in cmdDomIfAddr we have
      mistakenly used vshPrintExtra even for actual data. After this patch,
      the output should look like the following:
      
        # virsh -q domifaddr test3 --source agent
        lo         00:00:00:00:00:00    ipv4         127.0.0.1/8
        -          -                    ipv6         ::1/128
        ens8       52:54:00:1a:cb:3f    ipv6         fe80::5054:ff:fe1a:cb3f/64
        virbr0     52:54:00:db:51:e7    ipv4         192.168.122.1/24
        virbr0-nic 52:54:00:db:51:e7    N/A          N/A
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      156fde0b
  13. 02 4月, 2015 6 次提交
  14. 30 3月, 2015 1 次提交
  15. 29 3月, 2015 1 次提交
    • E
      build: avoid variable named 'interface', for mingw · 75d56f51
      Eric Blake 提交于
      Commit 2f36e694 (re-)introduced a use of an identifier 'interface',
      which causes this build failure on mingw:
      
      ../../tools/virsh-domain-monitor.c: In function 'cmdDomIfAddr':
      ../../tools/virsh-domain-monitor.c:2233:17: error: expected identifier or '(' before 'struct'
           const char *interface = NULL;
                            ^
      
      See also commit 6512c8b4.  Sadly, I'm not quite sure how to write a
      syntax check that can poison the use of this identifier.
      
      * tools/virsh-domain-monitor.c (cmdDomIfAddr): Use ifacestr instead.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      75d56f51
  16. 26 3月, 2015 3 次提交
  17. 25 3月, 2015 1 次提交
  18. 23 3月, 2015 1 次提交
  19. 18 3月, 2015 6 次提交
    • J
      Use PAUSED state for domains that are starting up · 18441ab9
      Jiri Denemark 提交于
      When libvirt is starting a domain, it reports the state as SHUTOFF until
      it's RUNNING. This is not ideal because domain startup may take a long
      time (usually because of some configuration issues, firewalls blocking
      access to network disks, etc.) and domain lists provided by libvirt look
      awkward. One can see weird shutoff domains with IDs in a list of active
      domains or even shutoff transient domains. In any case, it looks more
      like a bug in libvirt than a normal state a domain goes through.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      18441ab9
    • M
      cmdDomIfAddr: Free @ip_addr_str · 0aff8fa8
      Michal Privoznik 提交于
      The variable holds formatted suffix to each line printed out
      (address type, address and prefix). However, the variable is
      never freed. At the same time, honour fact, that data held in
      the variable is not constant.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0aff8fa8
    • M
      virsh: Adapt to new HW address scenario · 50780207
      Michal Privoznik 提交于
      Make sure we don't print (null) (which in fact is printf()'s
      cleverness anyway, not ours). If no HW address is present, print
      "N/A" string just like we do for other fields.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      50780207
    • P
      virsh: domain: Fix the change-media command · f4b5f530
      Peter Krempa 提交于
      The command did not modify the disk type and thus didn't allow to change
      media from a file image to a block backed image or vice versa. In
      addition when operating on a network backed removable devices the
      command would replace the while <source> subelement with an invalid one.
      
      This patch adds the --block option that allows to specify that the new
      image is block backed and assumes that without that option all images
      are file backed. Since network backends were always mangled it should
      not cause problems.
      f4b5f530
    • P
      virsh: domain: Add --print-xml flag for command change-media · 4cbcaffb
      Peter Krempa 提交于
      Allow printing the XML that would be used mostly for debugging purposes.
      4cbcaffb
    • P
      virsh: domain: Don't use vshPrepareDiskXML for creating XML to detach disk · 1cc82093
      Peter Krempa 提交于
      Since cmdDetachDisk() calls into vshPrepareDiskXML() with
      type == VSH_PREPARE_DISK_XML_NONE && source == NULL this would result
      into skipping all the checks and effectively turn the function into a
      XML formatter.
      
      This patch changes the code to use the formatter directly so that the
      function can be refactored in a easier way.
      1cc82093
  20. 17 3月, 2015 3 次提交
    • N
      domifaddr: Add virsh support · 2f36e694
      Nehal J Wani 提交于
      tools/virsh-domain-monitor.c
         * Introduce new command : domifaddr
           Usage: domifaddr <domain> [interface] [--full] [--source lease|agent]
      
           Example outputs:
           virsh # domifaddr f20
           Name       MAC address          Protocol     Address
           -------------------------------------------------------------------------------
           lo         00:00:00:00:00:00    ipv4         127.0.0.1/8
           -          -                    ipv6         ::1/128
           vnet0      52:54:00:2e:45:ce    ipv4         10.1.33.188/24
           -          -                    ipv6         2001:db8:0:f101::2/64
           -          -                    ipv6         fe80::5054:ff:fe2e:45ce/64
           vnet1      52:54:00:b1:70:19    ipv4         192.168.105.201/16
           -          -                    ipv4         192.168.201.195/16
           -          -                    ipv6         fe80::5054:ff:feb1:7019/64
           vnet2      52:54:00:36:2a:e5    N/A          N/A
           vnet3      52:54:00:20:70:3d    ipv4         192.168.105.240/16
           -          -                    ipv6         fe80::5054:ff:fe20:703d/64
      
           virsh # domifaddr f20 eth1 --source lease
           Name       MAC address          Protocol     Address
           -------------------------------------------------------------------------------
           vnet1      52:54:00:b1:70:19    ipv4         192.168.105.201/16
           -          -                    ipv4         192.168.201.195/16
           -          -                    ipv6         fe80::5054:ff:feb1:7019/64
      
           virsh # domifaddr f20 eth0 --source agent --full
           Name       MAC address          Protocol     Address
           -------------------------------------------------------------------------------
           eth0       52:54:00:2e:45:ce    ipv4         10.1.33.188/24
           eth0       52:54:00:2e:45:ce    ipv6         2001:db8:0:f101::2/64
           eth0       52:54:00:2e:45:ce    ipv6         fe80::5054:ff:fe2e:45ce/64
      
      tools/virsh.pod
         * Document new command
      Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
      2f36e694
    • P
      wireshark: fix VPATH build · 57f726a5
      Pavel Hrdina 提交于
      Add $(top_builddir) paths to INCLUDES to fix VPATH build.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      57f726a5
    • P
      rpm-build: use pkg-config to detect wireshark presence · 37397320
      Pavel Hrdina 提交于
      Wireshark supports pkg-config since 1.11.3.  Right now we build
      wireshark-dissectior tool as default trough rpm build only on
      fedora >= 21 and there is new wireshark that supports pkg-config.
      If someone wants to build libvirt with wireshark-dissector against old
      wireshark, they should specify the location by hand.
      
      This patch is mainly to fix wrong dependency on wireshark binary as it
      doesn't make sense to require that binary file to just get version info
      of that package in makefile.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      37397320
  21. 15 3月, 2015 1 次提交
    • E
      virsh: fix report of non-active commit completion · ceec58ac
      Eric Blake 提交于
      Commit f182da20 (v1.2.6) caused a slight regression in virsh
      reporting of a non-active block job; where it used to state
      "Commit complete", it now states "Now in synchronized phase".
      But the synchronized phase is only possible for an active commit.
      
      For a reproducer, I created a chain 'a <- b <- c <- d <- e' and
      ran virsh blockcommit $dom vda --top c --base a --verbose --wait
      
      * tools/virsh-domain.c (cmdBlockCommit): Synchronized phase is
      only possible on active commits.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ceec58ac