1. 30 9月, 2009 7 次提交
    • M
      Add virStorageFileGetMetadata() helper · 295fd6e8
      Mark McLoughlin 提交于
      * src/util/storage_file.c: add virStorageFileGetMetadata() so that
        the caller does not need to open the file
      295fd6e8
    • M
      Move virStorageGetMetadataFromFD() to libvirt_util · a010fb58
      Mark McLoughlin 提交于
      Finally, we get to the point of all this.
      
      Move virStorageGetMetadataFromFD() to virStorageFileGetMetadataFromFD()
      and move to src/util/storage_file.[ch]
      
      There's no functional changes in this patch, just code movement
      
      * src/storage/storage_backend_fs.c: move code from here ...
      
      * src/util/storage_file.[ch]: ... to here
      
      * src/libvirt_private.syms: export virStorageFileGetMetadataFromFD()
      a010fb58
    • M
      Introduce virStorageFileMetadata structure · 5fede0a9
      Mark McLoughlin 提交于
      Introduce a metadata structure and make virStorageGetMetadataFromFD()
      fill it in.
      
      * src/util/storage_file.h: add virStorageFileMetadata
      
      * src/backend/storage_backend_fs.c: virStorageGetMetadataFromFD() now
        fills in the virStorageFileMetadata structure
      5fede0a9
    • M
      Split virStorageGetMetadataFromFD() from virStorageBackendProbeTarget() · f5fc6706
      Mark McLoughlin 提交于
      Prepare the code probing a file's format and associated metadata for
      moving into libvirt_util.
      
      * src/storage/storage_backend_fs.c: re-factor the format and metadata
        probing code in preparation for moving it
      f5fc6706
    • M
      Move file format enum to libvirt_util · 00fd3ff4
      Mark McLoughlin 提交于
      Rename virStorageVolFormatFileSystem to virStorageFileFormat and
      move to src/util/storage_file.[ch]
      
      * src/Makefile.am: add src/util/storage_file.[ch]
      
      * src/conf/storage_conf.[ch]: move enum from here ...
      
      * src/util/storage_file.[ch]: .. to here
      
      * src/libvirt_private.syms: update To/FromString exports
      
      * src/storage/storage_backend.c, src/storage/storage_backend_fs.c,
        src/vbox/vbox_tmpl.c: update for above changes
      00fd3ff4
    • M
      Fix memory leaks in libvirtd's message processing · c6f1459e
      Matthias Bolte 提交于
      Commit 47cab734 changed the way how
      qemud_client_message objects were reused. Before this commit
      remoteDispatchClientRequest() reused the received message for normal responses
      and to report non-fatal errors. If a fatal error occurred qemudWorker() frees
      the message. After this commit non-fatal errors are reported by
      remoteSerializeReplyError() using a new qemud_client_message object and the
      original message leaks.
      
      To fix this leak the original message has to be freed if
      remoteSerializeReplyError() succeeds. If remoteSerializeReplyError()
      fails the original message is freed in qemudWorker().
      
      * daemon/dispatch.c: free qemud_client_message objects that will not be reused
        and would leak otherwise, also free the allocated qemud_client_message object
        in remoteSerializeError() if an error occurs
      c6f1459e
    • D
      Fix QEMU test suite with new VNC env variable · 727cda9d
      Daniel P. Berrange 提交于
      * qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args,
        qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args,
        qemuxml2argvdata/qemuxml2argv-graphics-vnc.args,
        qemuxml2argvdata/qemuxml2argv-input-xen.args: Add in
        QEMU_AUDIO_DRV=none env variable
      727cda9d
  2. 29 9月, 2009 33 次提交
    • P
      VBox vboxDomainDestroy forgot to wait for completion · 970135f6
      Pritesh Kothari 提交于
      * src/vbox/vbox_tmpl.c: the vboxDomainDestroy forgot to wait for
        completion of the PowerDown command
      970135f6
    • D
      Remove hand-crafted UUID parsers · d9b285d7
      Daniel P. Berrange 提交于
      * src/libvirt.c: Remove hand-crafted UUID parsers in favour of
        calling virParseUUID
      d9b285d7
    • D
      Allow control over QEMU audio backend · b08e6d38
      Daniel P. Berrange 提交于
      When using VNC for graphics + keyboard + mouse, we shouldn't
      then use the host OS for audio. Audio should go back over
      VNC.
      
      When using SDL for graphics, we should use the host OS for
      audio since that's where the display is. We need to allow
      certain QEMU env variables to be passed through to guest
      too to allow choice of QEMU audio backend.
      
      * qemud/libvirtd.sysconf: Mention QEMU/SDL audio env vars
      * src/qemu_conf.c: Passthrough QEMU/SDL audio env for SDL display,
        disable host audio for VNC display
      b08e6d38
    • D
      Handle data streams in remote client · 401c4048
      Daniel P. Berrange 提交于
      * src/remote_internal.c: Add helper APIs for processing data streams
      401c4048
    • D
      Handle outgoing data streams in libvirtd · 4f17809a
      Daniel P. Berrange 提交于
      * daemon/dispatch.c: Set streamTX flag on outgoing data packets
      * daemon/qemud.h: Add streamTX flag to track outgoing data
      * daemon/qemud.c: Re-enable further TX when outgoing data packet
        has been fully sent.
      * daemon/stream.h, daemon/stream.c: Add method for enabling TX.
        Support reading from streams and transmitting data out to client
      4f17809a
    • D
      Handle incoming data streams in libvirtd · d790a66d
      Daniel P. Berrange 提交于
      * daemon/stream.c: Handle incoming stream data packets, queuing until
        stream becomes writable. Handle stream completion handshake
      * po/POTFILES.in: Add daemon/stream.c
      d790a66d
    • D
      Helper functions for processing data streams in libvirtd · 11573f3e
      Daniel P. Berrange 提交于
      Defines the extensions to the remote protocol for generic
      data streams. Adds a bunch of helper code to the libvirtd
      daemon for working with data streams.
      
      * daemon/Makefile.am: Add stream.c/stream.h to build
      * daemon/stream.c, qemud/stream.h: Generic helper functions for
        creating new streams, associating streams with clients, finding
        existing streams for a client and removing/deleting streams.
      * src/remote/remote_protocol.x: Add a new 'REMOTE_STREAM' constant
        for the 'enum remote_message_type' for encoding stream data
        in wire messages. Add a new 'REMOTE_CONTINUE' constant to
        'enum remote_message_status' to indicate further data stream
        messsages are expected to follow.  Document how the
        remote_message_header is used to encode data streams
      * src/remote/remote_protocol.h: Regenerate
      * daemon/dispatch.c: Remove assumption that a error message
        sent to client is always type=REMOTE_REPLY. It may now
        also be type=REMOTE_STREAM. Add convenient method for
        sending outgoing stream data packets. Log and ignore
        non-filtered incoming stream packets. Add a method for
        serializing a stream error message
      * daemon/dispatch.h:  Add API for serializing stream errors
        and sending stream data packets
      * daemon/qemud.h: Add struct qemud_client_stream for tracking
        active data streams for clients. Tweak filter function
        operation so that it accepts a client object too.
      * daemon/qemud.c: Refactor code for free'ing message objects
        which have been fully transmitted into separate method.
        Release all active streams when client shuts down. Change
        filter function to be responsible for queueing the message
      11573f3e
    • D
      Add public API definition for data stream handling · 182eba1b
      Daniel P. Berrange 提交于
      * include/libvirt/libvirt.h.in: Public API contract for
        virStreamPtr object
      * src/libvirt_public.syms: Export data stream APIs
      * src/libvirt_private.syms: Export internal helper APIs
      * src/libvirt.c: Data stream API driver dispatch
      * src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr
        object
      * src/driver.h: Define internal driver API for streams
      * .x-sc_avoid_write: Ignore src/libvirt.c because it trips
        up on comments including write()
      * python/Makefile.am: Add libvirt-override-virStream.py
      * python/generator.py: Add rules for virStreamPtr class
      * python/typewrappers.h, python/typewrappers.c: Wrapper
        for virStreamPtr
      * docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate
        with new APIs
      182eba1b
    • P
      Vbox call OpenHardDisk with "" instead of NULL · d9e66a62
      Pritesh Kothari 提交于
      * src/vbox/vbox_tmpl.c: UTF-16 fixed version of Florian Vichot initial
        patch
      d9e66a62
    • 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
    • D
      Fix crash in device hotplug cleanup code · 879cd8cc
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Fix crash in scenario where XML
        parsing of hotplugged device failed & thus 'dev' is NULL
      879cd8cc
    • D
      Standardize debugging messages in QEMU monitor code · 46da3550
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor_text.c: Always print command and reply
        in qemuMonitorCommandWithHandler. Print all args in each monitor
        command API & remove redundant relpy printing
      46da3550
    • D
      Remove low level monitor APIs from header file · 79f45855
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor_text.h: Remove qemudMonitorCommand,
        qemudMonitorCommandWithFd, qemudMonitorCommandWithHandler,
        qemudMonitorCommandExtra low level APIs
      * src/qemu/qemu_monitor_text.c: Replace s/qemud/qemuMonitor/
      79f45855
    • D
      Add API for issuing 'host_net_remove' monitor command · b06c97e5
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new
        qemuMonitorRemoveHostNetwork() command for removing host
        networks
      * src/qemu/qemu_driver.c: Convert NIC hotplug methods over
        to use qemuMonitorRemoveHostNetwork()
      b06c97e5
    • D
      Add API for issuing 'host_net_add' monitor command · 4c10127b
      Daniel P. Berrange 提交于
      * src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Remove prefix arg
        from qemuBuildHostNetStr which is no longer required
      * src/qemu/qemu_driver.c: Refactor to use qemuMonitorAddHostNetwork()
        API for adding host network
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorAddHostNetwork() method for adding host networks
      4c10127b
    • D
      Add API for issuing 'pci_add nic' monitor command · f8d54e7c
      Daniel P. Berrange 提交于
      * src/qemu/qemu_conf.c: Remove separator from qemuBuildNicStr()
        args, and remove hardcoded 'nic' prefix. Leave it upto callers
        instead
      * src/qemu/qemu_driver.c: Switch over to using the new
        qemuMonitorAddPCINetwork() method for NIC hotplug
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorAddPCINetwork API for PCI network device hotplug
      f8d54e7c
    • D
      Add API for issuing 'getfd' and 'closefd' monitor commands · aadab515
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorCloseFileHandle and qemuMonitorSendFileHandle
        APIs for processing file handles
      * src/qemu/qemu_driver.c: Convert NIC hotplug method over to
        use   qemuMonitorCloseFileHandle and qemuMonitorSendFileHandle
      aadab515
    • D
      Add API for issuing 'pci_add storage' monitor command · 85df9339
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        API qemuMonitorAddPCIDisk()
      * src/qemu/qemu_driver.c: Convert over to using the new
        qemuMonitorAddPCIDisk() method, and remove now obsolete
        qemudEscape() method
      85df9339
    • D
      Add API for issuing 'pci_del' monitor command · 3e11f9ff
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new API
        qemuMonitorRemovePCIDevice() for removing PCI device
      * src/qemu/qemu_driver.c: Convert all places removing PCI devices
        over to new qemuMonitorRemovePCIDevice() API
      3e11f9ff
    • D
      Add API for issuing 'pci_add host' monitor command · e7f38d96
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        API qemuMonitorAddPCIHostDevice()
      * src/qemu/qemu_driver.c: Switch to using qemuMonitorAddPCIHostDevice()
        for PCI host device hotplug
      e7f38d96
    • D
      Add APIs for sending 'usb_add' command for host devices · 61ea9c89
      Daniel P. Berrange 提交于
      One API adds an exact device based on bus+dev, the other adds
      any device matching vendor+product
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorAddUSBDeviceExact() and qemuMonitorAddUSBDeviceMatch()
        commands.
      * src/qemu/qemu_driver.c: Switch over to using the new
          qemuMonitorAddUSBDeviceExact() and qemuMonitorAddUSBDeviceMatch()
      61ea9c89
    • D
      Add API for using 'usb_add' for disk devices · f566c592
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorAddUSBDisk() API
      * src/qemu/qemu_driver.c: Switch USB disk hotplug to the new
        src/qemu/qemu_driver.c API.
      f566c592
    • D
      Add API for issuing 'migrate' command with exec protocol · ed2a10a1
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorMigrateToCommand() API
      * src/qemu/qemu_driver.c: Switch over to using the
        qemuMonitorMigrateToCommand() API for core dumps and save
        to file APIs
      ed2a10a1
    • D
      Add API for issuing a 'migrate' monitor command for TCP · 81f3edea
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new API
        qemuMonitorMigrateToHost() for doing TCP migration
      * src/qemu/qemu_driver.c: Convert to use qemuMonitorMigrateToHost().
        Also handle proper URIs (tcp:// as well as tcp:)
      81f3edea
    • D
      Add API for running 'info migration' monitor command · d7a3c835
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorGetMigrationStatus() command.
      * src/qemu/qemu_driver.c: Use new qemuMonitorGetMigrationStatus()
        command to check completion status.
      d7a3c835
    • D
      Add API for issuing the 'migrate_set_speed' monitor command · bdc8861a
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Use new qemuMonitorSetMigrationSpeed()
        API during migration
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new
        qemuMonitorSetMigrationSpeed() API
      bdc8861a
    • D
      Add API for issuing 'info blockstats' command · f225e560
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a new
        qemuMonitorGetBlockStatsInfo() command
      * src/qemu/qemu_driver.c: Remove directly use of blockstats in
        favour of calling qemuMonitorGetBlockStatsInfo()
      f225e560
    • D
      Add APIs for issuing 'memsave' and 'pmemsave' monitor commands · 316e9f90
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new APIs
        qemuMonitorSaveVirtualMemory() and qemuMonitorSavePhysicalMemory()
      * src/qemu/qemu_driver.c: Use the new qemuMonitorSaveVirtualMemory()
        and qemuMonitorSavePhysicalMemory() APIs
      316e9f90
    • D
      Add APIs for issuing 'eject' and 'change dev' monitor commands · 6d9c4758
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new APis
        qemuMonitorChangeMedia and qemuMonitorEjectMedia. Pull in code
        for qemudEscape
      * src/qemu/qemu_driver.c: Remove code that directly issues 'eject'
        and 'change' commands in favour of API calls.
      6d9c4758
    • D
      Add API for issuing 'balloon' monitor command · eff29c8b
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorSetBalloon() based on existing code in
        qemudDomainSetMemoryBalloon
      * src/qemu/qemu_driver.c: Remove use of qemudDomainSetMemoryBalloon()
        in favour of qemuMonitorSetBalloon(). Fix error code when balloon
        is not supported
      eff29c8b
    • D
      Add API for running 'info balloon' monitor command · 6f19c16c
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Pull old
        qemudDomainGetMemoryBalloon() code into a new method called
        qemuMonitorGetBalloonInfo()
      * src/qemu/qemu_driver.c: Update to call qemuMonitorGetBalloonInfo()
        and remove qemudDomainGetMemoryBalloon().
      6f19c16c
    • D
      Add API for the 'system_powerdown' monitor command · 19d70c7d
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Remove use of 'system_powerdown'
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new
        qemuMonitorSystemPowerdown() api call
      19d70c7d
    • D
      Add API for 'stop' monitor command · 1e64d8c7
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a new
        qemuMonitorStopCPUs() API
      * src/qemu/qemu_driver.c: Replace direct monitor commands for 'stop'
        with qemuMonitorStopCPUs()
      1e64d8c7