1. 07 9月, 2014 1 次提交
    • 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
  2. 06 9月, 2014 3 次提交
    • E
      blockcopy: allow block device destination · b7e73585
      Eric Blake 提交于
      To date, anyone performing a block copy and pivot ends up with
      the destination being treated as <disk type='file'>.  While this
      works for data access for a block device, it has at least one
      noticeable shortcoming: virDomainGetBlockInfo() reports allocation
      differently for block devices visited as files (the size of the
      device) than for block devices visited as <disk type='block'>
      (the maximum sector used, as reported by qemu); and this difference
      is significant when trying to manage qcow2 format on block devices
      that can be grown as needed.
      
      Of course, the more powerful virDomainBlockCopy() API can already
      express the ability to set the <disk> type.  But a new API can't
      be backported, while a new flag to an existing API can; and it is
      also rather inconvenient to have to resort to the full power of
      generating XML when just adding a flag to the older call will do
      the trick.  So this patch enhances blockcopy to let the user flag
      when the resulting XML after the copy must list the device as
      type='block'.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_REBASE_COPY_DEV):
      New flag.
      * src/libvirt.c (virDomainBlockRebase): Document it.
      * tools/virsh-domain.c (opts_block_copy, blockJobImpl): Add
      --blockdev option.
      * tools/virsh.pod (blockcopy): Document it.
      * src/qemu/qemu_driver.c (qemuDomainBlockRebase): Allow new flag.
      (qemuDomainBlockCopy): Remember the flag, and make sure it is only
      used on actual block devices.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b7e73585
    • E
      blockjob: add new --bytes flag to virsh blockjob · 1105c1de
      Eric Blake 提交于
      Expose the new flag just added to virDomainGetBlockJobInfo.
      With --raw, the presence or absence of --bytes determines which
      flag to use in the single API call.  Without --raw, the use of
      --bytes forces an error if the server doesn't support it,
      otherwise, the code tries to silently fall back to scaling the
      MiB/s value.
      
      My goal is to eventually also support --bytes in bandwidth mode;
      but that's a bit further down the road (and needs a new API flag
      added in libvirt.h first).
      
      This changes the human output, but the previous patch added
      raw output precisely so that we can have flexibility with the
      human output.  For this commit, I used qemu-monitor-command to
      force an unusual bandwidth, but the same will be possible once
      qemu implements virDomainBlockCopy:
      
      Before:
      Block Copy: [100 %]    Bandwidth limit: 2 MiB/s
      After:
      Block Copy: [100 %]    Bandwidth limit: 1048577 bytes/s (1.000 MiB/s)
      
      The cache avoids having to repeatedly checking whether the flag
      works when talking to an older server, when multiple blockjob
      commands are issued during a batch session and the user is
      manually polling for job completion.
      
      * tools/virsh.h (_vshControl): Add a cache.
      * tools/virsh.c (cmdConnect, vshReconnect): Initialize the cache.
      * tools/virsh-domain.c (opts_block_job): Add --bytes.
      * tools/virsh.pod (blockjob): Document this.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1105c1de
    • E
      blockjob: add new --raw flag to virsh blockjob · 2019b7ca
      Eric Blake 提交于
      The current output of 'blockjob [--info]' is a single line
      designed for human consumption; it's not very nice for machine
      parsing.  Furthermore, I have plans to modify the line in
      response to the new flag for controlling bandwidth units.
      Solve that by adding a --raw parameter, which outputs
      information closer to the C struct.
      
      $ virsh blockjob testvm1 vda --raw
       type=Block Copy
       bandwidth=1
       cur=197120
       end=197120
      
      The information is indented, because I'd like for a later patch
      to add a mode that iterates over all the vm's disks with status
      for each; in that mode, each block name would be listed unindented
      before information (if any) about that block.
      
      Now that we have a raw mode, we can guarantee that it won't change
      format over time.  Any app that cares about parsing the output can
      try --raw, and if it fails, know that it was talking to an older
      virsh and fall back to parsing the human-readable format which had
      not changed until now; meanwhile, when not using --raw, we have
      freed future virsh to change the output to whatever makes sense.
      
      My first change to human mode: this command now guarantees a line
      is printed on successful use of the API, even when the API did
      not find a current block job (consistent with the rest of virsh).
      
      Bonus: https://bugzilla.redhat.com/show_bug.cgi?id=1135441
      complained that this message was confusing:
      
      $ virsh blockjob test1 hda  --async --bandwidth 10
      error: conflict between --abort, --info, and --bandwidth modes
      
      even though the man page already documents that --async implies
      abort mode, all because '--abort' wasn't present in the command
      line.  Since I'm adding another case where options are tied
      to or imply a mode, I changed that error to:
      
      error: conflict between abort, info, and bandwidth modes
      
      * tools/virsh-domain.c (cmdBlockJob): Add --raw parameter; tweak
      error wording.
      * tools/virsh.pod (blockjob): Document it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2019b7ca
  3. 28 8月, 2014 1 次提交
  4. 21 8月, 2014 1 次提交
  5. 19 8月, 2014 2 次提交
  6. 18 8月, 2014 2 次提交
  7. 15 8月, 2014 1 次提交
  8. 12 8月, 2014 1 次提交
  9. 08 8月, 2014 1 次提交
    • L
      virsh: clean up attach-interface paragraph in man page · f91aa931
      Laine Stump 提交于
      This makes the paragaph about attach-interface more descriptive and
      correct, adding in a few bits of information that were previously
      missing, e.g. --script is only allowed for bridge interfaces of Xen
      domains, target name is regenerated if it starts with vnet, mac
      address will be autogenerated if not specified.
      
      (I did this in response to an email asking why a script couldn't be
      specified for a bridge interface of a qemu domain, and why an
      interface of type='ethernet' couldn't be created with
      attach-interface)
      f91aa931
  10. 04 8月, 2014 1 次提交
    • J
      storage: Refresh storage pool after upload · 4a85bf3e
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1072653
      
      Upon successful upload of a volume, the target volume and storage pool
      were not updated to reflect any changes as a result of the upload. Make
      use of the existing stream close callback mechanism to force a backend
      pool refresh to occur in a separate thread once the stream closes. The
      separate thread should avoid potential deadlocks if the refresh needed
      to wait on some event from the event loop which is used to perform
      the stream callback.
      4a85bf3e
  11. 18 7月, 2014 2 次提交
    • J
      virsh: Document bandwidth maximum more clearly · 83a928ef
      John Ferlan 提交于
      Commit id '0e2d7305' modified the code to allow a negative value to be
      supplied for the bandwidth argument of the various block virsh commands
      and the migrate-setspeed; however, it failed to update the man page to
      describe the "feature" whereby a very large value could be interpreted
      by the hypervisor to mean maximum value allowed. Although initially
      designed to handle a -1 value, the reality is just about any negative
      value could be provided and essentially perform the same feature.
      83a928ef
    • J
      virsh vol-upload/download disallow negative offset · 570d0f63
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1087104
      
      Commit id 'c6212539' explicitly allowed a negative value to be used for
      offset and length as a shorthand for the largest value after commit id
      'f18c02ec' modified virStrToLong_ui() to essentially disallow a negative
      value.
      
      However, allowing a negative value for offset ONLY worked if the negative
      value was -1 since the eventual lseek() does allow a -1 to mean the end
      of the file.  Providing other negative values resulted in errors such as:
      
      $ virsh vol-download --pool default qcow3-vol2 /home/vm-images/raw \
        --offset -2 --length -1000
      error: cannot download from volume qcow3-vol2
      error: Unable to seek /home/vm-images/qcow3-vol2 to 18446744073709551614: Invalid argument
      
      $
      
      Thus, it seems unreasonable to expect or allow a negative value for offset
      since the only benefit is to lseek() to the end of the file and then only
      take advantage of how the OS would handle such a seek. For the purposes of
      upload or download of volume data, that seems to be a no-op.  Therefore,
      disallow a negative value for offset.
      
      Additionally, modify the man page for vol-upload and vol-download to provide
      more details regarding the valid values for both offset and length.
      570d0f63
  12. 14 7月, 2014 2 次提交
  13. 09 7月, 2014 1 次提交
  14. 08 7月, 2014 2 次提交
  15. 03 7月, 2014 1 次提交
  16. 02 7月, 2014 1 次提交
  17. 26 6月, 2014 1 次提交
  18. 24 6月, 2014 1 次提交
    • N
      net-dhcp-leases: Add virsh support · 59cac9a9
      Nehal J Wani 提交于
      Use virNetworkGetDHCPLeases and virNetworkGetDHCPLeasesForMAC in virsh.
      
      The new feature supports the follwing methods:
      
      1. Retrieve leases info for a given virtual network
      
      2. Retrieve leases info for given network interface
      
      tools/virsh-domain-monitor.c
         * Introduce new command : net-dhcp-leases
           Example Usage: net-dhcp-leases <network> [mac]
      
         virsh # net-dhcp-leases --network default6
         Expiry Time          MAC address        Protocol  IP address                Hostname        Client ID or DUID
         -------------------------------------------------------------------------------------------------------------------
         2014-06-16 03:40:14  52:54:00:85:90:e2  ipv4      192.168.150.231/24        fedora20-test   01:52:54:00:85:90:e2
         2014-06-16 03:40:17  52:54:00:85:90:e2  ipv6      2001:db8:ca2:2:1::c0/64   fedora20-test   00:04:b1:d8:86:42:e1:6a:aa:cf:d5:86:94:23:6f:94:04:cd
         2014-06-16 03:34:42  52:54:00:e8:73:eb  ipv4      192.168.150.181/24        ubuntu14-vm     -
         2014-06-16 03:34:46  52:54:00:e8:73:eb  ipv6      2001:db8:ca2:2:1::5b/64   -               00:01:00:01:1b:30:c6:aa:52:54:00:e8:73:eb
      
      tools/virsh.pod
         * Document new command
      
      src/internal.h
         * Introduce new macro: EMPTYSTR
      59cac9a9
  19. 19 6月, 2014 2 次提交
    • M
      virsh: Expose virNodeGetFreePages · 9e3efe53
      Michal Privoznik 提交于
      The new API is exposed under 'freepages' command.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9e3efe53
    • E
      virsh: expose new active commit controls · f182da20
      Eric Blake 提交于
      Add knobs to virsh to manage a 2-phase active commit of the top
      layer, similar to knobs already present on blockcopy.  While this
      code will fail until later patches actually implement the new
      knobs in the qemu driver, doing it now proves that the API is
      usable and also makes it easier for testing the qemu changes as
      they are made.
      
      * tools/virsh-domain.c (cmdBlockCommit): Add --active, --pivot,
      and --keep-overlay options, modeled after blockcopy.
      (blockJobImpl): Support --active flag.
      * tools/virsh.pod (blockcommit): Document new flags.
      (blockjob): Mention 2-phase commit interaction.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f182da20
  20. 18 6月, 2014 2 次提交
  21. 13 6月, 2014 1 次提交
    • E
      virsh: improve blockcopy UI · 17840379
      Eric Blake 提交于
      Peter's review of an early version of my addition of active block
      commit pointed out some issues that I was copying from the block
      copy code; fix them up now before perpetuating them.
      
      For virsh commands that manage a single API call, it's nice to have
      a 1:1 mapping of options to flags, so that we can test that
      lower-layer software handles flag combinations correctly.  But where
      virsh is introducing syntactic sugar to combine multiple API calls
      into a single user interface, we might as well make that interface
      compact.  That is, we should allow the shorter command-line of
      'blockcopy $dom $disk --pivot' without having to explicitly specify
      --wait, because this isn't directly a flag passed to a single
      underlying API call.
      
      Also, my use of embedded ?: ternaries bordered on unreadable.
      
      * tools/virsh-domain.c (cmdBlockCopy): Make --pivot, --finish,
      and --timeout imply --wait. Drop excess ?: operators.
      * tools/virsh.pod (blockcopy): Update documentation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      17840379
  22. 11 6月, 2014 1 次提交
  23. 06 6月, 2014 1 次提交
  24. 29 5月, 2014 1 次提交
  25. 15 5月, 2014 1 次提交
  26. 13 5月, 2014 1 次提交
  27. 06 5月, 2014 1 次提交
  28. 23 4月, 2014 1 次提交
  29. 22 4月, 2014 1 次提交
  30. 02 4月, 2014 1 次提交
  31. 31 3月, 2014 1 次提交