1. 17 2月, 2010 1 次提交
    • J
      vshCommandParse: placate coverity · 7c5735dc
      Jim Meyering 提交于
      There is no real leak here, but Coverity-Prevent thinks there is.
      It does not see that while there are four ways to return from
      vshCommandGetToken with VSH_TK_END, none of them results in allocation
      of a result.
      * tools/virsh.c (vshCommandParse): Add a (currently) useless VIR_FREE,
      to ensure that we never leak when vshCommandGetToken returns VSH_TK_END.
      7c5735dc
  2. 09 2月, 2010 2 次提交
    • M
      Remove conn parameter from util functions · f972dc2d
      Matthias Bolte 提交于
      It was used for error reporting only.
      f972dc2d
    • J
      Modify virsh commands · 3b9027c4
      Jim Fehlig 提交于
      Change all virsh commands that invoke virDomain{Attach,Detach}Device()
      to use virDomain{Attach,Detach}DeviceFlags() instead.
      
      Add a "--persistent" flag to these virsh commands, allowing user to
      specify that the domain persisted config be modified as well.
      
      V2: Only invoke virDomain{Attach,Detach}DeviceFlags() if
      "--persistent" flag is specified.  Otherwise invoke
      virDomain{Attach,Detach}Device() to retain current behavior.
      3b9027c4
  3. 02 2月, 2010 1 次提交
    • J
      avoid format-related warnings · 4cd188d4
      Jim Meyering 提交于
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetAllPCIAddresses):
      Use %s.
      * src/storage/storage_backend_iscsi.c (virStorageBackendCreateIfaceIQN):
      Likewise.
      * tools/virsh.c (cmdSecretSetValue): Likewise.
      4cd188d4
  4. 12 1月, 2010 2 次提交
  5. 07 1月, 2010 2 次提交
  6. 21 12月, 2009 1 次提交
  7. 20 12月, 2009 1 次提交
    • A
      Add a new command dommemstats for virDomainMemoryStats · b6798b68
      Adam Litke 提交于
      Define a new command 'dommemstats' to report domain memory statistics.  The
      output format is inspired by 'domblkstat' and 'domifstat' and consists of
      tag/value pairs, one per line.  The command can complete successfully and
      print no output if virDomainMemoryStats is supported by the driver, but not
      the guest operating system.
      
      Sample output:
      swap_in 0
      swap_out 0
      major_fault 54
      minor_fault 58259
      unused 487680
      available 502472
      
      All stats referring to a quantity of memory (eg. all above except major and
      minor faults) represent the quantity in KBytes.
      
      * tools/virsh.c: implements the new command
      b6798b68
  8. 18 12月, 2009 1 次提交
  9. 14 12月, 2009 4 次提交
    • J
      virsh: avoid double-free · 21a2eba4
      Jim Meyering 提交于
      * tools/virsh.c (vshCommandParse): Avoid double-free of "tkdata".
      Set it to NULL immediately after free in the (cmd == NULL) case,
      just as in the other case, in case the final free(tkdata) is
      triggered by a syntax error.
      21a2eba4
    • D
      Implement --pool option for virsh vol-path · 94d599ec
      Dave Allan 提交于
      This patch fixes the problem reported in:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=509306
      
      The bug reporter says that vol-delete does not support the --pool
      option, but that's not the case in the current head.  This patch makes
      vol-path behave the same way as vol-delete
      
      * tools/virsh.c: Modified vol-path to use the same logic as vol-delete,
        allowing the syntax: virsh vol-path --pool testdirpool testvol0
      94d599ec
    • P
      add --live support to "virsh dump" · 1fb7af40
      Paolo Bonzini 提交于
      This is trivial for QEMU since you just have to not stop the vm before
      starting the dump.  And for Xen, you just pass the flag down to xend.
      
      * include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): Add VIR_DUMP_LIVE.
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Support live dumping.
      * src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support live dumping.
      * tools/virsh.c (opts_dump): Add --live. (cmdDump): Map it to VIR_DUMP_LIVE.
      1fb7af40
    • P
      add --crash support to "virsh dump" · b927aed8
      Paolo Bonzini 提交于
      This patch adds the --crash option (already present in "xm dump-core")
      to "virsh dump".  virDomainCoreDump already has a flags argument, so
      the API/ABI is untouched.
      
      * include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): New flag for
        CoreDump
      * src/test/test_driver.c (testDomainCoreDump): Do not crash
        after dump unless VIR_DUMP_CRASH is given.
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Shutdown the domain
        instead of restarting it if --crash is passed.
      * src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support --crash.
      * tools/virsh.c (opts_dump): Add --crash.
        (cmdDump): Map it to flags for virDomainCoreDump and pass them.
      b927aed8
  10. 11 12月, 2009 1 次提交
    • P
      add virsh --suspend arg to migrate command · edc9e78b
      Paolo Bonzini 提交于
      This adds a new flag, VIR_MIGRATE_PAUSED, that mandates pausing
      the migrated VM before starting it.
      
      * include/libvirt/libvirt.h.in (virDomainMigrateFlags): Add VIR_MIGRATE_PAUSED.
      * src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Handle VIR_MIGRATE_PAUSED.
      * tools/virsh.c (opts_migrate): Add --suspend. (cmdMigrate): Handle it.
      * tools/virsh.pod (migrate): Document it.
      edc9e78b
  11. 10 12月, 2009 1 次提交
    • M
      Add virBufferFreeAndReset() and replace free() · 1b9d0744
      Matthias Bolte 提交于
      Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
      Update documentation and replace all remaining calls to free() with
      calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
      and virReportOOMError() in OOM error cases.
      1b9d0744
  12. 13 11月, 2009 1 次提交
    • D
      Check that domain is running when starting console · c7a8e1bf
      Daniel P. Berrange 提交于
      The 'virsh console' command did not check if the domain was
      already running before attempting to fetch the XML and extract
      the console PTY path. This caused a slightly unhelpful / misleading
      error message for the user. The explicit check ensures the user
      gets an explicit 'domain is not running' message.
      
      * tools/virsh.c: Validate that state != VIR_DOMAIN_SHUTOFF in
        virsh console command
      c7a8e1bf
  13. 11 11月, 2009 1 次提交
  14. 04 11月, 2009 2 次提交
    • C
      Improve error reporting for virConnectGetHostname calls · 517761fd
      Cole Robinson 提交于
      All drivers have copy + pasted inadequate error reporting which wraps
      util.c:virGetHostname. Move all error reporting to this function, and improve
      what we report.
      
      Changes from v1:
        Drop the driver wrappers around virGetHostname. This means we still need
        to keep the new conn argument to virGetHostname, but I think it's worth
        it.
      517761fd
    • L
      Support reporting live interface IP/netmask · 753c6c9c
      Laine Stump 提交于
      This patch adds the flag VIR_INTERFACE_XML_INACTIVE to
      virInterfaceGetXMLDesc's flags. When it is*not* set (the default), the
      live interface info will be returned in the XML (in particular, the IP
      address(es) and netmask(s) will be retrieved by querying the interface
      directly, rather than  reporting what's in the config file). The
      backend of this is in netcf's ncf_if_xml_state() function.
      
      * configure.in libvirt.spec.in: requires netcf >= 0.1.3
      * include/libvirt/libvirt.h.in: adds flag VIR_INTERFACE_XML_INACTIVE
      * src/conf/interface_conf.c src/interface/netcf_driver.c src/libvirt.c:
        update the parsing and backend routines accordingly
      * tools/virsh.c: change interface edit to inactive definition and
        adds the inactive flag for interface dump
      753c6c9c
  15. 21 10月, 2009 1 次提交
  16. 14 10月, 2009 1 次提交
    • C
      Finer grained migration control · 2d8d9b10
      Chris Lalancette 提交于
      Normally, when you migrate a domain from host A to host B,
      the domain on host A remains defined but shutoff and the domain
      on host B remains running but is a "transient".  Add a new
      flag to virDomainMigrate() to allow the original domain to be
      undefined on source host A, and a new flag to virDomainMigrate() to
      allow the new domain to be persisted on the destination host B.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      2d8d9b10
  17. 09 10月, 2009 1 次提交
    • D
      Support a new peer-to-peer migration mode & public API · fae0da5c
      Daniel P. Berrange 提交于
      Introduces several new public API options for migration
      
       - VIR_MIGRATE_PEER2PEER: With this flag the client only
         invokes the virDomainMigratePerform method, expecting
         the source host driver to do whatever is required to
         complete the entire migration process.
       - VIR_MIGRATE_TUNNELLED: With this flag the actual data
         for migration will be tunnelled over the libvirtd RPC
         channel. This requires that VIR_MIGRATE_PEER2PEER is
         also set.
       - virDomainMigrateToURI: This is variant of the existing
         virDomainMigrate method which does not require any
         virConnectPtr for the destination host. Given suitable
         driver support, this allows for all the same modes as
         virDomainMigrate()
      
      The URI for VIR_MIGRATE_PEER2PEER must be a valid libvirt
      URI. For non-p2p migration a hypervisor specific migration
      URI is used.
      
      virDomainMigrateToURI without a PEER2PEER flag is only
      support for Xen currently, and it involves XenD talking
      directly to XenD, no libvirtd involved at all.
      
      * include/libvirt/libvirt.h.in: Add VIR_MIGRATE_PEER2PEER
        flag for migration
      * src/libvirt_internal.h: Add feature flags for peer to
        peer migration (VIR_FEATURE_MIGRATE_P2P) and direct
        migration (VIR_MIGRATE_PEER2PEER mode)
      * src/libvirt.c: Implement support for VIR_MIGRATE_PEER2PEER
        and virDomainMigrateToURI APIs.
      * src/xen/xen_driver.c: Advertise support for DIRECT migration
      * src/xen/xend_internal.c: Add TODO item for p2p migration
      * src/libvirt_public.syms: Export virDomainMigrateToURI
        method
      * src/qemu/qemu_driver.c: Add support for PEER2PEER and
        migration, and adapt TUNNELLED migration.
      * tools/virsh.c: Add --p2p and --direct args and use the
        new virDomainMigrateToURI method where possible.
      fae0da5c
  18. 02 10月, 2009 1 次提交
  19. 29 9月, 2009 1 次提交
    • J
      Avoid double free in errors in virsh · 1caa19cb
      Jim Fehlig 提交于
      * tools/virsh.c: it was possible to get vshDeinit to call itself back
        via vshError, remove the doexit parameter of vshError to avoid the
        possibility and make sure to exit directly after in those case.
      1caa19cb
  20. 21 9月, 2009 1 次提交
    • D
      Move virsh into tools/ directory · 7ff256ec
      Daniel P. Berrange 提交于
      Move the virsh tool and its man page into the tools directory
      
      * Makefile.am: Remove rules for virsh.1 man page
      * virsh.1: Remove auto-generated file
      * docs/Makefile.am: Remove rules for virsh.pod man page
      * docs/virsh.pod: Move to tools/ directory
      * src/Makefile.am, src/.gitignore: Remove rules for virsh
      * src/console.c, src/console.h, src/*.ico, src/virsh_win_icon.rc,
        src/virsh.c: Move into tools/ directory
      * tools/Makefile.am: Add rules for building virsh
      * tools/.gitignore: Ignore virsh built files
      * tests/virshtest.c, tests/int-overflow: Update for new
        virsh location
      7ff256ec
  21. 15 9月, 2009 2 次提交
    • D
      Add usage type/id as a public API property of virSecret · a2a30038
      Daniel P. Berrange 提交于
      * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add
        virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage
      * python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID
        as not throwing exceptions
      * qemud/remote.c: Implement dispatch for virLookupSecretByUsage
      * qemud/remote_protocol.x: Add usage type & ID as attributes of
        remote_nonnull_secret. Add RPC calls for new public APIs
      * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
        qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
        qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
      * src/datatypes.c, src/datatypes.h: Add usageType and usageID as
        properties of virSecretPtr
      * src/driver.h: Add virLookupSecretByUsage driver entry point
      * src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID
        and virLookupSecretByUsage
      * src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID
        and virLookupSecretByUsage
      * src/remote_internal.c: Implement virLookupSecretByUsage entry
      * src/secret_conf.c, src/secret_conf.h: Remove the
        virSecretUsageType enum, now in public API. Make volume
        path mandatory when parsing XML
      * src/secret_driver.c: Enforce usage uniqueness when defining secrets.
        Implement virSecretLookupByUsage api method
      * src/virsh.c: Include usage for secret-list command
      a2a30038
    • D
      Fix UUID handling in secrets/storage encryption APIs · 47e7a258
      Daniel P. Berrange 提交于
      Convert all the secret/storage encryption APIs / wire format to
      handle UUIDs in raw format instead of non-canonical printable
      format. Guarentees data format correctness.
      
      * docs/schemas/storageencryption.rng: Make UUID mandatory for a secret
        and validate fully
      * docs/schemas/secret.rng: Fully validate UUID
      * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add
        virSecretLookupByUUID and virSecretGetUUID. Make
        virSecretGetUUIDString follow normal API design pattern
      * python/generator.py: Skip generation of virSecretGetUUID,
        virSecretGetUUIDString and virSecretLookupByUUID
      * python/libvir.c, python/libvirt-python-api.xml: Manual impl
        of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID
      * qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/
        Fix get_nonnull_secret/make_nonnull_secret to use unsigned char
      * qemud/remote_protocol.x: Fix remote_nonnull_secret to use a
        remote_uuid instead of remote_nonnull_string for UUID field.
        Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to
        REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an
        remote_uuid  value
      * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
        qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
        qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
      * src/datatypes.h, src/datatypes.c: Store UUID in raw format instead
        of printable. Change virGetSecret to use raw format UUID
      * src/driver.h: Rename virDrvSecretLookupByUUIDString to
        virDrvSecretLookupByUUID and use raw format UUID
      * src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID
        and re-implement virSecretLookupByUUIDString and
        virSecretGetUUIDString in terms of those
      * src/libvirt_public.syms: Add virSecretLookupByUUID and
        virSecretGetUUID
      * src/remote_internal.c: Rename remoteSecretLookupByUUIDString
        to remoteSecretLookupByUUID. Fix typo in args for
        remoteSecretDefineXML impl. Use raw UUID format for
        get_nonnull_secret and make_nonnull_secret
      * src/storage_encryption_conf.c, src/storage_encryption_conf.h:
        Storage UUID in raw format, and require it to be present in
        XML. Use UUID parser to validate.
      * secret_conf.h, secret_conf.c: Generate a UUID if none is provided.
        Storage UUID in raw format.
      * src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets
        in a filed with printable UUID, instead of base64 UUID.
      * src/virsh.c: Adjust for changed public API contract of
        virSecretGetUUIDString.
      * src/storage_Backend.c: DOn't undefine secret we just generated
        upon successful volume creation. Fix to handle raw UUIDs. Generate
        a non-clashing UUID
      * src/qemu_driver.c: Change to use lookupByUUID instead of
        lookupByUUIDString
      47e7a258
  22. 11 9月, 2009 1 次提交
  23. 04 9月, 2009 1 次提交
  24. 28 8月, 2009 1 次提交
  25. 18 8月, 2009 1 次提交
    • M
      Cosmetic change to 'virsh nodedev-list --tree' output · 097c818b
      Mark McLoughlin 提交于
      Maybe it's just me, but I try to select an item from the tree using
      double-click and get annoyed when "+-" gets included in the selection.
      
      * src/virsh.c: add a space between "+-" and the node device name
        in 'virsh nodedev-list --tree'
      097c818b
  26. 24 7月, 2009 2 次提交
    • D
      Implement schedular tunables API using cgroups · 55bc5090
      Daniel P. Berrange 提交于
      * src/qemu_driver.c:  Add driver methods qemuGetSchedulerType,
        qemuGetSchedulerParameters, qemuSetSchedulerParameters
      * src/lxc_driver.c: Fix to use unsigned long long consistently
        for schedular parameters
      * src/cgroup.h, src/cgroup.c: Fix cpu_shares to take unsigned
        long long
      * src/util.c, src/util.h, src/libvirt_private.syms: Add a
        virStrToDouble helper
      * src/virsh.c: Fix handling of --set arg to schedinfo command
        to honour the designated data type of each schedular tunable
        as declared by the driver
      55bc5090
    • L
      Add bare format string to printf-derivatives troubles · 165ed4a0
      Laine Stump 提交于
      * src/datatypes.c src/domain_conf.c src/interface_conf.c
        src/lxc_driver.c src/qemu_driver.c src/storage_backend.c src/virsh.c:
        add bare %s format string to printf-derivatives called with no format
        string
      165ed4a0
  27. 23 7月, 2009 1 次提交
    • D
      Fix misc Win32 compile warnings · 899ae0d2
      Daniel P. Berrange 提交于
      GCC >= 4.4 assumes the 'printf' attribute refers to the native
      runtime libraries format specifiers. Thanks to gnulib, libvirt
      has GNU format specifiers everywhere.  This means we need to
      use 'gnu_printf' with GCC >= 4.4 to get correct compiler
      checking of printf format specifiers.
      
      * HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
      * autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
        driver on mingw32 builds
      * qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
        src/logging.h, src/security.h, src/sexpr.h, src/util.h,
        src/virterror_internal.h, src/xend_internal.c: Change
        over to ATTRIBUTE_FMT_PRINTF.
      * src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
        since they don't compile
      * src/threads-win32.c: Add missing return value check
      899ae0d2
  28. 22 7月, 2009 2 次提交
  29. 17 7月, 2009 2 次提交