1. 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
  2. 26 1月, 2010 2 次提交
  3. 23 1月, 2010 1 次提交
    • C
      Fix libvirtd restart for domains with PCI passthrough devices · cdc42d0a
      Chris Lalancette 提交于
      When libvirtd shuts down, it places a <state/> tag in the XML
      state file it writes out for guests with PCI passthrough
      devices.  For devices that are attached at bootup time, the
      state tag is empty.  However, at libvirtd startup time, it
      ignores anything with a <state/> tag in the XML, effectively
      hiding the guest.
      This patch remove the check for VIR_DOMAIN_XML_INTERNAL_STATUS
      when parsing the XML.
      * src/conf/domain_conf.c: remove VIR_DOMAIN_XML_INTERNAL_STATUS
        flag check in virDomainHostdevSubsysPciDefParseXML()
      cdc42d0a
  4. 21 1月, 2010 4 次提交
    • J
      avoid format-related warnings · dfff67c0
      Jim Meyering 提交于
      * src/conf/domain_conf.c (virDomainDeviceInfoParseXML): Use "%s".
      dfff67c0
    • D
      Implement support for multi IQN · 6aabcb5b
      David Allan 提交于
      Allows the initiator to use a variety of IQNs rather than just the
      system IQN when creating iSCSI pools.
      * docs/schemas/storagepool.rng: extends the syntax with <iqn name="..."/>
      * src/conf/storage_conf.[ch]: read and stores the iqn name
      * src/storage/storage_backend_iscsi.[ch]: implement the IQN selection
        when detected
      6aabcb5b
    • J
      domain_conf.c: avoid a leak and the need for "cleanup:" block · 1825c655
      Jim Meyering 提交于
      * src/conf/domain_conf.c (virDomainChrDefFormat): Plug a leak on
      an error path, and at the same time, eliminate the need for a
      "cleanup:" block.  Before, the "return -1" after the switch
      would leak an "addr" string.  Now, by reversing the port,addr-
      getting blocks we can free "addr" immediately and skip the goto.
      1825c655
    • 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
  5. 20 1月, 2010 4 次提交
    • L
      Support bond interfaces attached to bridges in interface xml. · 00229955
      Laine Stump 提交于
      This was accomplished in xml parsing by doing away with the
      stripped-down virInterfaceBareDef object, and just always using
      virInterfaceDef, but with restrictions in certain places (eg, the type
      of subordinate interface allowed in parsing depends on the parent
      interface).
      
      xml formatting was similarly adjusted. In addition, the formatting
      functions keep track of the level of interface nesting, and insert
      extra leading spaces on each line accordingly (using %*s).
      
      The only change in formatted xml from previous (aside frmo supporting
      new combinations of interface types) is that the subordinate ethernet
      interfaces take up 2 lines rather than one, eg:
      
         <interface type='ethernet' name='eth0'>
         </interface>
      
      instead of:
      
         <interface type='ethernet' name='eth0'/>
      00229955
    • L
      Allow empty bridges in interface xml. · 86304e35
      Laine Stump 提交于
      86304e35
    • L
      Support delay property in interface bridge xml. · d22591ef
      Laine Stump 提交于
      d22591ef
    • J
      storage_conf: plug a leak on OOM error path · 3aa13a47
      Jim Meyering 提交于
      * src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
      Free just-allocated "source" upon VIR_REALLOC_N failure.
      3aa13a47
  6. 19 1月, 2010 1 次提交
    • J
      Allow for CPU topology specification without model · ce4896fb
      Jiri Denemark 提交于
      Currently CPU topology may only be specified together with CPU model:
          <cpu match='exact'>
              <model>name</model>
              <topology sockets='1' cores='2' threads='3'/>
          </cpu>
      
      This patch allows for CPU topology specification without the need for
      also specifying CPU model:
          <cpu>
              <topology sockets='1' cores='2' threads='3'/>
          </cpu>
      
      'match' attribute and 'model' element are made optional with the
      restriction that 'match' attribute has to be set when 'model' is
      present.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      ce4896fb
  7. 18 1月, 2010 6 次提交
    • 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
    • D
      Remove restriction on duplicated sound devices in parser · 4359900e
      Daniel P. Berrange 提交于
      It is perfectly acceptable to have multiple sound devices of
      same type in guest configuration. If the underlying hypervisor
      does not like this, it is its job to complain, not the XML
      parser's
      
      * src/conf/domain_conf.c: Remove hack which deleted duplicated
        sound device models.
      * tests/xml2sexprdata/xml2sexpr-fv-sound.xml: Remove duplicate
        models
      4359900e
    • M
      esx: Add VNC support · c2c4d51b
      Matthias Bolte 提交于
      * src/conf/domain_conf.c: add defaults for the video device
      * src/esx/esx_vmx.[ch]: add VNC support to the VMX handling
      * tests/vmx2xmltest.c, tests/xml2vmxtest.c: add tests for the VNC support
      c2c4d51b
  8. 16 1月, 2010 6 次提交
    • D
      Fix build of Xen proxy daemon · ad4f0924
      Daniel P. Berrange 提交于
      * src/conf/domain_conf.c: Allow virDomainDeviceInfoIsSet,
        virDomainDeviceInfoClear & virDomainDeviceInfoFormat when
        building Xen proxy
      ad4f0924
    • 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
  9. 14 1月, 2010 1 次提交
  10. 22 12月, 2009 1 次提交
    • M
      Fix undefined reference to 'close_used_without_including_unistd_h' · 457d4ad9
      Matthias Bolte 提交于
      Found while trying to cross-compile libvirt on Fedora 12 for Windows.
      gnulib redefines 'close' to 'close_used_without_including_unistd_h'
      in sys/socket.h if winsock2.h is present and unistd.h has not been
      included before sys/socket.h. Reorder some includes to fix this.
      457d4ad9
  11. 18 12月, 2009 2 次提交
    • D
      Fixes syntax-check with previous commit · c7c42a85
      Daniel Veillard 提交于
      * po/POTFILES.in: adds src/conf/cpu_conf.c in teh set of files with
        translatable content
      * src/conf/cpu_conf.c: remove an unused include
      c7c42a85
    • 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
  12. 14 12月, 2009 2 次提交
  13. 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
  14. 09 12月, 2009 1 次提交
    • D
      Fix virDomainObj ref handling in QEMU driver · 8e7d1495
      Daniel P. Berrange 提交于
      Since the monitor I/O is processed out of band from the main
      thread(s) invoking monitor  commands, the virDomainObj may be
      deleted by the I/O thread. The qemuDomainObjBeginJob takes an
      extra reference to protect against final deletion, but this
      reference is released by the corresponding EndJob call. THus
      after the EndJob call it may not be valid to reference the
      virDomainObj any more. To allow callers to detect this, the
      EndJob call is changed to return the remaining reference count.
      
      * src/conf/domain_conf.c: Make virDomainObjUnref return the
        remaining reference count
      * src/qemu/qemu_driver.c: Avoid referencing virDomainObjPtr
        after qemuDomainObjEndJob if it has been deleted.
      8e7d1495
  15. 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
  16. 04 12月, 2009 1 次提交
    • M
      Fix some locking issues · 7a18fbee
      Matthias Bolte 提交于
      * src/conf/domain_conf.c: don't call virDomainObjUnlock twice
      * src/qemu/qemu_driver.c: relock driver lock if an error occurs in
        qemuDomainObjBeginJobWithDriver, enter/exit monitor with driver
        in qemudDomainSave
      7a18fbee
  17. 23 11月, 2009 1 次提交
    • D
      Support QEMU's virtual FAT block device driver · e7c78b0a
      Daniel P. Berrange 提交于
      Introduce a new type="dir"  mode for <disks> that allows use of
      QEMU's  virtual FAT block device driver. eg
      
          <disk type='dir' device='floppy'>
            <source dir='/tmp/test'/>
            <target dev='fda' bus='fdc'/>
            <readonly/>
          </disk>
      
      gets turned into
      
        -drive file=fat:floppy:/tmp/test,if=floppy,index=0
      
      Only read-only disks are supported with virtual FAT mode
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add type="dir"
      * docs/schemas/domain.rng: Document new disk type
      * src/xen/xend_internal.c, src/xen/xm_internal.c: Raise error for
        unsupported disk types
      * tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args: Fix
        empty disk file handling
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.args,
        tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml,
        tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args,
        tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
        tests/qemuxml2argvtest.c: Test QEMU vitual FAT driver
      * src/qemu/qemu_conf.c: Support generating fat:/some/dir type
        disk args
      * src/security/security_selinux.c: Temporarily skip labelling
        of directory based disks
      e7c78b0a
  18. 19 11月, 2009 2 次提交
    • D
      remove sysfs_path and parent_sysfs_path from XML · 2cdb665b
      Dave Allan 提交于
      Erroneously included the sysfs_path and parent_sysfs_path elements in
      the node device xml, they were not supposed to show up there
      
      * src/conf/node_device_conf.c: remove the output of the 2 fields
      2cdb665b
    • D
      Removing devicePath member from dev struct · f2f656d4
      Dave Allan 提交于
      I realized that I inadvertently added a member to the def struct to
      contain each device's sysfs path when there was an existing member in the
      dev struct for "OS specific path to device metadat, eg sysfs"  Since the
      udev backend needs to record the sysfs path while it's in the process of
      creating the device, before the dev struct gets allocated, I chose to
      remove the member from the dev struct.
      
      * src/conf/node_device_conf.c src/conf/node_device_conf.h
        src/node_device/node_device_driver.c src/node_device/node_device_hal.c
        src/node_device/node_device_udev.c: remove devicePath from the
        structure and use def->sysfs_path instead
      f2f656d4
  19. 13 11月, 2009 1 次提交
    • D
      Fix formatting of XML for an inactive guest · f24e67d2
      Daniel P. Berrange 提交于
      If the virDomainDefPtr object has an 'id' of -1, then forcably
      set the VIR_DOMAIN_XML_INACTIVE flag to ensure generated XML
      does not include any cruft from the previously running guest
      such as console PTY path, or VNC port.
      
      * src/conf/domain_conf.c: Set VIR_DOMAIN_XML_INACTIVE if
        def->id is -1. Replace checks for def->id == -1 with
        check against flags & VIR_DOMAIN_XML_INACTIVE.
      f24e67d2