1. 15 10月, 2019 1 次提交
  2. 03 1月, 2019 1 次提交
  3. 24 9月, 2018 1 次提交
  4. 26 6月, 2018 1 次提交
    • D
      virsh: add nwfilter binding commands · 278659ff
      Daniel P. Berrangé 提交于
      $ virsh nwfilter-binding-list
       Port Dev                              Filter
      ------------------------------------------------------------------
       vnet0                 clean-traffic
       vnet1                 clean-traffic
      
      $ virsh nwfilter-binding-dumpxml vnet1
      <filterbinding>
        <owner>
          <name>f25arm7</name>
          <uuid>12ac8b8c-4f23-4248-ae42-fdcd50c400fd</uuid>
        </owner>
        <portdev name='vnet1'/>
        <mac address='52:54:00:9d:81:b1'/>
        <filterref filter='clean-traffic'>
          <parameter name='MAC' value='52:54:00:9d:81:b1'/>
        </filterref>
      </filterbinding>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      278659ff
  5. 24 1月, 2018 1 次提交
  6. 13 12月, 2017 1 次提交
  7. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  8. 14 11月, 2016 1 次提交
  9. 24 8月, 2016 1 次提交
    • P
      virsh: respect -q/--quiet more · b620bdee
      Pino Toscano 提交于
      Turn various vshPrint() informative messages into vshPrintExtra(), so
      they are not printed when requesting the quiet mode; neither XML/info
      outputs nor the results of commands are affected.
      Also change the expected outputs of the virsh-undefine test, since virsh
      is invoked in quiet mode there.
      
      Some informative messages might still be converted (and thus silenced
      when in quiet mode), but this is an improvements nonetheless.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1358179
      b620bdee
  10. 12 1月, 2016 1 次提交
    • J
      virsh: Create macro for common "file" option · febf69b5
      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 for the less common help string for each
      command option.  Note that only file options using "OT_DATA" and
      "OFLAG_REQ" will be replace - others are left as is.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      febf69b5
  11. 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
  12. 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
  13. 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
  14. 15 11月, 2014 1 次提交
  15. 11 9月, 2014 1 次提交
    • J
      virsh: Resolve Coverity DEADCODE · daf27d4d
      John Ferlan 提交于
      Since 0766783a
      
      Coverity complains that the EDIT_FREE definition results in DEADCODE.
      
      As it turns out with the change to use the EDIT_FREE macro the call to
      vir*Free() wouldn't be necessary nor would it happen...
      
      Prior code to above commitid would :
      
        vir*Ptr foo = NULL;
        ...
        foo = vir*GetXMLDesc()
        ...
        vir*Free(foo);
        foo = vir*DefineXML()
        ...
      
      And thus the free was needed.  With the change to use EDIT_FREE the
      same code changed to:
      
        vir*Ptr foo = NULL;
        vir*Ptr foo_edited = NULL;
        ...
        foo = vir*GetXMLDesc()
        ...
        if (foo_edited)
            vir*Free(foo_edited);
        foo_edited = vir*DefineXML()
        ...
      
      However, foo_edited could never be set in the code path - even with
      all the goto's since the only way for it to be set is if vir*DefineXML()
      succeeds in which case the code to allow a retry (and thus all the goto's)
      never leaves foo_edited set
      
      All error paths lead to "cleanup:" which causes both foo and foo_edited
      to call the respective vir*Free() routines if set.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      daf27d4d
  16. 25 3月, 2014 1 次提交
  17. 13 11月, 2013 1 次提交
    • P
      virsh-nwfilter: Unify list command column alignment · 75fe29e2
      Peter Krempa 提交于
      Before:
      $ virsh nwfilter-list
      UUID                                  Name
      ----------------------------------------------------------------
      651d902c-165c-4bcc-8d73-41319af1e6bc  allow-arp
      9ae11362-df6b-407f-8864-3bdf5125bf77  allow-dhcp
      53b5a9ed-7d46-480f-a201-6d8a503d6533  allow-dhcp-server
      
      After:
      $ virsh nwfilter-list
       UUID                                  Name
      ------------------------------------------------------------------
       651d902c-165c-4bcc-8d73-41319af1e6bc  allow-arp
       9ae11362-df6b-407f-8864-3bdf5125bf77  allow-dhcp
       53b5a9ed-7d46-480f-a201-6d8a503d6533  allow-dhcp-server
      75fe29e2
  18. 28 8月, 2013 1 次提交
    • J
      virsh: free the list from ListAll APIs even for 0 items · f733eac0
      Ján Tomko 提交于
      virsh secret-list leak when no secrets are defined:
      
      ==27== 8 bytes in 1 blocks are definitely lost in loss record 6 of 726
      ==27==    by 0x4E941DD: virAllocN (viralloc.c:183)
      ==27==    by 0x5037F1A: remoteConnectListAllSecrets (remote_driver.c:3076)
      ==27==    by 0x5004EC6: virConnectListAllSecrets (libvirt.c:16298)
      ==27==    by 0x15F813: vshSecretListCollect (virsh-secret.c:397)
      ==27==    by 0x15F0E1: cmdSecretList (virsh-secret.c:532)
      
      And so do some other *-list commands.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1001536
      f733eac0
  19. 11 7月, 2013 1 次提交
  20. 21 5月, 2013 1 次提交
  21. 11 5月, 2013 1 次提交
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
  22. 13 2月, 2013 2 次提交
  23. 04 2月, 2013 1 次提交
  24. 17 1月, 2013 1 次提交
  25. 21 12月, 2012 4 次提交
  26. 21 9月, 2012 1 次提交
  27. 17 9月, 2012 1 次提交
    • O
      list: Use virConnectListAllNWFilters in virsh · 9b096843
      Osier Yang 提交于
      tools/virsh-nwfilter.c:
        * vshNWFilterSorter to sort network filters by name
      
        * vshNWFilterListFree to free the network filter objects list.
      
        * vshNWFilterListCollect to collect the network filter objects, trying
          to use new API first, fall back to older APIs if it's not supported.
      9b096843
  28. 31 8月, 2012 1 次提交
  29. 21 8月, 2012 2 次提交
    • E
      virsh: split out virsh-nwfilter.c · 69af4f7c
      Eric Blake 提交于
      Yet another split file.
      
      * tools/virsh-nwfilter.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-nwfilter.c: Likewise.
      69af4f7c
    • E
      virsh: declare more common functions · 4c10b3c7
      Eric Blake 提交于
      In preparation for splitting virsh-interface.c, I found these
      functions need to be declared in virsh.h, as well as one that
      belongs more properly in virsh-domain.h.  Also, since we
      use the VSH_BY* flags in more than one function, I improved
      how they are used.
      
      * tools/virsh.h (vshNameSorter, vshCmdHasOption): Declare.
      (VSH_BYID): Turn into enum.
      (vshCommandOptDomainBy): Move...
      * tools/virsh-domain.h): ...here.
      * tools/virsh.c: (vshNameSorter): Export.
      (cmd_has_option): Rename...
      (vshCmdHasOption): ...and export.
      (vshCommandOptDomainBy): Move...
      * tools/virsh-domain.c (vshCommandOptDomainBy): ...here, adjust
      signature, and check flags.
      * tools/virsh-network.c (vshCommandOptNetworkBy): Update callers.
      * tools/virsh-nwfilter.c (vshCommandOptNWFilterBy): Likewise.
      * tools/virsh-secret.c (vshCommandOptSecret): Likewise.
      * tools/virsh-domain-monitor.c (includes): Likewise.
      * tools/virsh-host.c (includes): Likewise.
      4c10b3c7
  30. 20 8月, 2012 1 次提交
    • E
      virsh: use common namespacing · e68ee5e7
      Eric Blake 提交于
      Convert the exported items in virsh.h to use a common 'vsh' prefix.
      
      * tools/virsh.h (VIRSH_MAX_XML_FILE): Rename...
      (VSH_MAX_XML_FILE): ...and parenthesize.
      (DIFF_MSEC, CTRL_CLOSE_BRACKET): Delete.
      (vshUsage, vshInit, vshDeinit, vshParseArgv): Remove prototype.
      (editWriteToTempFile, editFile, editReadBackFile, prettyCapacity)
      (virshReportError): Rename...
      (vshEditWriteToTempFile, vshEditFile, vshEditReadBackFile)
      (vshPrettyCapacity, vshReportError): ...into vsh namespace.
      (jobWatchTimeoutFunc): Move to virsh-domain.c.
      * tools/virsh.c (vshCommandRun): Inline former DIFF_MSEC.
      (main): Inline former CTRL_CLOSE_BRACKET.
      (vshUsage, vshInit, vshDeinit, vshParseArgv): Make static.
      (prettyCapacity, virshReportError, editWriteToTempFile, editFile):
      Fix naming, and adjust usage.
      (vshAskReedit, vshCommandRun, vshEventLoop, vshInit): Adjust
      usage.
      * tools/virsh-domain.c (cmdAttachDevice, cmdCPUCompare)
      (cmdCPUBaseline, cmdCreate, cmdDefine, cmdDetachDevice)
      (cmdUpdateDevice, cmdDesc, cmdUndefine, cmdStart, cmdVcpucount)
      (cmdAttachDevice, cmdDomjobinfo): Likewise.
      * tools/virsh-edit.c (do): Likewise.
      * tools/virsh-interface.c (cmdInterfaceDefine): Likewise.
      * tools/virsh-network.c (cmdNetworkCreate, cmdNetworkDefine):
      Likewise.
      * tools/virsh-nodedev.c (cmdNodeDeviceCreate): Likewise.
      * tools/virsh-nwfilter.c (cmdNWFilterDefine): Likewise.
      * tools/virsh-pool.c (cmdPoolCreate, cmdPoolDefine)
      (cmdPoolDiscoverSources, cmdPoolList): Likewise.
      * tools/virsh-secret.c (cmdSecretDefine): Likewise.
      * tools/virsh-snapshot.c (cmdSnapshotCreate, vshSnapshotCreate)
      (vshLookupSnapshot, cmdSnapshotEdit, cmdSnapshotCurrent)
      (vshGetSnapshotParent): Likewise.
      * tools/virsh-volume.c (cmdVolCreate, cmdVolCreateFrom)
      (cmdVolInfo, cmdVolList): Likewise.
      e68ee5e7
  31. 26 7月, 2012 2 次提交
    • O
      virsh: Move command group definition into its own file · c4bdf307
      Osier Yang 提交于
      * virsh-domain-monitor.c: Add domMonitoringCmds
      * virsh-domain.c: Add domManagementCmds
      * virsh-host.c: Add hostAndHypervisorCmds
      * virsh-interface.c: Add ifaceCmds
      * virsh-network.c: Add networkCmds
      * virsh-nodedev.c: Add nodedevCmds
      * virsh-nwfilter.c: Add nwfilterCmds
      * virsh-pool.c: Add storagePoolCmds
      * virsh-secret.c: Add secretCmds
      * virsh-snapshot.c: Add snapshotCmds
      * virsh-volume.c: Add storageVolCmds
      * virsh.c: Remove all the above *Cmds.
      c4bdf307
    • O
      virsh: Split cmds to manage network filter from virsh.c · e9d10055
      Osier Yang 提交于
      Commands to manage network filter are moved from virsh.c to virsh-nwfilter.c,
      with a few helpers for network filter command use.
      
      * virsh.c: Remove network filter commands and a few helpers.
                 (vshCommandOptNWFilter, and vshCommandOptNWFilterBy)
      * virsh-nwfilter.c: New file, filled with network filter commands and its helpers.
      
      * po/POTFILES.in: Add virsh-nwfilter.c
      
      * cfg.mk: Skip to check config.h including for virsh-nwfilter.c
      e9d10055