1. 26 5月, 2010 1 次提交
    • S
      vepa: parsing for 802.1Qb{g|h} XML · a8f75d2c
      Stefan Berger 提交于
      This patch parses the following two XML descriptions, one for
      802.1Qbg and one for 802.1Qbh, and stores the data internally.
      The actual triggering of the switch setup protocol has not been
      implemented here but the relevant code to do that should go into
      the functions associatePortProfileId() and disassociatePortProfileId().
      
         <interface type='direct'>
            <source dev='eth0.100' mode='vepa'/>
            <model type='virtio'/>
            <virtualport type='802.1Qbg'>
              <parameters managerid='12' typeid='0x123456' typeidversion='1'
               instanceid='fa9b7fff-b0a0-4893-8e0e-beef4ff18f8f'/>
            </virtualport>
            <filterref filter='clean-traffic'/>
          </interface>
      
          <interface type='direct'>
            <source dev='eth0.100' mode='vepa'/>
            <model type='virtio'/>
            <virtualport type='802.1Qbh'>
              <parameters profileid='my_profile'/>
            </virtualport>
          </interface>
      
      I'd suggest to use this patch as a base for triggering the setup
      protocol with the 802.1Qb{g|h} switch.
      
      Several rounds of changes were made to this patch. The
      following is a list of these changes.
      - Renamed structure virVirtualPortProfileDef to virVirtualPortProfileParams
        as per Daniel Berrange's request
      - Addressing Daniel Berrange's comments:
       - removing macvtap.h's dependency on domain_conf.h by
         moving the virVirtualPortProfileDef structure into macvtap.h
         and not passing virtDomainNetDefPtr to any functions in
         macvtap.c
      - Addressed most of Chris Wright's comments:
        - indicating error in case virtualport XML node cannot be parsed
          properly
        - parsing hex and decimal numbers using virStrToLong_ui() with
          parameter '0' for base
        - tgifname (target interface name) variable wasn't necessary
          to pass to openMacvtapTap function anymore
      - assigning the virtual port data structure to the virDomainNetDef
        only if it was previously parsed
      - make sure that the error code returned by openMacvtapTap() is a negative n
        in case the associatePortProfileId() function failed.
      - renaming vsi in the XML to virtualport
      - replace all occurrences of vsi in the source as well
      - removing mode and MAC address parameters from the functions that
        will communicate with the hareware diretctly or indirectly
      - moving the associate and disassociate functions to the end of the
        file for subsequent patches to easier make them generally available
        for export
      - passing the macvtap interface name rather than the link device since
        this otherwise gives funny side effects when using netlink messages
        where IFLA_IFNAME and IFLA_ADDRESS are specified and the link dev
        all of a sudden gets the MAC address of the macvtap interface.
      - Removing rc = -1 error indications in the case of 802.1Qbg|h setup in case
        we wanted to use hook scripts for the setup and so the setup doesn't fail
        here.
      - if instance ID UUID is not supplied it will automatically be generated
        - adapted schema to make instance ID UUID optional
        - added test case
      - parser and XML generator have been separated into their own
        functions so they can be re-used elsewhere (passthrough case
        for example)
      - Adapted XML parser and generator support the above shown type
        (802.1Qbg, 802.1Qbh).
      - Adapted schema to above XML
      - Adapted test XML to above XML
      - Passing through the VM's UUID which seems to be necessary for
        802.1Qbh -- sorry no host UUID
      - adding virtual function ID to association function, in case it's
        necessary to use (for SR-IOV)
      a8f75d2c
  2. 21 5月, 2010 2 次提交
  3. 20 5月, 2010 1 次提交
  4. 24 4月, 2010 1 次提交
  5. 09 4月, 2010 1 次提交
  6. 05 4月, 2010 1 次提交
  7. 02 4月, 2010 2 次提交
    • C
      Make virDomainLoadConfig static. · fba3dfd1
      Chris Lalancette 提交于
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      fba3dfd1
    • L
      Changes to clock timer XML to match final design. · 4ee2b318
      Laine Stump 提交于
      The clock timer XML is being updated in the following ways (based on
      further off-list discussion that was missed during the initial
      implementation):
      
      1) 'wallclock' is changed to 'track', and the possible values are 'boot'
       (corresponds to old 'host'), 'guest', and 'wall'.
      
      2) 'mode' has an additional value 'smpsafe'
      
      3) when tickpolicy='catchup', there can be an optional sub-element of
         timer called 'catchup':
      
         <catchup threshold=123 slew=120 limit=10000/>
      
      Those three values are all longs, always optional, and if they are present,
      they are positive. Internally, 0 indicates "unspecified".
      
      * docs/schemas/domain.rng: updated RNG definition to account for changes
      
      * src/conf/domain_conf.h: change the C struct and enums to match changes.
      
      * src/conf/domain_conf.c: timer parse and format functions changed to
                                handle the new selections and new element.
      
      * src/libvirt_private.syms: *TimerWallclock* changes to *TimerTrack*
      
      * src/qemu/qemu_conf.c: again, account for Wallclock --> Track change.
      4ee2b318
  8. 01 4月, 2010 1 次提交
  9. 31 3月, 2010 1 次提交
  10. 30 3月, 2010 1 次提交
  11. 27 3月, 2010 4 次提交
    • J
      Don't replace persistent domain config with migrated config · 59821682
      Jiri Denemark 提交于
      When a domain is defined on host1, migrated to host2 and then migrated
      back to host1, its current configuration would overwrite the libvirtd's
      in-memory copy of persistent configuration of that domain. This is not
      desired as we want to preserve the persistent configuration untouched.
      
      This patch introduces new 'live' parameter to virDomainAssignDef.
      Passing 'true' for 'live' means the configuration passed to
      virDomainAssignDef describes a configuration of live instance of the
      domain. This applies for saved domains which are being restored or for
      incoming domains during migration.
      
      All callers have been changed to pass the appropriate value.
      59821682
    • D
      Add disk error policy to domain XML · 447c586a
      David Allan 提交于
      * Fixes per feedback from Dan and Daniel
      * Added test datafiles
      * Re-disabled JSON flags
      * Added code to print the error policy attribute when generating XML
      * Re-add empty tag
      447c586a
    • S
      Add XML parser extensions for network filtering · e4e20423
      Stefan Berger 提交于
      This patch adds XML processing for the network filter schema
      and extends the domain XML processing to parse the top level
      referenced filter along with potentially provided parameters
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      Signed-off-by: NGerhard Stenzel <gerhard.stenzel@de.ibm.com>
      e4e20423
    • S
      Use enum of virDomainNetType · 9bcad690
      Stefan Berger 提交于
      To find out where the net type 'direct' needs to be handled I introduced
      the 'enum virDomainNetType' in the virDomainNetDef structure and let the
      compiler tell me where the case statement is missing. Then I added the
      unhandled device statement to the UML driver.
      
      * src/conf/domain_conf.h: change _virDomainNetDef type from int to
        virDomainNetType enum
      * src/conf/domain_conf.c src/lxc/lxc_driver.c src/qemu/qemu_conf.c
        src/uml/uml_conf.c: make sure all enum cases are properly handled
        in switches
      9bcad690
  12. 26 3月, 2010 1 次提交
    • D
      Allow parsing <graphics> in device XML · c85f6413
      Daniel P. Berrange 提交于
      Expand the parser for the standalone <device> XML format to
      allow inclusion of the <graphics> device type
      
      * src/conf/domain_conf.h: Add virDomainGraphicsDef to
        the virDomainDeviceDef struct
      * src/conf/domain_conf.c: Wire up parser for virDomainGraphicsDef
        to virDomainDeviceDefParse method
      c85f6413
  13. 23 3月, 2010 1 次提交
    • J
      virDomainDiskDefAssignAddress: return int, not void · c390bcfe
      Jim Meyering 提交于
      Before, this function would blindly accept an invalid def->dst
      and then abuse the idx=-1 it would get from virDiskNameToIndex,
      when passing it invalid strings like "xvda:disk" and "sda1".
      Now, this function returns -1 upon failure.
      * src/conf/domain_conf.c (virDomainDiskDefAssignAddress): as above.
      Update callers.
      * src/conf/domain_conf.h: Update prototype.
      * src/qemu/qemu_conf.c: Update callers.
      c390bcfe
  14. 10 3月, 2010 1 次提交
  15. 02 3月, 2010 3 次提交
    • D
      Allow a timezone to be specified instead of sync to host timezone · e4d7433e
      Daniel P. Berrange 提交于
      This extends the XML to allow for
      
        <clock offset='timezone' timezone='Europe/Paris'/>
      
      This is useful if the admin has not configured any timezone on the
      host OS, but still wants to synchronize a guest to a specific one.
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c: Support extra
        'timezone' attribute on clock configuration
      * docs/schemas/domain.rng: Add 'timezone' attribute
      * src/xen/xend_internal.c, src/xen/xm_internal.c: Reject configs
        with a configurable timezone
      e4d7433e
    • 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
  16. 19 2月, 2010 2 次提交
    • C
      Make virDomainObjFormat static · 8ba9e794
      Chris Lalancette 提交于
      * src/conf/domain_conf.c: make function static
      * src/conf/domain_conf.h: remove it from header
      8ba9e794
    • 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
  17. 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
  18. 16 2月, 2010 1 次提交
    • S
      macvtap support for libvirt -- parse new interface XML · 78d1ee29
      Stefan Berger 提交于
      This part adds support to domain_conf.{c|h} for parsing the new
      interface XML of type 'direct'. The parsed mode is now stored as
      an int.
      * src/conf/domain_conf.c src/conf/domain_conf.h: extend parsing code
      * src/util/macvtap.h: empty header to not break compilation
      78d1ee29
  19. 10 2月, 2010 1 次提交
  20. 03 2月, 2010 2 次提交
    • D
      Remove direct storage of hostnet_name & vlan · 0943048a
      Daniel P. Berrange 提交于
      The current way of assigning names to the host network backend and
      NIC device in QEMU was over complicated, by varying naming scheme
      based on the NIC model and backend type. This simplifies the naming
      to simply be 'net0' and 'hostnet0', allowing code to easily determine
      the host network name and vlan based off the primary device alias
      name 'net0'. This in turn allows removal of alot of QEMU specific
      code from the XML parser, and makes it easier to assign new unique
      names for NICs that are hotplugged
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove hostnet_name
        and vlan fields from virNetworkDefPtr
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c:
        Use a single network alias naming scheme regardless of NIC type
        or backend type. Determine VLANs from the alias name.
      * tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args,
        tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
        tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args: Update
        for new simpler naming scheme
      0943048a
    • D
      Introduce generic virDomainDeviceInfo iterator function · 3fdef8cf
      Daniel P. Berrange 提交于
      The virDomainDeviceInfoIterate() function will provide a
      convenient way to iterate over all devices in a domain.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add virDomainDeviceInfoIterate()
        function.
      3fdef8cf
  21. 21 1月, 2010 1 次提交
    • D
      Make all bitfields unsigned ints to avoid unexpected values in casts · 50b6c95d
      Daniel P. Berrange 提交于
      The 'int virInterfaceIsActive()' method was directly returning the
      value of the 'int active:1' bitfield in virIntefaceDefPtr. A bitfield
      with a signed integer, will hold the values 0 and -1, not 0 and +1
      as might be expected. This meant that virInterfaceIsActive() was
      always returning -1 when the interface was active, not +1 & thus all
      callers thought an error had occurred. To protect against this kind
      of mistake again, change all bitfields to be unsigned ints
      
      * daemon/libvirtd.h, src/conf/domain_conf.h, src/conf/interface_conf.h,
        src/conf/network_conf.h: Change bitfields to unsigned int.
      50b6c95d
  22. 18 1月, 2010 4 次提交
    • D
      Add device info to serial, parallel, channel, input & fs devices · 4ac290cc
      Daniel P. Berrange 提交于
      Although the serial, parallel, chanel, input & fs devices do
      not have PCI address info, they can all have device aliases.
      Thus it neccessary to associate the virDomainDeviceInfo data
      with them all.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
        parsing / formatting device info for serial, parallel, channel
        input and fs devices.
      * docs/schemas/domain.rng: Associate device info with character
        devices, input & fs device
      4ac290cc
    • 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
  23. 16 1月, 2010 5 次提交
    • 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
      Add address info to sound, video and watchdog devices · a9e4ea94
      Daniel P. Berrange 提交于
      Add the virDomainDeviceAddress information to the sound, video
      and watchdog devices. This means all of them gain the new XML
      element
      
        <address .... />
      
      This brings them upto par with disk/net/hostdev devices which
      already have address info
      
      * src/conf/domain_conf.h: Add virDomainDeviceAddress to sound,
        video & watchdog device struts.
      * src/conf/domain_conf.c: Hook up parsing/formatting for
        virDomainDeviceAddress in sound, video & watchdog devices
      * docs/schemas/domain.rng: Associate device address info
        with sound, video & watchdog
      a9e4ea94
    • D
      Extend the virDomainDeviceAddress struture to allow disk controller addresses · d812e7ae
      Daniel P. Berrange 提交于
      Introduce a new structure
      
            struct _virDomainDeviceDriveAddress {
              unsigned int controller;
              unsigned int bus;
              unsigned int unit;
            };
      
      and plug that into virDomainDeviceAddress and generates XML that
      looks like
      
        <address type='drive' controller='1' bus='0' unit='5'/>
      
      This syntax will be used by the QEMU driver to explicitly control
      how drives are attached to the bus
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c: Parsing and
        formatting of drive addresses
      * docs/schemas/domain.rng: Define new address format for drives
      d812e7ae
    • 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
  24. 18 12月, 2009 1 次提交
    • 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