1. 23 7月, 2010 1 次提交
  2. 21 7月, 2010 4 次提交
    • D
      Re-arrange PCI device address assignment to match QEMU's default · 0e308c2c
      Daniel P. Berrange 提交于
      To try and ensure that people upgrading from old QEMU get guests
      with the same PCI device ordering, change the way we assign addrs
      to match QEMU's default order. This should make Windows less
      annoyed.
      
      * src/qemu/qemu_conf.c: Follow QEMU's default PCI ordering
        logic when assigning addresses
      * tests/*.args: Update for changed PCI addresses
      0e308c2c
    • D
      Explicitly represent balloon device in XML and handle PCI address · b2f18635
      Daniel P. Berrange 提交于
      To allow compatibility with older QEMU PCI device slot assignment
      it is necessary to explicitly track the balloon device in the
      XML. This introduces a new device
      
         <memballoon model='virtio|xen'/>
      
      It can also have a PCI address, auto-assigned if necessary.
      
      The memballoon will be automatically added to all Xen and QEMU
      guests by default.
      
      * docs/schemas/domain.rng: Add <memballoon> element
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing
        and formatting for memballoon device. Always add a memory
        balloon device to Xen/QEMU if none exists in XML
      * src/libvirt_private.syms: Export memballoon model APIs
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Honour the
        PCI device address in memory balloon device
      * tests/*: Update to test new functionality
      b2f18635
    • D
      Rearrange VGA/IDE controller address reservation · ccd2c82e
      Daniel P. Berrange 提交于
      The first VGA and IDE devices need to have fixed PCI address
      reservations. Currently this is handled inline with the other
      non-primary VGA/IDE devices. The fixed virtio balloon device
      at slot 3, ensures auto-assignment skips the slots 1/2. The
      virtio address will shortly become configurable though. This
      means the reservation of fixed slots needs to be done upfront
      to ensure that they don't get re-used for other devices.
      
      This is more or less reverting the previous changeset:
      
        commit 83acdeaf
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Wed Feb 3 16:11:29 2010 +0000
      
        Fix restore of QEMU guests with PCI device reservation
      
      The difference is that this time, instead of unconditionally
      reserving the address, we only reserve the address if it was
      initially type=none. Addresses of type=pci were handled
      earlier in process by qemuDomainPCIAddressSetCreate(). This
      ensures restore step doesn't have problems
      
      * src/qemu/qemu_conf.c: Reserve first VGA + IDE address
        upfront
      ccd2c82e
    • D
      Remove inappropriate use of VIR_ERR_NO_SUPPORT · 021251bd
      Daniel P. Berrange 提交于
      The VIR_ERR_NO_SUPPORT refers to an API which is not implemented.
      There is a separate VIR_ERR_CONFIG_UNSUPPORTED for XML config
      options that are not available with the current hypervisor.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_driver.c: Remove
        many VIR_ERR_NO_SUPPORT replace with VIR_ERR_CONFIG_UNSUPPORTED
      021251bd
  3. 20 7月, 2010 1 次提交
  4. 13 7月, 2010 1 次提交
  5. 02 7月, 2010 1 次提交
  6. 25 6月, 2010 1 次提交
    • L
      Check for presence of qemu -nodefconfig option before using it · 7d02393b
      Laine Stump 提交于
      We previously assumed that if the -device option existed in qemu, that
      -nodefconfig would also exist. It turns out that isn't the case, as
      demonstrated by qemu-kvm-0.12.3 in Fedora 13.
      
      */src/qemu/qemu_conf.[hc] - add a new QEMUD_CMD_FLAG, set it via the
                                  help output, and check it before adding
                                  -nodefconfig to the qemu commandline.
      7d02393b
  7. 24 6月, 2010 1 次提交
    • M
      Add wide SCSI bus disk address generation support · f8f29b1f
      Matthias Bolte 提交于
      The domain XML parsing code autogenerates disk address and
      controller elements when they are not explicitly specified.
      The code assumes a narrow SCSI bus (7 units per bus). ESX
      uses a wide SCSI bus (16 units per bus).
      
      This is a step towards controller support for the ESX driver.
      f8f29b1f
  8. 23 6月, 2010 1 次提交
    • D
      Add '-nodefconfig' command line arg to QEMU · f310b253
      Daniel P. Berrange 提交于
      We already use the '-nodefaults' command line arg with QEMU to stop
      it adding any default devices to guests. Unfortunately, QEMU will
      load global config files from /etc/qemu that may also add default
      devices. These aren't blocked by '-nodefaults', so we need to also
      add the '-nodefconfig' arg to prevent that.
      
      Unfortunately these global config files are also used to define
      custom CPU models. So in blocking global hardware device addition
      we also block definitions of new CPU models. Libvirt doesn't know
      about these custom CPU models though, so it would never make use
      of them anyway. Thus blocking them via -nodefconfig isn't a show
      stopping problem. We would need to expand libvirt's own CPU model
      XML database to support these instead.
      
      * src/qemu/qemu_conf.c: Add '-nodefconfig' if available
      * tests/qemuxml2argvdata/: Add '-nodefconfig' to all data files which
        have '-nodefaults' present
      f310b253
  9. 22 6月, 2010 1 次提交
    • S
      nwfilter: fix loadable module support · cab5a52a
      Stefan Berger 提交于
      Following Daniel Berrange's multiple helpful suggestions for improving
      this patch and introducing another driver interface, I now wrote the
      below patch where the nwfilter driver registers the functions to
      instantiate and teardown the nwfilters with a function in
      conf/domain_nwfilter.c called virDomainConfNWFilterRegister. Previous
      helper functions that were called from qemu_driver.c and qemu_conf.c
      were move into conf/domain_nwfilter.h with slight renaming done for
      consistency. Those functions now call the function expored by
      domain_nwfilter.c, which in turn call the functions of the new driver
      interface, if available.
      cab5a52a
  10. 08 6月, 2010 1 次提交
    • D
      Include port number with virtio serial devices · 2e56cfa7
      Daniel P. Berrange 提交于
      To ensure that the device addressing scheme is stable across
      hotplug/unplug, all virtio serial channels needs to have an
      associated port number in their address. This is then specified
      to QEMU using the nr=NNN parameter
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
        for port number in vioserial address types.
      * src/qemu/qemu_conf.c: Set 'nr=NNN' parameter with virtio
        serial port number
      * tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args,
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: Expand
        data set to ensure coverage of port addressing
      2e56cfa7
  11. 03 6月, 2010 1 次提交
    • S
      add 802.1Qbh and 802.1Qbg handling · ca3b22bb
      Stefan Berger 提交于
      This patch that adds support for configuring 802.1Qbg and 802.1Qbh
      switches. The 802.1Qbh part has been successfully tested with real
      hardware. The 802.1Qbg part has only been tested with a (dummy)
      server that 'behaves' similarly to how we expect lldpad to 'behave'.
      
      The following changes were made during the development of this patch:
      
       - Merging Scott's v13-pre1 patch
       - Fixing endptr related bug while using virStrToLong_ui() pointed out
         by Jim Meyering
       - Addressing Jim Meyering's comments to v11
       - requiring mac address to the vpDisassociateProfileId() function to
         pass it further to the 802.1Qbg disassociate part (802.1Qbh untouched)
       - determining pid of lldpad daemon by reading it from /var/run/libvirt.pid
         (hardcode as is hardcode alson in lldpad sources)
       - merging netlink send code for kernel target and user space target
         (lldpad) using one function nlComm() to send the messages
       - adding a select() after the sending and before the reading of the
         netlink response in case lldpad doesn't respond and so we don't hang
       - when reading the port status, in case of 802.1Qbg, no status may be
         received while things are 'in progress' and only at the end a status
         will be there.
       - when reading the port status, use the given instanceId and vf to pick
         the right IFLA_VF_PORT among those nested under IFLA_VF_PORTS.
       - never sending nor parsing IFLA_PORT_SELF type of messages in the
         802.1Qbg case
       - iterating over the elements in a IFLA_VF_PORTS to pick the right
         IFLA_VF_PORT by either IFLA_PORT_PROFILE and given profileId
         (802.1Qbh) or IFLA_PORT_INSTANCE_UUID and given instanceId (802.1Qbg)
         and reading the current status in IFLA_PORT_RESPONSE.
       - recycling a previous patch that adds functionality to interface.c to
         - get the vlan identifier on an interface
         - get the flags of an interface and some convenience function to
           check whether an interface is 'up' or not (not currently used here)
       - adding function to determine the root physical interface of an
         interface. For example if a macvtap is linked to eth0.100, it will
         find eth0. Also adding a function that finds the vlan on the 'way to
         the root physical interface'
       - conveying the root physical interface name and index in case of 802.1Qbg
       - conveying mac address of macvlan device and vlan identifier in
         IFLA_VFINFO_LIST[ IFLA_VF_INFO[ IFLA_VF_MAC(mac), IFLA_VF_VLAN(vlan) ] ]
         to (future) lldpad via netlink
        - To enable build with --without-macvtap rename the
          [dis|]associatePortProfileId functions, prepend 'vp' before their
          name and make them non-static functions.
        - Renaming variable multicast to nltarget_kernel and inverting
          the logic
        - Addressing Jim Meyering's comments; this also touches existing
          code for example for correcting indentation of break statements or
          simplification of switch statements.
        - Renamed occurrencvirVirtualPortProfileDef to virVirtualPortProfileParamses
        - 802.1Qbg part prepared for sending a RTM_SETLINK and getting
          processing status back plus a subsequent RTM_GETLINK to
          get IFLA_PORT_RESPONSE.
          Note: This interface for 802.1Qbg may still change
        - [David Allan] move getPhysfn inside IFLA_VF_PORT_MAX to avoid
      compiler
          warning when latest if_link.h isn't available
        - move from Stefan's 802.1Qb{g|h} XML v8 to v9
        - move hostuuid and vf index calcs to inside doPortProfileOp8021Qbh
        - remove debug fprintfs
        - use virGetHostUUID (thanks Stefan!)
        - fix compile issue when latest if_link.h isn't available
        - change poll timeout to 10s, at 1/8 intervals
           - if polling times out, log msg and return -ETIMEDOUT
        - Add Stefan's code for getPortProfileStatus
        - Poll for up to 2 secs for port-profile status, at 1/8 sec intervals:
           - if status indicates error, abort openMacvtapTap
           - if status indicates success, exit polling
           - if status is "in-progress" after 2 secs of polling, exit
             polling loop silently, without error
      
      My patch finishes out the 802.1Qbh parts, which Stefan had mostly complete.
      I've tested using the recent kernel updates for VF_PORT netlink msgs and
      enic for Cisco's 10G Ethernet NIC.  I tested many VMs, each with several
      direct interfaces, each configured with a port-profile per the XML.  VM-to-VM,
      and VM-to-external work as expected.  VM-to-VM on same host (using same NIC)
      works same as VM-to-VM where VMs are on diff hosts.  I'm able to change
      settings on the port-profile while the VM is running to change the virtual
      port behaviour.  For example, adjusting a QoS setting like rate limit.  All
      VMs with interfaces using that port-profile immediatly see the effect of the
      change to the port-profile.
      
      I don't have a SR-IOV device to test so source dev is a non-SR-IOV device,
      but most of the code paths include support for specifing the source dev and
      VF index.  We'll need to complete this by discovering the PF given the VF
      linkdev.  Once we have the PF, we'll also have the VF index.  All this info-
      mation is available from sysfs.
      ca3b22bb
  12. 02 6月, 2010 1 次提交
  13. 29 5月, 2010 1 次提交
    • S
      macvtap: cannot support target device name · ca1b7cc8
      Stefan Berger 提交于
      Since the macvtap device needs active tear-down and the teardown logic
      is based on the interface name, it can happen that if for example 1 out
      of 3 interfaces was successfully created, that during the failure path
      the macvtap's target device name is used to tear down an interface that
      is doesn't own (owned by another VM).
      
      So, in this patch, the target interface name is reset so that there is
      no target interface name and the interface name is always cleared after
      a tear down.
      ca1b7cc8
  14. 27 5月, 2010 1 次提交
    • A
      Pass pre-opened PCI device sysfs config file to QEMU · c444af1a
      Alex Williamson 提交于
      This allows libvirt to open the PCI device sysfs config file prior
      to dropping privileges so qemu can access the full config space.
      Without this, a de-privileged qemu can only access the first 64
      bytes of config space.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Detect support
        for pci-assign.configfd option. Use this option when formatting
        PCI device string if possible
      * src/qemu/qemu_driver.c: Pre-open PCI sysfs config file and pass
        to QEMU
      c444af1a
  15. 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
  16. 25 5月, 2010 1 次提交
    • C
      qemu: Allow using regular audio backends with VNC · fb3ebd03
      Cole Robinson 提交于
      Currently all host audio backends are disabled if a VM is using VNC, in
      favor of the QEMU VNC audio extension. Unfortunately no released VNC
      client supports this extension, so users have no way of getting audio
      to work if using VNC.
      
      Add a new config option in qemu.conf which allows changing libvirt's
      behavior, but keep the default intact.
      
      v2: Fix doc typos, change name to vnc_allow_host_audio
      fb3ebd03
  17. 21 5月, 2010 5 次提交
  18. 20 5月, 2010 1 次提交
  19. 19 5月, 2010 1 次提交
  20. 29 4月, 2010 1 次提交
  21. 24 4月, 2010 1 次提交
  22. 22 4月, 2010 4 次提交
    • J
      Use configured CPU model if possible · b9a2552d
      Jiri Denemark 提交于
      Adds ability to provide a preferred CPU model for CPUID data decoding.
      Such model would be considered as the best possible model (if it's
      supported by hypervisor) regardless on number of features which have to
      be added or removed for describing required CPU.
      b9a2552d
    • J
      Support removing features when converting data to CPU · 53c4f9fa
      Jiri Denemark 提交于
      So far, when CPUID data were converted into CPU model and features, the
      features can only be added to the model. As a result, when a guest asked
      for something like "qemu64,-svm" it would get a qemu32 plus a bunch of
      additional features instead.
      
      This patch adds support for removing feature from the base model.
      Selection algorithm remains the same: the best CPU model is the model
      which requires lowest number of features to be added/removed from it.
      53c4f9fa
    • J
      Deal with CPU models in [] · e07314f4
      Jiri Denemark 提交于
      Qemu committed a patch which list some CPU names in [] when asked for
      supported CPUs (qemu -cpu ?). Yet, it needs such CPUs to be passed
      without those square braces. When probing for supported CPU models, we
      can just strip the square braces and pretend we have never seen them.
      e07314f4
    • G
  23. 16 4月, 2010 3 次提交
    • D
      Fix CDROM media change for QEMU when using -device syntax · c4896d37
      Daniel P. Berrange 提交于
      Disk devices in QEMU have two parts, the guest device and the host
      backend driver. Historically these two parts have had the same
      "unique" name. With the switch to using -device though, they now
      have separate names. Thus when changing CDROM media, for guests
      using -device syntax, we need to prepend the QEMU_DRIVE_HOST_PREFIX
      constant
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add helper function
        qemuDeviceDriveHostAlias() for building a host backend alias
      * src/qemu/qemu_driver.c: Use qemuDeviceDriveHostAlias() to determine
        the host backend alias for performing eject/change commands in the
        monitor
      c4896d37
    • D
      Update QEMU device_add command in JSON mode · db336caa
      Daniel P. Berrange 提交于
      The device_add command was added in JSON mode in a way I didn't
      expect. Instead of passing the normal device string to the JSON
      command:
      
          { "execute": "device_add", "arguments": { "device": "ne2k_pci,id=nic.1,netdev=net.1" } }
      
      We need to split up the device string into a full JSON object
      
          { "execute": "device_add", "arguments": { "driver": "ne2k_pci", "id": "nic.1", "netdev": "net.1" } }
      
      * src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Rename the
        qemuCommandLineParseKeywords method to qemuParseKeywords
        and export it to monitor
      * src/qemu/qemu_monitor_json.c: Split up device string into
        a JSON object for device_add command
      db336caa
    • D
      Fix QEMU command building errors to reflect unsupported configuration · 3fb992c6
      Daniel P. Berrange 提交于
      Instead of reporting VIR_ERR_INTERNAL_ERROR use the more specific
      VIR_ERR_CONFIG_UNSUPPORTED
      
      * src/qemu/qemu_conf.c: Report VIR_ERR_CONFIG_UNSUPPORTED for
        unsupported video adapters
      3fb992c6
  24. 15 4月, 2010 1 次提交
    • S
      nwfilter: fix tear down order and consolidate functions · 41b08719
      Stefan Berger 提交于
      To avoid race-conditions, the tear down of a filter has to happen before
      the tap interface disappears and another tap interface with the same
      name can re-appear. This patch tries to fix this. In one place, where
      communication with the qemu monitor may fail, I am only tearing the
      filters down after knowing that the function did not fail.
      
      I am also moving the tear down functions into an include file for other
      drivers to reuse.
      41b08719
  25. 09 4月, 2010 1 次提交
  26. 08 4月, 2010 2 次提交
  27. 07 4月, 2010 1 次提交