1. 21 3月, 2016 1 次提交
    • J
      Add event and state details for post-copy · 5a9cbc62
      Jiri Denemark 提交于
      VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY and VIR_DOMAIN_PAUSED_POSTCOPY are
      used on the source host once migration enters post-copy mode (which
      means the domain gets paused on the source. After the destination host
      takes over the execution of the domain, its virtual CPUs are resumed and
      the domain enters VIR_DOMAIN_RUNNING_POSTCOPY state and
      VIR_DOMAIN_EVENT_RESUMED_POSTCOPY event is emitted.
      
      In case migration fails during post-copy mode and none of the hosts have
      complete state of the domain, both domains will remain paused with
      VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason and an upper layer may decide
      what to do.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      5a9cbc62
  2. 21 1月, 2016 1 次提交
    • M
      virsh: Don't fetch status for all domains in cmdList · 3bd2ee5d
      Michal Privoznik 提交于
      We are getting the list of domains and after that we iterate over
      the list and try to get status for each domain hoping it will
      skip over domains that disappeared meanwhile. However, this
      solution to race is bogus - domain may disappear right after we
      have checked its state and before we exec another API over it
      (e.g. virDomainHasManagedSaveImage()). Also, when printing just
      names or uuids (list --name / --uuid) we issue APIs to obtain the
      values, however these require no RPC call as all requested info
      is in virDomain object that client already has.
      Therefore move the status obtaining only to the place that really
      needs it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3bd2ee5d
  3. 12 1月, 2016 4 次提交
    • J
      virsh: Create macro for common "current" option · 5b42dbed
      John Ferlan 提交于
      Rather than continually cut-n-paste the strings into each command,
      create a common macro to be used generically. The macro will take a
      single argument _helpstr which for many options in virsh-domain.c
      is simply "affect current domain". So, create a second macro within that
      file in order to define the more common use as a revector to the
      common macro with the common _helpstr.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5b42dbed
    • J
      virsh: Create macro for common "live" option · 8e4108f0
      John Ferlan 提交于
      Rather than continually cut-n-paste the strings into each command,
      create a common macro to be used generically. The macro will take a
      single argument _helpstr which for many options in virsh-domain.c
      is simply "affect running domain". So, create a second macro within that
      file in order to define the more common use as a revector to the
      common macro with the common _helpstr.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      8e4108f0
    • J
      virsh: Create macro for common "config" option · 0dbac60b
      John Ferlan 提交于
      Rather than continually cut-n-paste the strings into each command,
      create a common macro to be used generically. The macro will take a
      single argument _helpstr which for many options in virsh-domain.c
      is simply "affect next boot". So, create a second macro within that
      file in order to define the more common use as a revector to the
      common macro with the common _helpstr.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      0dbac60b
    • J
      virsh: Create macro for common "domain" option · b6fb1e24
      John Ferlan 提交于
      Rather than continually cut-n-paste the strings into each command,
      create a common macro to be used generically. The macro will take a
      single argument _helpstr which will be used to pass the translatable
      helpstr since not all domain options can take the same string.
      
      The majority of the options take 'N_("domain name, id or uuid")', so
      create a separate macro with a _FULL suffix while those that do not
      take the same string will use the VIRSH_COMMON_OPT_DOMAIN macro.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      b6fb1e24
  4. 03 12月, 2015 1 次提交
  5. 30 11月, 2015 2 次提交
  6. 07 9月, 2015 1 次提交
  7. 14 8月, 2015 1 次提交
    • 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
  8. 02 6月, 2015 2 次提交
  9. 18 5月, 2015 2 次提交
  10. 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
  11. 03 4月, 2015 1 次提交
    • 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
  12. 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
  13. 18 3月, 2015 3 次提交
    • 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
  14. 17 3月, 2015 1 次提交
    • 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
  15. 04 3月, 2015 2 次提交
  16. 03 3月, 2015 1 次提交
    • J
      virsh: Adjust domblklist to understand disk volume syntax · 09aec2a4
      John Ferlan 提交于
      A disk using a source pool is listed as having a source '-' in domblklist
      because it doesn't check the right XML syntax to find the source.
      
      Add a check for "./source/volume" which is where the "path" (of sorts)
      to the volume name is described.
      09aec2a4
  17. 12 1月, 2015 1 次提交
  18. 17 12月, 2014 1 次提交
    • E
      getstats: add new flag for block backing chain · 4bffafb2
      Eric Blake 提交于
      This patch introduces access to allocation information about
      a backing chain of a live domain.  While querying storage
      volumes for read-only disks could provide some of the details,
      we do NOT want to read() a file while qemu is writing it.
      Also, there is one case where we have to rely on qemu: when
      doing a block commit into a backing file, where that file is
      stored in qcow2 format on a host block device, we want to know
      the current highest write offset into that image, in order to
      know if the disk must be resized larger.  qemu-img does not
      (currently) show this information, and none of the earlier
      block APIs were extensible enough to expose it.  But
      virDomainListGetStats is perfect for the job!
      
      We don't need a new group of statistics, as the existing block
      group is sufficient.  On the other hand, as existing libvirt
      releases already report 1:1 mapping of block.count to <disk>
      devices, changing the array size could confuse older clients;
      and even with newer clients, the time and memory taken to
      report additional statistics is not always necessary (backing
      files are generally read-only except for block-commit, so while
      read statistics may change, sizing statistics will not).  So
      the choice here is to add a new flag that only newer callers
      will pass, when they are prepared for the additional information.
      
      This patch introduces the new API, but it will take more
      patches to get it implemented for qemu.
      
      * include/libvirt/libvirt-domain.h
      (VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING): New flag.
      * src/libvirt-domain.c (virConnectGetAllDomainStats): Document it,
      and add a new field when it is in use.
      * tools/virsh-domain-monitor.c (cmdDomstats): Use new flag.
      * tools/virsh.pod (domstats): Document it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4bffafb2
  19. 19 11月, 2014 1 次提交
    • E
      maint: forbid 'int foo = true' · eb909376
      Eric Blake 提交于
      I noticed this while working on qemuDomainGetBlockInfo.  Assigning
      a bool value to an int variable compiles fine, but raises red flags
      on the maintenance front as it becomes too easy to assign -1 or 2
      or any other non-bool value to the same variable.
      
      * cfg.mk (sc_prohibit_int_assign_bool): New rule.
      * src/conf/snapshot_conf.c (virDomainSnapshotRedefinePrep): Fix
      offenders.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
      (qemuDomainSnapshotCreateXML): Likewise.
      * src/test/test_driver.c (testDomainSnapshotAlignDisks):
      Likewise.
      * src/util/vircgroup.c (virCgroupSupportsCpuBW): Likewise.
      * src/util/virpci.c (virPCIDeviceBindToStub): Likewise.
      * src/util/virutil.c (virIsCapableVport): Likewise.
      * tools/virsh-domain-monitor.c (cmdDomMemStat): Likewise.
      * tools/virsh-domain.c (cmdBlockResize, cmdScreenshot)
      (cmdInjectNMI, cmdSendKey, cmdSendProcessSignal)
      (cmdDetachInterface): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eb909376
  20. 03 11月, 2014 1 次提交
    • M
      virsh: don't list unknown domains · 1eb53f05
      Martin Kletzander 提交于
      When the list of domains is fetched and being printed, but in the
      meantime one domain was undefined before its status was fetched, the
      output then includes domain with "no state".  With this patch, such
      domain is skipped over as consecutive 'virsh list --all' (or the same
      one ran a second later) wouldn't list it anyway.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      1eb53f05
  21. 18 9月, 2014 4 次提交
  22. 28 8月, 2014 1 次提交
  23. 20 5月, 2014 1 次提交
  24. 15 5月, 2014 1 次提交
  25. 27 3月, 2014 1 次提交
  26. 25 3月, 2014 1 次提交
  27. 18 3月, 2014 1 次提交
  28. 28 2月, 2014 1 次提交