1. 27 3月, 2010 1 次提交
  2. 26 3月, 2010 7 次提交
    • D
      Implement VNC password change in QEMU · ab952024
      Daniel P. Berrange 提交于
      Use the new virDomainUpdateDeviceFlags API to allow the VNC password
      to be changed on the fly
      
      * src/internal.h: Define STREQ_NULLABLE() which is like STREQ()
        but does not crash if either argument is NULL, and treats two
        NULLs as equal.
      * src/libvirt_private.syms: Export virDomainGraphicsTypeToString
      * src/qemu/qemu_driver.c: Support VNC password change on a live
        machine
      * src/qemu/qemu_monitor.c: Disable crazy debugging info. Treat a
        NULL password as "" (empty string), allowing passwords to be
        disabled in the monitor
      ab952024
    • D
      Add domain events for graphics network clients · 987e31ed
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_GRAPHICS
      
      The same event can be emitted in 3 scenarios
      
        typedef enum {
            VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
            VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
            VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
        } virDomainEventGraphicsPhase;
      
      Connect/disconnect are triggered at socket accept/close.
      The initialize phase is immediately after the protocol
      setup and authentication has completed. ie when the
      client is authorized and about to start interacting with
      the graphical desktop
      
      This event comes with *a lot* of potential information
      
       - IP address, port & address family of client
       - IP address, port & address family of server
       - Authentication scheme (arbitrary string)
       - Authenticated subject identity. A subject may have
         multiple identities with some authentication schemes.
         For example, vencrypt+sasl results in a x509dname
         and saslUsername identities.
      
      This results in a very complicated callback :-(
      
         typedef enum {
            VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
            VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
         } virDomainEventGraphicsAddressType;
      
         struct _virDomainEventGraphicsAddress {
             int family;
             const char *node;
             const char *service;
         };
         typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
         typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
      
         struct _virDomainEventGraphicsSubject {
            int nidentity;
            struct {
                const char *type;
                const char *name;
            } *identities;
         };
         typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
         typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
      
         typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
                                                               virDomainPtr dom,
                                                               int phase,
                                                               virDomainEventGraphicsAddressPtr local,
                                                               virDomainEventGraphicsAddressPtr remote,
                                                               const char *authScheme,
                                                               virDomainEventGraphicsSubjectPtr subject,
                                                               void *opaque);
      
      The wire protocol is similarly complex
      
         struct remote_domain_event_graphics_address {
           int family;
           remote_nonnull_string node;
           remote_nonnull_string service;
         };
      
         const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
      
         struct remote_domain_event_graphics_identity {
           remote_nonnull_string type;
           remote_nonnull_string name;
         };
      
         struct remote_domain_event_graphics_msg {
           remote_nonnull_domain dom;
           int phase;
           remote_domain_event_graphics_address local;
           remote_domain_event_graphics_address remote;
           remote_nonnull_string authScheme;
           remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
         };
      
      This is currently implemented in QEMU for the VNC graphics
      protocol, but designed to be usable with SPICE graphics in
      the future too.
      
      * daemon/remote.c: Dispatch graphics events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        graphics events
      * include/libvirt/libvirt.h.in: Define new graphics event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle graphics events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for VNC events and emit a libvirt graphics event
      * src/remote/remote_driver.c: Receive and dispatch graphics
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        graphics events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
        VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
      987e31ed
    • D
      Add support for an explicit IO error event · 71d793fa
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_IO_ERROR
      
      This event includes the action that is about to be taken
      as a result of the watchdog triggering
      
        typedef enum {
           VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
           VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
           VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
        } virDomainEventIOErrorAction;
      
      In addition it has the source path of the disk that had the
      error and its unique device alias. It does not include the
      target device name (/dev/sda), since this would preclude
      triggering IO errors from other file backed devices (eg
      serial ports connected to a file)
      
      Thus there is a new callback definition for this event type
      
      typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
                                                           virDomainPtr dom,
                                                           const char *srcPath,
                                                           const char *devAlias,
                                                           int action,
                                                           void *opaque);
      
      This is currently wired up to the QEMU block IO error events
      
      * daemon/remote.c: Dispatch IO error events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        IO error events
      * include/libvirt/libvirt.h.in: Define new IO error event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle IO error events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block IO errors and emit a libvirt IO error event
      * src/remote/remote_driver.c: Receive and dispatch IO error
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        IO error events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
        from QEMU monitor
      71d793fa
    • D
      Add support for an explicit watchdog event · c5728cd6
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_WATCHDOG
      
      This event includes the action that is about to be taken
      as a result of the watchdog triggering
      
       typedef enum {
           VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
           VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
           VIR_DOMAIN_EVENT_WATCHDOG_RESET,
           VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
           VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
           VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
       } virDomainEventWatchdogAction;
      
      Thus there is a new callback definition for this event type
      
       typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
                                                             virDomainPtr dom,
                                                             int action,
                                                             void *opaque);
      
      * daemon/remote.c: Dispatch watchdog events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        watchdog events
      * include/libvirt/libvirt.h.in: Define new watchdg event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle watchdog events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for watchdogs and emit a libvirt watchdog event
      * src/remote/remote_driver.c: Receive and dispatch watchdog
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        watchdog events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
        from QEMU monitor
      c5728cd6
    • D
      Add support for an explicit RTC change event · 32e6ac9c
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_RTC_CHANGE
      
      This event includes the new UTC offset measured in seconds.
      Thus there is a new callback definition for this event type
      
       typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn,
                                                              virDomainPtr dom,
                                                              long long utcoffset,
                                                              void *opaque);
      
      If the guest XML configuration for the <clock> is set to
      offset='variable', then the XML will automatically be
      updated with the new UTC offset value. This ensures that
      during migration/save/restore the new offset is preserved.
      
      * daemon/remote.c: Dispatch RTC change events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        RTC change events
      * include/libvirt/libvirt.h.in: Define new RTC change event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle RTC change events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for RTC changes and emit a libvirt RTC change event
      * src/remote/remote_driver.c: Receive and dispatch RTC change
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        RTC change events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for RTC_CHANGE event
        from QEMU monitor
      32e6ac9c
    • D
      Add support for an explicit guest reboot event · 86132734
      Daniel P. Berrange 提交于
      The reboot event is not a normal lifecycle event, since the
      virtual machine on the host does not change state. Rather the
      guest OS is resetting the virtual CPUs. ie, the QEMU process
      does not restart. Thus, this does not belong in the current
      lifecycle events callback.
      
      This introduces a new event type
      
          VIR_DOMAIN_EVENT_ID_REBOOT
      
      It takes no parameters, besides the virDomainPtr, so it can
      use the generic callback signature.
      
      * daemon/remote.c: Dispatch reboot events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        reboot events
      * include/libvirt/libvirt.h.in: Define new reboot event ID
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle reboot events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for reboots and emit a libvirt reboot event
      * src/remote/remote_driver.c: Receive and dispatch reboot
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        reboot events
      86132734
    • D
      Add new internal domain events APIs for handling other event types · b7d4c300
      Daniel P. Berrange 提交于
      The current internal domain events API tracks callbacks based on
      the function pointer, and only supports lifecycle events. This
      adds new internal APIs for registering callbacks for other event
      types. These new APIs are postfixed with the word 'ID' to indicate
      that they operated based on event ID, instead of hardcoded to
      lifecycle events
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Add new APIs for handling callbacks
        for non-lifecycle events
      b7d4c300
  3. 23 3月, 2010 2 次提交
  4. 05 3月, 2010 1 次提交
    • D
      Fix USB passthrough based on product/vendor · 09ed0729
      Daniel P. Berrange 提交于
      Changeset
      
        commit 5073aa99
        Author: Cole Robinson <crobinso@redhat.com>
        Date:   Mon Jan 11 11:40:46 2010 -0500
      
      Added support for product/vendor based passthrough, but it only
      worked at the security driver layer. The main guest XML config
      was not updated with the resolved bus/device ID. When the QEMU
      argv refactoring removed use of product/vendor, this then broke
      launching guests.
      
      THe solution is to move the product/vendor resolution up a layer
      into the QEMU driver. So the first thing QEMU does is resolve
      the product/vendor to a bus/device and updates the XML config
      with this info. The rest of the code, including security drivers
      and QEMU argv generated can now rely on bus/device always being
      set.
      
      * src/util/hostusb.c, src/util/hostusb.h: Split vendor/product
        resolution code out of usbGetDevice and into usbFindDevice.
        Add accessors for bus/device ID
      * src/security/virt-aa-helper.c, src/security/security_selinux.c,
        src/qemu/qemu_security_dac.c: Remove vendor/product from the
        usbGetDevice() calls
      * src/qemu/qemu_driver.c: Use usbFindDevice to resolve vendor/product
        into a bus/device ID
      09ed0729
  5. 02 3月, 2010 2 次提交
    • D
      Add new clock mode allowing variable adjustments · b9e2967a
      Daniel P. Berrange 提交于
      This introduces a third option for clock offset synchronization,
      that allows an arbitrary / variable adjustment to be set. In
      essence the XML contains the time delta in seconds, relative to
      UTC.
      
        <clock offset='variable' adjustment='123465'/>
      
      The difference from 'utc' mode, is that management apps should
      track adjustments and preserve them at next reboot.
      
      * docs/schemas/domain.rng: Schema for new clock mode
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
        new clock time delta
      * src/libvirt_private.syms, src/util/xml.c, src/util/xml.h: Add
        virXPathLongLong() method
      b9e2967a
    • D
      Change the internal domain conf representation of localtime/utc · eed2f8c3
      Daniel P. Berrange 提交于
      The XML will soon be extended to allow more than just a simple
      localtime/utc boolean flag. This change replaces the plain
      'int localtime' with a separate struct to prepare for future
      extension
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add a new
        virDomainClockDef structure
      * src/libvirt_private.syms: Export virDomainClockOffsetTypeToString
        and virDomainClockOffsetTypeFromString
      * src/qemu/qemu_conf.c, src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
        src/xen/xm_internal.c: Updated to use new structure for localtime
      eed2f8c3
  6. 19 2月, 2010 2 次提交
    • C
      Better error reporting for failed migration · b97c24b2
      Chris Lalancette 提交于
      If the hostname as returned by "gethostname" resolves
      to "localhost" (as it does with the broken Fedora-12
      installer), then live migration will fail because the
      source will try to migrate to itself.  Detect this
      situation up-front and abort the live migration before
      we do any real work.
      
      * src/util/util.h src/util/util.c: add a new virGetHostnameLocalhost
        with an optional localhost check, and rewire virGetHostname() to use
        it
      * src/libvirt_private.syms: expose the new function
      * src/qemu/qemu_driver.c: use it in qemudDomainMigratePrepare2()
      b97c24b2
    • M
      Add domain support for virtio channel · 7813a0f8
      Matthew Booth 提交于
      Add support for virtio-serial by defining a new 'virtio' channel target type
      and a virtio-serial controller. Allows the following to be specified in a
      domain:
      
      <controller type='virtio-serial' index='0' ports='16' vectors='4'/>
      <channel type='pty'>
        <target type='virtio' name='org.linux-kvm.port.0'/>
        <address type='virtio-serial' controller='0' bus='0'/>
      </channel>
      
      * docs/schemas/domain.rng: Add virtio-serial controller and virtio
        channel type.
      * src/conf/domain_conf.[ch]: Domain parsing/serialization for
        virtio-serial controller and virtio channel.
      * tests/qemuxml2xmltest.c
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: add domain xml
        parsing test
      * src/libvirt_private.syms src/qemu/qemu_conf.c:
        virDomainDefAddDiskControllers() renamed to
        virDomainDefAddImplicitControllers()
      7813a0f8
  7. 18 2月, 2010 1 次提交
    • M
      Remove unused functions from domain_conf · 07e318b3
      Matthew Booth 提交于
      Remove virDomainDevicePCIAddressEqual and virDomainDeviceDriveAddressEqual,
      which are defined but not used anywhere.
      
      * src/conf/domain_conf.[ch] src/libvirt_private.syms: Remove
        virDomainDevicePCIAddressEqual and virDomainDeviceDriveAddressEqual.
      07e318b3
  8. 12 2月, 2010 1 次提交
  9. 04 2月, 2010 1 次提交
    • C
      Fix log locking problem when using fork() in the library · cd0ef0e0
      Cole Robinson 提交于
      Ad pointed out by Dan Berrange:
      So if some thread in libvirtd is currently executing a logging call,
      while another thread calls virExec(), that other thread no longer
      exists in the child, but its lock is never released. So when the
      child then does virLogReset() it deadlocks.
      
      The only way I see to address this, is for the parent process to call
      virLogLock(), immediately before fork(), and then virLogUnlock()
      afterwards in both parent & child. This will ensure that no other
      thread
      can be holding the lock across fork().
      
      * src/util/logging.[ch] src/libvirt_private.syms: export virLogLock() and
        virLogUnlock()
      * src/util/util.c: lock just before forking and unlock just after - in
        both parent and child.
      cd0ef0e0
  10. 03 2月, 2010 1 次提交
  11. 27 1月, 2010 1 次提交
  12. 23 1月, 2010 1 次提交
    • C
      qemu: Fix race between device rebind and kvm cleanup · be34c3c7
      Chris Lalancette 提交于
      Certain hypervisors (like qemu/kvm) map the PCI bar(s) on
      the host when doing device passthrough.  This can lead to a race
      condition where the hypervisor is still cleaning up the device while
      libvirt is trying to re-attach it to the host device driver.  To avoid
      this situation, we look through /proc/iomem, and if the hypervisor is
      still holding onto the bar (denoted by the string in the matcher variable),
      then we can wait around a bit for that to clear up.
      
      v2: Thanks to review by DV, make sure we wait the full timeout per-device
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      be34c3c7
  13. 20 1月, 2010 1 次提交
    • J
      Tests for ACS in PCIe switches · 379eb395
      Jiri Denemark 提交于
      New pciDeviceIsAssignable() function for checking whether a given PCI
      device can be assigned to a guest was added. Currently it only checks
      for ACS being enabled on all PCIe switches between root and the PCI
      device. In the future, it could be the right place to check whether a
      device is unbound or bound to a stub driver.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      379eb395
  14. 18 1月, 2010 5 次提交
    • D
      Introduce device aliases · 5da9c980
      Daniel P. Berrange 提交于
      This patch introduces the support for giving all devices a short,
      unique name, henceforth known as a 'device alias'.  These aliases
      are not set by the end user, instead being assigned by the hypervisor
      if it decides it want to support this concept.
      
      The QEMU driver sets them whenever using the -device arg syntax
      and uses them for improved hotplug/hotunplug. it is the intent
      that other APIs (block / interface stats & device hotplug) be
      able to accept device alias names in the future.
      
      The XML syntax is
      
         <alias name="video0"/>
      
      This may appear in any type of device that supports device info.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add a 'alias'
        field to virDomainDeviceInfo struct & parse/format it in XML
      * src/libvirt_private.syms: Export virDomainDefClearDeviceAliases
      * src/qemu/qemu_conf.c: Replace use of "nic_name" field with the
        standard device alias
      * src/qemu/qemu_driver.c: Clear device aliases at shutdown
      5da9c980
    • D
      Clear assigned PCI devices at shutdown · 774c757e
      Daniel P. Berrange 提交于
      The PCI device addresses are only valid while the VM is running,
      since they are auto-assigned by QEMU. After shutdown they must
      all be cleared. Future QEMU driver enhancement will allow for
      persistent PCI address assignment
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c, src/libvirt_private.syms
        Add virDomainDefClearPCIAddresses() method for wiping out auto assigned
        PCI addresses
      * src/qemu/qemu_driver.c: Clear PCI addresses at VM shutdown
      774c757e
    • D
      Auto-add disk controllers based on defined disks · b030084f
      Daniel P. Berrange 提交于
      Existing applications using libvirt are not aware of the disk
      controller concept. Thus, after parsing the <disk> definitions
      in the XML, it is neccessary to create <controller> elements
      to satisfy all requested disks, as per their defined drive
      addresses
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add virDomainDefAddDiskControllers()
        method for populating disk controllers, and call it after
        parsing disk definitions.
      * src/qemu/qemu_conf.c: Call virDomainDefAddDiskControllers()
        when doing ARGV -> XML conversion
      * tests/qemuxml2argvdata/qemuxml2argv*.xml: Add disk controller
        data to all data files which don't have it already
      b030084f
    • D
      Properly support SCSI drive hotplug · 3a6bf1bb
      Daniel P. Berrange 提交于
      The current SCSI hotplug support attaches a brand new SCSI controller
      for every disk. This is broken because the semantics differ from those
      used when starting the VM initially. In the latter case, each SCSI
      controller is filled before a new one is added.
      
      If the user specifies an high drive index (sdazz) then at initial
      startup, many intermediate SCSI controllers may be added with no
      drives.
      
      This patch changes SCSI hotplug so that it exactly matches the
      behaviour of initial startup. First the SCSI controller number is
      determined for the drive to be hotplugged. If any controller upto
      and including that controller number is not yet present, it is
      attached. Then finally the drive is attached to the last controller.
      
      NB, this breaks SCSI hotunplug, because there is no 'drive_del'
      command in current QEMU. Previous SCSI hotunplug was broken in
      any case because it was unplugging the entire controller, not
      just the drive in question.
      
      A future QEMU will allow proper SCSI hotunplug of a drive.
      
      This patch is derived from work done by Wolfgang Mauerer on disk
      controllers.
      
      * src/qemu/qemu_driver.c: Fix SCSI hotplug to add a drive to
       the correct controller, instead of just attaching a new
        controller.
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        support for 'drive_add' command
      3a6bf1bb
    • W
      Implement SCSI controller hotplug/unplug for QEMU · da9d937b
      Wolfgang Mauerer 提交于
      This patch allows for explicit hotplug/unplug of SCSI controllers.
      Ordinarily this is not required, since QEMU/libvirt will attach
      a new SCSI controller whenever one is required. Allowing explicit
      hotplug of controllers though, enables the caller to specify a
      static PCI address, instead of auto-assigning the next available
      PCI slot. Or it will when we have static PCI addressing.
      
      This patch is derived from Wolfgang Mauerer's disk controller
      patch series.
      
      * src/qemu/qemu_driver.c: Support hotplug & unplug of SCSI
        controllers
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        new API for attaching PCI SCSI controllers
      da9d937b
  15. 16 1月, 2010 3 次提交
    • W
      Add new domain device: "controller" · 74ec5e65
      Wolfgang Mauerer 提交于
      This augments virDomainDevice with a <controller> element
      that is used to represent disk controllers (e.g., scsi
      controllers). The XML format is given by
      
        <controller type="scsi" index="<num>">
           <address type="pci" domain="0xNUM" bus="0xNUM" slot="0xNUM"/>
        </controller>
      
      where type denotes the disk interface (scsi, ide,...), index
      is an integer that identifies the controller for association
      with disks, and the <address> element specifies the controller
      address on the PCI bus as described in previous commits
      The address element can be omitted; in this case, an address
      will be assigned automatically.
      
      Most of the code in this patch is from Wolfgang Mauerer's
      previous disk controller series
      
       * docs/schemas/domain.rng: Define syntax for <controller>
         XML element
       * src/conf/domain_conf.c, src/conf/domain_conf.h: Define
         virDomainControllerDef struct, and routines for parsing
         and formatting XML
      * src/libvirt_private.syms: Add virDomainControllerInsert
         and virDomainControllerDefFree
      74ec5e65
    • D
      Set default disk controller/bus/unit props · 776e37e1
      Daniel P. Berrange 提交于
      When parsing the <disk> element specification, if no <address>
      is provided for the disk, then automatically assign one based on
      the <target dev='sdXX'/> device name. This provides for backwards
      compatability with existing applications using libvirt, while also
      allowing new apps to have complete fine grained control.
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c,
        src/libvirt_private.syms: Add virDomainDiskDefAssignAddress()
        for assigning a controller/bus/unit address based on disk target
      * src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after
        generating XML from ARGV
      * tests/qemuxml2argvdata/*.xml: Add in drive address information
        to all XML files
      776e37e1
    • D
      Introduce a standardized data structure for device addresses · 1b0cce7d
      Daniel P. Berrange 提交于
      All guest devices now use a common device address structure
      summarized by:
      
        enum virDomainDeviceAddressType {
          VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
          VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
        };
      
        struct _virDomainDevicePCIAddress {
          unsigned int domain;
          unsigned int bus;
          unsigned int slot;
          unsigned int function;
        };
      
        struct _virDomainDeviceInfo {
          int type;
          union {
              virDomainDevicePCIAddress pci;
          } addr;
        };
      
      This replaces the anonymous structs in Disk/Net/Hostdev data
      structures. Where available, the address is *always* printed
      in the XML file, instead of being hidden in the internal state
      file.
      
        <address type='pci' domain='0x0000' bus='0x1e' slot='0x07' function='0x0'/>
      
      The structure definition is based on Wolfgang Mauerer's disk
      controller patch series.
      
      * docs/schemas/domain.rng: Define the <address> syntax and
        associate it with disk/net/hostdev devices
      * src/conf/domain_conf.h, src/conf/domain_conf.c,
        src/libvirt_private.syms: APIs for parsing/formatting address
        information. Also remove the QEMU specific 'pci_addr' attributes
      * src/qemu/qemu_driver.c: Replace use of 'pci_addr' attrs with
        new standardized format.
      1b0cce7d
  16. 12 1月, 2010 1 次提交
    • C
      virterror: Add virSetError · fd5eb45b
      Cole Robinson 提交于
      Can be used to re-set an old error, which may have been squashed by
      other functions (like cleanup routines). Will be used in subsequent patches
      fd5eb45b
  17. 23 12月, 2009 2 次提交
  18. 18 12月, 2009 2 次提交
    • J
      Adds CPU selection infrastructure · 7286882c
      Jiri Denemark 提交于
      Each driver supporting CPU selection must fill in host CPU capabilities.
      When filling them, drivers for hypervisors running on the same node as
      libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers,
      such as VMware, need to implement their own way of getting such data.
      Raw data can be decoded into virCPUDefPtr using cpuDecode() function.
      
      When implementing virConnectCompareCPU(), a hypervisor driver can just
      call cpuCompareXML() function with host CPU capabilities.
      
      For each guest for which a driver supports selecting CPU models, it must
      set the appropriate feature in guest's capabilities:
      
          virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0)
      
      Actions needed when a domain is being created depend on whether the
      hypervisor understands raw CPU data (currently CPUID for i686, x86_64
      architectures) or symbolic names has to be used.
      
      Typical use by hypervisors which prefer CPUID (such as VMware and Xen):
      
      - convert guest CPU configuration from domain's XML into a set of raw
        data structures each representing one of the feature policies:
      
          cpuEncode(conn, architecture, guest_cpu_config,
                    &forced_data, &required_data, &optional_data,
                    &disabled_data, &forbidden_data)
      
      - create a mask or whatever the hypervisor expects to see and pass it
        to the hypervisor
      
      Typical use by hypervisors with symbolic model names (such as QEMU):
      
      - get raw CPU data for a computed guest CPU:
      
          cpuGuestData(conn, host_cpu, guest_cpu_config, &data)
      
      - decode raw data into virCPUDefPtr with a possible restriction on
        allowed model names:
      
          cpuDecode(conn, guest, data, n_allowed_models, allowed_models)
      
      - pass guest->model and guest->features to the hypervisor
      
      * src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c
        src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h
        src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h
      * configure.in: check for CPUID instruction
      * src/Makefile.am: glue the new files in
      * src/libvirt_private.syms: add new private symbols
      * po/POTFILES.in: add new cpu files containing translatable strings
      7286882c
    • J
      XML parsing/formating code for CPU flags · 6695818c
      Jiri Denemark 提交于
      * include/libvirt/virterror.h src/util/virterror.c: add new domain
        VIR_FROM_CPU for errors
      * src/conf/cpu_conf.c src/conf/cpu_conf.h: new parsing module
      * src/Makefile.am proxy/Makefile.am: include new files
      * src/conf/capabilities.[ch] src/conf/domain_conf.[ch]: reference
        new code
      * src/libvirt_private.syms: private export of new entry points
      6695818c
  19. 10 12月, 2009 3 次提交
    • M
      remove iptablesReloadRules() and related code · 4ecf9c65
      Mark McLoughlin 提交于
      We don't use this method of reloading rules anymore, so we can just
      kill the code.
      
      This simplifies things a lot because we no longer need to keep a
      table of the rules we've added.
      
      * src/util/iptables.c: kill iptablesReloadRules()
      4ecf9c65
    • M
      remove all traces of lokkit support · 3b3305d8
      Mark McLoughlin 提交于
      Long ago we tried to use Fedora's lokkit utility in order to register
      our iptables rules so that 'service iptables restart' would
      automatically load our rules.
      
      There was one fatal flaw - if the user had configured iptables without
      lokkit, then we would clobber that configuration by running lokkit.
      
      We quickly disabled lokkit support, but never removed it. Let's do
      that now.
      
      The 'my virtual network stops working when I restart iptables' still
      remains. For all the background on this saga, see:
      
        https://bugzilla.redhat.com/227011
      
      * src/util/iptables.c: remove lokkit support
      
      * configure.in: remove --enable-lokkit
      
      * libvirt.spec.in: remove the dirs used only for saving rules for lokkit
      
      * src/Makefile.am: ditto
      
      * src/libvirt_private.syms, src/network/bridge_driver.c,
        src/util/iptables.h: remove references to iptablesSaveRules
      3b3305d8
    • 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
  20. 08 12月, 2009 1 次提交
    • D
      Introduce callbacks for serializing domain object private data to XML · c5358c0e
      Daniel P. Berrange 提交于
      Now that drivers are using a private domain object state blob,
      the virDomainObjFormat/Parse methods are no longer able to
      directly serialize all neccessary state to/from XML. It is
      thus neccessary to introduce a pair of callbacks fo serializing
      private state.
      
      The code for serializing vCPU PIDs and the monitor device
      config can now move out of domain_conf.c and into the
      qemu_driver.c where they belong.
      
      * src/conf/capabilities.h: Add callbacks for serializing private
        state to/from XML
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove the
        monitor, monitor_chr, monitorWatch, nvcpupids and vcpupids
        fields from virDomainObjPtr. Remove code that serialized
        those fields
      * src/libvirt_private.syms: Export virXPathBoolean
      * src/qemu/qemu_driver.c: Add callbacks for serializing monitor
        and vcpupid data to/from XML
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Pass monitor
        char device config into qemuMonitorOpen directly.
      c5358c0e
  21. 07 12月, 2009 1 次提交
    • D
      Introduce a simple API for handling JSON data · 9428f2ce
      Daniel P. Berrange 提交于
      This introduces simple API for handling JSON data. There is
      an internal data structure 'virJSONValuePtr' which stores a
      arbitrary nested JSON value (number, string, array, object,
      nul, etc).  There are APIs for constructing/querying objects
      and APIs for parsing/formatting string formatted JSON data.
      
      This uses the YAJL library for parsing/formatting from
      
       http://lloyd.github.com/yajl/
      
      * src/util/json.h, src/util/json.c: Data structures and APIs
        for representing JSON data, and parsing/formatting it
      * configure.in: Add check for yajl library
      * libvirt.spec.in: Add build requires for yajl
      * src/Makefile.am: Add json.c/h
      * src/libvirt_private.syms: Export JSON symbols to drivers
      9428f2ce