1. 03 9月, 2019 1 次提交
  2. 29 8月, 2019 2 次提交
  3. 28 8月, 2019 1 次提交
  4. 29 7月, 2019 1 次提交
  5. 27 7月, 2019 1 次提交
    • E
      backup: Implement virsh support for checkpoints · 689beaa4
      Eric Blake 提交于
      Introduce a bunch of new virsh commands for managing checkpoints in
      isolation. More commands are needed for performing incremental
      backups, but these commands were easy to implement by modeling heavily
      after virsh-snapshot.c. There is no need for checkpoint-revert or
      checkpoint-current since those snapshot APIs have no checkpoint
      counterpart.  Similarly, it is not necessary to change which
      checkpoint is current when redefining from XML, since until we
      integrate checkpoints with snapshots, there is only a linear chain
      (and you can deduce the current checkpoint by instead using
      'checkpoint-list --leaves').  Other aspects of checkpoint-list are
      also a bit simpler than the snapshot counterpart, in part because we
      don't have to cater to back-compat to older API.
      
      Upcoming patches will test these interfaces once the test driver
      supports checkpoints.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      689beaa4
  6. 13 7月, 2019 2 次提交
  7. 11 7月, 2019 1 次提交
    • E
      snapshot: Add VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE flag · 95f8e323
      Eric Blake 提交于
      We've been doing a terrible job of performing XML validation in our
      various API that parse XML with a corresponding schema (we started
      with domains back in commit dd69a14f, v1.2.12, but didn't catch all
      domain-related APIs, didn't document the use of the flag, and didn't
      cover other XML). New APIs (like checkpoints) should do the validation
      unconditionally, but it doesn't hurt to continue retrofitting existing
      APIs to at least allow the option.
      
      While there are many APIs that could be improved, this patch focuses
      on wiring up a new snapshot XML creation flag through all the
      hypervisors that support snapshots, as well as exposing it in 'virsh
      snapshot-create'.  For 'virsh snapshot-create-as', we blindly set the
      flag without a command-line option, since the XML we create from the
      command line should generally always comply (note that validation
      might cause failures where it used to succeed, such as if we tighten
      the RNG to reject a name of '../\n'); but blindly passing the flag
      means we also have to add in fallback code to disable validation if
      the server is too old to understand the flag.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      95f8e323
  8. 09 7月, 2019 1 次提交
    • L
      virsh: support block device storage type in virshParseSnapshotDiskspec · 7ca81e6f
      Liu Dayu 提交于
      virsh snapshot-create-as supports 'file' storage type in --diskspec by default.
      But it doesn't support 'block' storage type in the virshParseSnapshotDiskspec().
      So if a snapshot on a block device (e.g. LV) was created, the type of
      current running storage source in dumpxml is inconsistent with the actual
      backend storage source. It will check file-system type mismatch failed
      and return an error message of 'Migration without shared storage is unsafe'
      when VM performs a live migration after this snapshot.
      
      Considering virsh has to be able to work remotely that recognizing a block device
      by prefix /dev/ or by stat() may be not suitable, so adding a "stype" field
      for the --diskspec string which will be either "file" or "block".
      e.g. --diskspec vda,snapshot=external,driver=qcow2,stype=block,file=/dev/xxx.
      Signed-off-by: NLiu Dayu <liu.dayu@zte.com.cn>
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      7ca81e6f
  9. 20 6月, 2019 1 次提交
  10. 06 6月, 2019 2 次提交
  11. 20 5月, 2019 1 次提交
    • H
      qemu: Add entry for balloon stats stat-htlb-pgalloc and stat-htlb-pgfail · a699b19f
      Han Han 提交于
      Qemu added reporting of virtio balloon new statistics stat-htlb-pgalloc and
      stat-htlb-pgfail since qemu-3.0 commit b7b12644297. The value of
      stat-htlb-pgalloc represents the number of successful hugetlb page allocations
      while stat-htlb-pgfail represents the number of failed ones. Add this
      statistics reporting to libvirt.
      
      To enable this feature for vm, guest kenel >= 4.17 is required because
      the exporting hugetlb page allocation for virtio balloon is introduced
      since 6c64fe7f.
      Signed-off-by: NHan Han <hhan@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a699b19f
  12. 30 4月, 2019 1 次提交
  13. 16 4月, 2019 1 次提交
  14. 15 4月, 2019 2 次提交
  15. 04 4月, 2019 1 次提交
  16. 30 3月, 2019 1 次提交
  17. 27 3月, 2019 1 次提交
  18. 25 3月, 2019 3 次提交
    • E
      virsh: Add 'echo --err' option · 2efb42e9
      Eric Blake 提交于
      Since test:///default resets state on every connection, writing a test
      that covers a sequence of commands must be done from a single
      session. But if the test wants to exercise particular failure modes as
      well as successes, it can be nice to leave witnesses in the stderr
      stream immediately before and after the spot where the expected error
      should be, to ensure the rest of the script is not causing errors.
      
      Do this by adding an --err option.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NMichal Privoznik <mprivozn@redhat.com>
      2efb42e9
    • E
      virsh: Treat any command name starting with # as comment · 4e650259
      Eric Blake 提交于
      As the previous commit mentioned, argv mode (such as when you feed
      virsh via stdin with <<\EOF instead of via a single shell argument)
      didn't permit comments. Do this by treating any command name token
      that starts with # as a comment which silently eats all remaining
      arguments to the next newline or semicolon.
      
      Note that batch mode recognizes unquoted # at the start of any word as
      a command as part of the tokenizer, while this patch only treats # at
      the start of the command word as a comment (any other # remaining by
      the time vshCommandParse() is processing things was already quoted
      during the tokenzier, and as such was probably intended as the actual
      argument to the command word earlier in the line).
      
      Now I can do something like:
      
      $ virsh -c test:///default <<EOF
        # setup
        snapshot-create-as test s1
        snapshot-create-as test s2
        # check
        snapshot-list test --name
      EOF
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NMichal Privoznik <mprivozn@redhat.com>
      4e650259
    • E
      virsh: Parse # comments in batch mode · 834f64ca
      Eric Blake 提交于
      Continuing from what I did in commit 4817dec0, now I want to write a
      sequence that is self-documenting.  So I need comments :)
      
      Now I can do something like:
      
      $ virsh -c test:///default '
        # setup
        snapshot-create-as test s1
        snapshot-create-as test s2
        # check
        snapshot-list test --name
      '
      
      Note that this does NOT accept comments in argv mode, another patch
      will tackle that.
      
      (If I'm not careful, I might turn virsh into a full-fledged 'sh'
      replacement? Here's hoping I don't go that far...)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NMichal Privoznik <mprivozn@redhat.com>
      834f64ca
  19. 18 3月, 2019 2 次提交
  20. 13 3月, 2019 1 次提交
    • E
      virsh: Add snapshot-list --topological · c615c142
      Eric Blake 提交于
      For snapshots, virsh already has a (shockingly naive [1]) client-side
      topological sorter with the --tree option. But as a series of REDEFINE
      calls must be presented in topological order, it's worth letting the
      server do the work for us, especially since the server can give us a
      topological sorting with less effort than our naive client
      reconstruction.
      
      [1] The XXX comment in virshSnapshotListCollect() about --tree being
      O(n^3) is telling; https://en.wikipedia.org/wiki/Topological_sorting
      is an interesting resource describing Kahn's algorithm and other
      approaches for O(n) topological sorting for anyone motivated to use a
      more elegant algorithm than brute force - but that doesn't affect this
      patch.
      
      For now, I am purposefully NOT implementing virsh fallback code to
      provide a topological sort when the flag was rejected as unsupported;
      we can worry about that down the road if users actually demonstrate
      that they use new virsh but old libvirt to even need the fallback.
      (The code we use for --tree could be repurposed to be such a fallback,
      whether or not we keep it naive or improve it to be faster - but
      again, no one should spend time on a fallback without evidence that we
      need it.)
      
      The test driver makes it easy to test:
      $ virsh -c test:///default '
      snapshot-create-as test a
      snapshot-create-as test c
      snapshot-create-as test b
      snapshot-list test
      snapshot-list test --topological
      snapshot-list test --descendants a
      snapshot-list test --descendants a --topological
      snapshot-list test --tree
      snapshot-list test --tree --topological
      '
      
      Without any flags, virsh does client-side sorting alphabetically, and
      lists 'b' before 'c' (even though 'c' is the parent of 'b'); with the
      flag, virsh skips sorting, and you can now see that the server handed
      back data in a correct ordering. As shown here with a simple linear
      chain, there isn't any other possible ordering, so --tree mode doesn't
      seem to care whether --topological is used.  But it is possible to
      compose more complicated DAGs with multiple children to a parent
      (representing reverting back to a snapshot then creating more
      snapshots along those divergent execution timelines), where it is then
      possible (but not guaranteed) that adding the --topological flag
      changes the --tree output (the client-side --tree algorithm breaks
      ties based on alphabetical sorting between two nodes that share the
      same parent, while the --topological sort skips the client-side
      alphabetical sort and ends up exposing the server's internal order for
      siblings, whether that be historical creation order or dependent on a
      random hash seed).  But even if the results differ, they will still be
      topologically correct.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      c615c142
  21. 07 3月, 2019 1 次提交
  22. 27 2月, 2019 3 次提交
  23. 07 2月, 2019 1 次提交
  24. 30 1月, 2019 1 次提交
  25. 27 11月, 2018 1 次提交
    • W
      qemu: Report cache occupancy (CMT) with domstats · a91ebc89
      Wang Huaqiang 提交于
      Adding the interface in qemu to report CMT statistic information
      through command 'virsh domstats --cpu-total'.
      
      Below is a typical output:
      
               # virsh domstats 1 --cpu-total
               Domain: 'ubuntu16.04-base'
                 ...
                 cpu.cache.monitor.count=2
                 cpu.cache.monitor.0.name=vcpus_1
                 cpu.cache.monitor.0.vcpus=1
                 cpu.cache.monitor.0.bank.count=2
                 cpu.cache.monitor.0.bank.0.id=0
                 cpu.cache.monitor.0.bank.0.bytes=4505600
                 cpu.cache.monitor.0.bank.1.id=1
                 cpu.cache.monitor.0.bank.1.bytes=5586944
                 cpu.cache.monitor.1.name=vcpus_4-6
                 cpu.cache.monitor.1.vcpus=4,5,6
                 cpu.cache.monitor.1.bank.count=2
                 cpu.cache.monitor.1.bank.0.id=0
                 cpu.cache.monitor.1.bank.0.bytes=17571840
                 cpu.cache.monitor.1.bank.1.id=1
                 cpu.cache.monitor.1.bank.1.bytes=29106176
      Signed-off-by: NWang Huaqiang <huaqiang.wang@intel.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      a91ebc89
  26. 19 11月, 2018 2 次提交
  27. 24 8月, 2018 1 次提交
  28. 14 8月, 2018 1 次提交
  29. 23 7月, 2018 2 次提交