1. 06 4月, 2016 1 次提交
  2. 04 3月, 2016 1 次提交
  3. 01 3月, 2016 1 次提交
    • J
      virsh: Add support for text based polkit authentication · ea48397b
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=872166
      
      When the login session doesn't have an ssh -X type display agent in
      order for libvirtd to run the polkit session authentication, attempts
      to run 'virsh -c qemu:///system list' from an unauthorized user (or one
      that isn't part of the libvirt /etc/group) will fail with the following
      error from libvirtd:
      
      error: authentication unavailable: no polkit agent available to
             authenticate action 'org.libvirt.unix.manage'
      
      In order to handle the local authentication, we will use the new
      virPolkitAgentCreate API in order to create a text based authentication
      agent for our non readonly session to authenticate with.
      
      The new code will execute in a loop allowing 5 failures to authenticate
      before failing out.
      
      With this patch in place, the following occurs:
      
      $ virsh -c qemu:///system list
      ==== AUTHENTICATING FOR org.libvirt.unix.manage ===
      System policy prevents management of local virtualized systems
      Authenticating as: Some User (SUser)
      Password:
      ==== AUTHENTICATION COMPLETE ===
       Id    Name                           State
       ----------------------------------------------------
        1     somedomain                     running
      
      $
      ea48397b
  4. 15 2月, 2016 1 次提交
  5. 04 2月, 2016 1 次提交
  6. 08 1月, 2016 2 次提交
  7. 21 12月, 2015 1 次提交
    • E
      Revert "admin: Rename virAdmConnect to virAdmDaemon" · 3245e178
      Erik Skultety 提交于
      Commmit df8192aa introduced admin related rename and some minor
      (caused by automated approach, aka sed) and some more severe isues along with
      it. First reason to revert is the inconsistency with libvirt library.
      Although we deal with the daemon directly rather than with a specific
      hypervisor, we still do have a connection. That being said, contributors might
      get under the impression that AdmDaemonNew would spawn/start a new daemon
      (since it's admin API, why not...), or AdmDaemonClose would do the exact
      opposite or they might expect DaemonIsAlive report overall status of the daemon
      which definitely isn't the case.
      The second reason to revert this patch is renaming virt-admin client. The
      client tool does not necessarily have to reflect the names of the API's it's
      using in his internals. An example would be 's/vshAdmConnect/vshAdmDaemon'
      where noone can be certain of what the latter function really does. The former
      is quite expressive about some connection magic it performs, but the latter does
      not say anything, especially when vshAdmReconnect and vshAdmDisconnect were
      left untouched.
      3245e178
  8. 01 12月, 2015 1 次提交
    • M
      admin: Rename virAdmConnect to virAdmDaemon · df8192aa
      Martin Kletzander 提交于
      virAdmConnect was named after virConnect, but after some discussions,
      most of the APIs called will be working with remote daemon and starting
      them virAdmDaemon will make more sense.  Only possibly controversal name
      is CloseCallback (de)registration, and connecting to the daemon (which
      will still be Open/Close), but even this makes sense if one thinks about
      the daemon being opened and closed, e.g. as file, etc.
      
      This way all the APIs working with the daemon will start with
      virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
      and that will better suit with other namings as well (virDomain*,
      virAdmServer*, etc.).
      
      Because in virt-admin, the connection name does not refer to a struct
      that would have a connect in its name, also adjust 'connname' in
      clients.  And because it is not used anywhere in the vsh code, move it
      from there into each client.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      df8192aa
  9. 24 9月, 2015 1 次提交
  10. 23 9月, 2015 1 次提交
    • J
      virsh: Notify users about disconnects · 035947eb
      Jiri Denemark 提交于
      After my "client rpc: Report proper error for keepalive disconnections"
      patch, virsh would no long print a warning when it closes a connection
      to a daemon after a keepalive timeout. Although the warning
      
          virsh # 2015-09-15 10:59:26.729+0000: 642080: info :
          libvirt version: 1.2.19
          2015-09-15 10:59:26.729+0000: 642080: warning :
          virKeepAliveTimerInternal:143 : No response from client
          0x7efdc0a46730 after 1 keepalive messages in 2 seconds
      
      was pretty ugly, it was still useful. This patch brings the useful part
      back while making it much nicer:
      
      virsh # error: Disconnected from qemu:///system due to keepalive timeout
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      035947eb
  11. 04 9月, 2015 3 次提交
    • E
      virsh: Do not make interactive mode default · a02de849
      Erik Skultety 提交于
      Currently, we set interactive mode as default possibly reverting the
      setting after we parse the command line arguments. There's nothing
      particulary wrong with that, but a call to vshReadlineInit is performed
      always in the global initializer just because the default mode is interactive.
      Rather than moving vshReadlineInit call somewhere else (because another client
      might want to implement interactive mode only), we could make the decision
      if we're about to run in interactive mode once the command line is parsed.
      a02de849
    • E
      vsh: Introduce vshInitReload · f59d51f5
      Erik Skultety 提交于
      Commit a0b6a36f separated vshInitDebug from the original vshInit
      (before virsh got split and vshInit became virshInit - commit 834c5720)
      in order to be able to debug command line parsing.
      After the parsing is finished, debugging is reinitialized to work properly.
      There might as well be other features that require re-initialization as
      the command line could specify parameters that override our defaults which
      had been set prior to calling vshArgvParse.
      f59d51f5
    • E
      vsh: adjust vshInit signature and remove redundant error label · 57b8a388
      Erik Skultety 提交于
      As part of the effort to stay consistent, change the vshInit signature
      from returning int to returning bool. Moreover, remove the
      unnecessary error label as there is no cleanup that would make use of
      it.
      57b8a388
  12. 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
  13. 02 6月, 2015 5 次提交
  14. 25 5月, 2015 1 次提交
  15. 15 4月, 2015 1 次提交
    • 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
  16. 02 4月, 2015 1 次提交
    • J
      Remove unused includes from virsh · 8995e91b
      Ján Tomko 提交于
      After splitting out most of virsh command, some includes
      are no longer needed.
      
      Some files have the libXML includes despite not needing them.
      8995e91b
  17. 20 2月, 2015 1 次提交
    • M
      virsh-edit: Make force editing usable · 1bb1de83
      Martin Kletzander 提交于
      When editing a domain with 'virsh edit' and failing validation, the
      usual message pops up:
      
        Failed. Try again? [y,n,f,?]:
      
      Turning off validation can be useful, mainly for testing (but other
      purposes too), so this patch adds support for relaxing definition in
      virsh-edit and makes 'virsh edit <domain>' more usable.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      1bb1de83
  18. 12 1月, 2015 1 次提交
  19. 08 12月, 2014 1 次提交
  20. 15 11月, 2014 1 次提交
  21. 13 11月, 2014 2 次提交
  22. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in tools · 05853324
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * tools/virsh-console.c (got_signal): Drop unused variable.
      * tools/virsh-domain.c: Fix initialization.
      * tools/virsh.c: Likewise.
      * tools/virt-host-validate-common.c (virHostMsgWantEscape):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      05853324
  23. 02 10月, 2014 1 次提交
  24. 09 9月, 2014 1 次提交
  25. 06 9月, 2014 1 次提交
    • 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
  26. 28 8月, 2014 1 次提交
  27. 21 8月, 2014 1 次提交
  28. 26 6月, 2014 1 次提交
  29. 12 6月, 2014 4 次提交
    • P
      virsh: Reject negative numbers in vshCommandOptULongLong · c6212539
      Peter Krempa 提交于
      To follow the new semantics of the vshCommandOptToU* functions convert
      this one to reject negative numbers too. To allow using -1 for "maximum"
      semantics for the vol-*load two bandwidth functions that use this helper
      introduce vshCommandOptULongLongWrap.
      c6212539
    • P
      virsh: Reject negative numbers in vshCommandOptUL · 0e2d7305
      Peter Krempa 提交于
      To follow the new semantics of the vshCommandOptToU* functions convert
      this one to reject negative numbers too. To allow using -1 for "maximum"
      semantics for the two bandwidth functions that use this helper introduce
      vshCommandOptULWrap. Although currently the migrate-setspeed function
      for the qemu driver will reject -1 as maximum.
      0e2d7305
    • P
      virsh: Reject negative numbers in vshCommandOptUInt · 37e663ad
      Peter Krempa 提交于
      Use virStrToLong_uip instead of virStrToLong_ui to reject negative
      numbers in the helper. None of the callers expects the wraparound
      "feature" for negative numbers.
      
      Also add a function that allows wrapping of negative numbers as it might
      be used in the future and be explicit about the new semantics in the
      function docs.
      37e663ad
    • R
      virsh: include bhyve in virsh -V output · aec0c6d3
      Roman Bogorodskiy 提交于
      Add 'Bhyve' in hypervisor list reported by 'virsh -V'
      if it's compiled it.
      aec0c6d3