1. 26 1月, 2013 1 次提交
  2. 23 1月, 2013 1 次提交
    • P
      virsh-domain: Refactor error paths for cmdCPUStats · a54f25a9
      Peter Krempa 提交于
      This patch fixes the following issues in the cpu-stats virsh command:
      
      1) Renames label failed_params to no_memory to match coding style
      2) Uses proper typed parameter cleanup in error paths to avoid leaks
      3) Adds a ret variable and simplifies error labels
      4) Changes error message to a slightly more descriptive one and gets rid
         of the newline at the end:
      
      Before:
      $ virsh cpu-stats tr
      error: Failed to virDomainGetCPUStats()
      
      error: Requested operation is not valid: domain is not running
      
      After:
      $ tools/virsh cpu-stats tr
      error: Failed to retrieve CPU statistics for domain 'tr'
      error: Requested operation is not valid: domain is not running
      a54f25a9
  3. 18 1月, 2013 8 次提交
  4. 17 1月, 2013 1 次提交
  5. 16 1月, 2013 1 次提交
  6. 08 1月, 2013 1 次提交
  7. 21 12月, 2012 6 次提交
  8. 11 12月, 2012 1 次提交
    • L
      Add support for offline migration · 8b9bf787
      liguang 提交于
      Offline migration transfers inactive definition of a domain (which may
      or may not be active). After successful completion, the domain remains
      in its current state on source host and is defined but inactive on
      destination host. It's a bit more clever than virDomainGetXMLDesc() on
      source host followed by virDomainDefineXML() on destination host, as
      offline migration will run pre-migration hook to update the domain XML
      on destination host. Currently, copying non-shared storage is not
      supported during offline migration.
      
      Offline migration can be requested with a new migration flag called
      VIR_MIGRATE_OFFLINE (which has to be combined with
      VIR_MIGRATE_PERSIST_DEST flag).
      8b9bf787
  9. 07 12月, 2012 1 次提交
    • P
      virsh: Fix usage of header termios.h · 989a427d
      Peter Krempa 提交于
      The termios struct exported by the termios.h header is used as an
      argument for vshMakeStdinRaw(). The header isn't used anywhere in
      tools/virsh-domain.c.
      
      This patch adds the header to the header declaring vshMakeStdinRaw() and
      removes other places in virsh.
      989a427d
  10. 03 12月, 2012 2 次提交
  11. 01 12月, 2012 3 次提交
  12. 30 11月, 2012 1 次提交
    • J
      virsh: use correct sizeof when allocating cpumap · dc04b2a7
      Ján Tomko 提交于
      Found by coverity:
      Error: SIZEOF_MISMATCH (CWE-569):
          libvirt-0.10.2/tools/virsh-domain.c:4754: suspicious_sizeof: Passing
          argument "8UL /* sizeof (cpumap) */" to function
          "_vshCalloc(vshControl *, size_t, size_t, char const *, int)" and
          then casting the return value to "unsigned char *" is suspicious.
      
      Error: SIZEOF_MISMATCH (CWE-569):
          libvirt-0.10.2/tools/virsh-domain.c:4942: suspicious_sizeof: Passing
          argument "8UL /* sizeof (cpumap) */" to function
          "_vshCalloc(vshControl *, size_t, size_t, char const *, int)" and
          then casting the return value to "unsigned char *" is suspicious.
      dc04b2a7
  13. 29 11月, 2012 2 次提交
  14. 28 11月, 2012 2 次提交
    • M
      virsh: Rewrite cmdDomDisplay · 1d4f41fd
      Martin Kletzander 提交于
      Just a little rewrite of the cmdDomDisplay function to make it
      consistent and hopefully more readable.  This also fixes a problem
      with password not being displayed for vnc even with the
      "--include-password" option.
      1d4f41fd
    • M
      virsh: Expose new virDomainFSTrim API · 47c724e5
      Michal Privoznik 提交于
      It's exposed under domfstrim command. Although the API
      doesn't support specifying mount point yet, expose it
      anyway.
      47c724e5
  15. 16 11月, 2012 3 次提交
  16. 06 11月, 2012 1 次提交
    • E
      virsh: add aliases 'boot', 'stop', and 'restart' · ff86b0c9
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=873344 suggested that
      the grouping 'boot', 'shutdown', 'reboot'; as well as the grouping
      'start', 'stop', 'restart'; might be easier to remember than the
      current mix of 'start', 'shutdown', 'reboot'.
      
      Also, touch up the wording of 'reboot' to be more accurate.
      
      * tools/virsh-domain.c (domManagementCmds): Add other command names.
      * tools/virsh.pod (start, shutdown, reboot): Document the aliases.
      ff86b0c9
  17. 02 11月, 2012 1 次提交
  18. 27 10月, 2012 1 次提交
    • L
      qemu: fix attach/detach of netdevs with matching mac addrs · def31e4c
      Laine Stump 提交于
      This resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=862515
      
      which describes inconsistencies in dealing with duplicate mac
      addresses on network devices in a domain.
      
      (at any rate, it resolves *almost* everything, and prints out an
      informative error message for the one problem that isn't solved, but
      has a workaround.)
      
      A synopsis of the problems:
      
      1) you can't do a persistent attach-interface of a device with a mac
      address that matches an existing device.
      
      2) you *can* do a live attach-interface of such a device.
      
      3) you *can* directly edit a domain and put in two devices with
      matching mac addresses.
      
      4) When running virsh detach-device (live or config), only MAC address
      is checked when matching the device to remove, so the first device
      with the desired mac address will be removed. This isn't always the
      one that's wanted.
      
      5) when running virsh detach-interface (live or config), the only two
      items that can be specified to match against are mac address and model
      type (virtio, etc) - if multiple netdevs match both of those
      attributes, it again just finds the first one added and assumes that
      is the only match.
      
      Since it is completely valid to have multiple network devices with the
      same MAC address (although it can cause problems in many cases, there
      *are* valid use cases), what is needed is:
      
      1) remove the restriction that prohibits doing a persistent add of a
      netdev with a duplicate mac address.
      
      2) enhance the backend of virDomainDetachDeviceFlags to check for
      something that *is* guaranteed unique (but still work with just mac
      address, as long as it yields only a single results.
      
      This patch does three things:
      
      1) removes the check for duplicate mac address during a persistent
      netdev attach.
      
      2) unifies the searching for both live and config detach of netdevices
      in the subordinate functions of qemuDomainModifyDeviceFlags() to use the
      new function virDomainNetFindIdx (which matches mac address and PCI
      address if available, checking for duplicates if only mac address was
      specified). This function returns -2 if multiple matches are found,
      allowing the callers to print out an appropriate message.
      
      Steps 1 & 2 are enough to fully fix the problem when using virsh
      attach-device and detach-device (which require an XML description of
      the device rather than a bunch of commandline args)
      
      3) modifies the virsh detach-interface command to check for multiple
      matches of mac address and show an error message suggesting use of the
      detach-device command in cases where there are multiple matching mac
      addresses.
      
      Later we should decide how we want to input a PCI address on the virsh
      commandline, and enhance detach-interface to take a --address option,
      eliminating the need to use detach-device
      
      * src/conf/domain_conf.c
      * src/conf/domain_conf.h
      * src/libvirt_private.syms
        * added new virDomainNetFindIdx function
        * removed now unused virDomainNetIndexByMac and
          virDomainNetRemoveByMac
      
      * src/qemu/qemu_driver.c
        * remove check for duplicate max from qemuDomainAttachDeviceConfig
        * use virDomainNetFindIdx/virDomainNetRemove instead
          of virDomainNetRemoveByMac in qemuDomainDetachDeviceConfig
        * use virDomainNetFindIdx instead of virDomainIndexByMac
          in qemuDomainUpdateDeviceConfig
      
      * src/qemu/qemu_hotplug.c
        * use virDomainNetFindIdx instead of a homespun loop in
          qemuDomainDetachNetDevice.
      
      * tools/virsh-domain.c: modified detach-interface command as described
          above
      def31e4c
  19. 12 10月, 2012 2 次提交
  20. 11 10月, 2012 1 次提交
    • J
      Add MIGRATABLE flag for virDomainGetXMLDesc · 28f8dfdc
      Jiri Denemark 提交于
      Using VIR_DOMAIN_XML_MIGRATABLE flag, one can request domain's XML
      configuration that is suitable for migration or save/restore. Such XML
      may contain extra run-time stuff internal to libvirt and some default
      configuration may be removed for better compatibility of the XML with
      older libvirt releases.
      
      This flag may serve as an easy way to get the XML that can be passed
      (after desired modifications) to APIs that accept custom XMLs, such as
      virDomainMigrate{,ToURI}2 or virDomainSaveFlags.
      28f8dfdc