1. 11 2月, 2010 3 次提交
  2. 10 2月, 2010 4 次提交
  3. 09 2月, 2010 3 次提交
  4. 04 2月, 2010 1 次提交
    • D
      Fix restore of QEMU guests with PCI device reservation · 83acdeaf
      Daniel P. Berrange 提交于
      When restoring from a saved guest image, the XML would already
      contain the PCI slot ID of the IDE controller & video card.
      The attempt to explicitly reserve this upfront would thus fail
      everytime.
      
      * src/qemu/qemu_conf.c: Reserve IDE controller / video card
        slot at time of need, rather than upfront
      83acdeaf
  5. 03 2月, 2010 6 次提交
    • D
      Fix QEMU hotplug device alias assignment · 719c50ca
      Daniel P. Berrange 提交于
      To allow devices to be hot(un-)plugged it is neccessary to ensure
      they all have a unique device aliases. This fixes the hotplug
      methods to assign device aliases before invoking the monitor
      commands which need them
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Expose methods
        for assigning device aliases for disks, host devices and
        controllers
      * src/qemu/qemu_driver.c: Assign device aliases when hotplugging
        all types of device
      * tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args:
        Update for changed hostdev naming scheme
      719c50ca
    • D
      Re-arrange QEMU device alias assignment code · 16478459
      Daniel P. Berrange 提交于
      This patch re-arranges the QEMU device alias assignment code to
      make it easier to call into the same codeblock when performing
      device hotplug. The new code has the ability to skip over already
      assigned names to facilitate hotplug
      
      * src/qemu/qemu_driver.c: Call qemuAssignDeviceNetAlias()
        instead of qemuAssignNetNames
      * src/qemu/qemu_conf.h: Export qemuAssignDeviceNetAlias()
        instead of qemuAssignNetNames
      * src/qemu/qemu_driver.c: Merge the legacy disk/network alias
        assignment code into the main methods
      16478459
    • 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
      Remove use of -netdev arg with QEMU · 49a0f6cd
      Daniel P. Berrange 提交于
      The QEMU 0.12.x tree has the -netdev command line argument, but not
      corresponding monitor command. We can't enable the former, without
      the latter since it will break hotplug/unplug.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Disable -netdev usage
        until 0.13 at earliest
      * tests/qemuxml2argvtest.c: Add test for -netdev syntax
      * tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args,
        tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml: Test
        data files for -netdev syntax
      49a0f6cd
    • D
      Assign PCI addresses before hotplugging devices · d8acc446
      Daniel P. Berrange 提交于
      PCI disk, disk controllers, net devices and host devices need to
      have PCI addresses assigned before they are hot-plugged
      
      * src/qemu/qemu_conf.c: Add APIs for ensuring a device has an
        address and releasing unused addresses
      * src/qemu/qemu_driver.c: Ensure all devices have addresses
        when hotplugging.
      d8acc446
    • D
      Rewrite way QEMU PCI addresses are allocated · 9258ec0a
      Daniel P. Berrange 提交于
      The current QEMU code allocates PCI addresses incrementally starting
      at 4. This is not satisfactory because the user may have given some
      addresses in their XML config, which need to be skipped over when
      allocating addresses to remaining devices.
      
      It is thus neccessary to maintain a list of already allocated PCI
      addresses and then only allocate ones that remain unused. This is
      also required for domain device hotplug to work properly later.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add APIs for creating
        list of existing PCI addresses, and allocating new addresses.
        Refactor address assignment to use this code
      * src/qemu/qemu_driver.c: Pull PCI address assignment up into the
        qemuStartVMDaemon() method, as a prelude to moving it into the
        'define' method. Update list of allocated addresses when connecting
        to a running VM at daemon startup.
      * tests/qemuxml2argvtest.c, tests/qemuargv2xmltest.c,
        tests/qemuxml2xmltest.c: Remove USB product test since all
        passthrough is done based on address
      * tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args,
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml: Kil
        unused data files
      9258ec0a
  6. 02 2月, 2010 2 次提交
    • D
      Split out QEMU code for building PCI/USB hostdev arg values · 96c8608d
      Daniel P. Berrange 提交于
      To allow for better code reuse from hotplug methods, the code for
      generating PCI/USB hostdev arg values is split out into separate
      methods
      
      * qemu/qemu_conf.h, qemu/qemu_conf.c: Introduce new APis for
        qemuBuildPCIHostdevPCIDevStr, qemuBuildUSBHostdevUsbDevStr
        and qemuBuildUSBHostdevDevStr
      96c8608d
    • D
      Standard internal API syntax for building QEMU command line arguments · c129d4fe
      Daniel P. Berrange 提交于
      All the helper functions for building command line arguments
      now return a 'char *', instead of acepting a 'char **' or
      virBufferPtr argument
      
      * qemu/qemu_conf.c: Standardize syntax for building args
      * qemu/qemu_conf.h: Export all functions for building args
      * qemu/qemu_driver.c: Update for changed syntax for building
        NIC/hostnet args
      c129d4fe
  7. 01 2月, 2010 2 次提交
    • M
      Clarify controllers -device string in QEMU driver · 09080c38
      Matthew Booth 提交于
      The QEMU driver contained code to generate a -device string for piix4-ide, but
      wasn't using it. This change removes this string generation. It also adds a
      comment explaining why IDE and FDC controllers don't generate -device strings.
      
      The change also generates an error if a sata controller is specified for a QEMU
      domain, as this isn't supported.
      
      * src/qemu/qemu_conf.c: Remove VIR_DOMAIN_CONTROLLER_TYPE_IDE handler in
        qemuBuildControllerDevStr(). Ignore IDE and FDC controllers. Error if
        SATA controller is discovered. Add comments.
      09080c38
    • C
      Look in /usr/libexec for the qemu-kvm binary. · b16cd226
      Chris Lalancette 提交于
      On RHEL-5 the qemu-kvm binary is located in /usr/libexec.
      To reduce confusion for people trying to run upstream libvirt
      on RHEL-5 machines, make the qemu driver look in /usr/libexec
      for the qemu-kvm binary.
      
      To make this work, I modified virFindFileInPath to handle an
      absolute path correctly.  I also ran into an issue where
      NULL was sometimes being passed for the file parameter
      to virFindFileInPath; it didn't crash prior to this patch
      since it was building paths like /usr/bin/(null).  This
      is non-standard behavior, though, so I added a NULL
      check at the beginning.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      b16cd226
  8. 26 1月, 2010 1 次提交
  9. 22 1月, 2010 1 次提交
  10. 21 1月, 2010 4 次提交
    • J
      avoid more format-related warnings · d47b6e54
      Jim Meyering 提交于
      * src/qemu/qemu_conf.c (qemuBuildDriveStr): Use "%s".
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetGuestPCIAddress):
      (qemuMonitorJSONGetGuestDriveAddress): Likewise.
      d47b6e54
    • D
      Add configuration option to turn off dynamic permissions management · 5b6782f9
      Daniel P. Berrange 提交于
      Add the ability to turn off dynamic management of file permissions
      for libvirt guests.
      
      * qemu/libvirtd_qemu.aug: Support 'dynamic_ownership' flag
      * qemu/qemu.conf: Document 'dynamic_ownership' flag.
      * qemu/qemu_conf.c: Load 'dynamic_ownership' flag
      * qemu/test_libvirtd_qemu.aug: Test 'dynamic_ownership' flag
      5b6782f9
    • M
      Unset copied environment variables in qemuxml2argvtest · 1671b647
      Matthias Bolte 提交于
      The test expected all environment variables copied in qemudBuildCommandLine
      to have known values. So all of them have to be either set to a known value
      or be unset. SDL_VIDEODRIVER and QEMU_AUDIO_DRV are not handled at all but
      should be handled. Unset both, otherwise the test will fail if they are set
      in the testing environment.
      
      * src/qemu/qemu_conf.c: add a comment about copied environment variables
        and qemuxml2argvtest
      * tests/qemuxml2argvtest.c: unset SDL_VIDEODRIVER and QEMU_AUDIO_DRV
      1671b647
    • M
      qemu: Don't allocate zero bytes · aef96949
      Matthias Bolte 提交于
      aef96949
  11. 20 1月, 2010 1 次提交
  12. 19 1月, 2010 2 次提交
    • J
      Implement CPU topology support for QEMU driver · 5d462bd0
      Jiri Denemark 提交于
      QEMU's command line equivalent for the following domain XML fragment
          <vcpus>2</vcpus>
          <cpu ...>
              ...
              <topology sockets='1' cores='2', threads='1'/>
          </cpu>
      
      is
      
          -smp 2,sockets=1,cores=2,threads=1
      
      This syntax was introduced in QEMU-0.12.
      
      Version 2 changes:
      - -smp argument build split into a separate function
      - always add ",sockets=S,cores=C,threads=T" to -smp if qemu supports it
      - use qemuParseCommandLineKeywords for command line parsing
      
      Version 3 changes:
      - ADD_ARG_LIT => ADD_ARG and line reordering in qemudBuildCommandLine
      - rebased
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      5d462bd0
    • J
      Enhance qemuParseCommandLineKeywords · 014c9f31
      Jiri Denemark 提交于
      Current version expects name=value,... list and when an incorrect string
      such as "a,b,c=d" would be parsed as "a,b,c" keyword with "d" value
      without reporting any error, which is probably not the expected
      behavior.
      
      This patch adds an extra argument called allowEmptyValue, which if
      non-zero will permit keywords with no value; "a,b=c,,d=" will be parsed
      as follows:
          keyword value
          "a"     NULL
          "b"     "c"
          ""      NULL
          "d"     ""
      
      In case allowEmptyValue is zero, the string is required to contain
      name=value pairs only; retvalues is guaranteed to contain non-NULL
      pointers. Now, "a,b,c=d" will result in an error.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      014c9f31
  13. 18 1月, 2010 10 次提交
    • D
      Convert VirtIO balloon over to -device syntax · b6692414
      Daniel P. Berrange 提交于
      Replace
      
         -balloon virtio
      
      With
      
         -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
      
      This allows it to get correct assigned PCI address as declared in
      previous patch
      
       * src/qemu/qemu_conf.c: Convert Virtio ballon to -device and
         give it an explicit PCI address
       * tests/qemuxml2argvdata/qemuxml2argv-*args: Add in virtio balloon
         where appropriate
      b6692414
    • D
      Auto-assign PCI addresses · a44d0dc2
      Daniel P. Berrange 提交于
      Instead of relying on QEMU to assign PCI addresses and then querying
      them with 'info pci', manually assign all PCI addresses before starting
      the guest.  These addresses are not stable across reboots. That will
      come in a later patch
      
      NB, the PIIX3 (IDE, FDC, ISA-Bridge) will always have slot 1 and
      VGA will always have slot 2. We declare the Virtio Balloon gets
      slot 3, and then all remaining slots are for configured devices.
      
      * src/qemu/qemu_conf.c: If -device is supported, then assign all PCI
        addresses when building the command line
      * src/qemu/qemu_driver.c: Don't query monitor for PCI addresses if
        they have already been assigned
      * tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
        tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
        tests/qemuxml2argvdata/qemuxml2argv-sound-device.args,
        tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args: Update
        to include PCI slot/bus information
      a44d0dc2
    • D
      Pass -vga none if no video card specified · febc5916
      Daniel P. Berrange 提交于
      QEMU always configures a VGA card. If no video card is included in
      the libvirt XML, it is neccessary to explicitly turn off the default
      using -vga none
      
      * src/qemu/qemu_conf.c: Pass -vga none if no video card is configured
      * tests/qemuargv2xmltest.c, tests/qemuxml2argvtest.c: Test for
        handling -vga none.
      * tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args,
        tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml: Test
        data files
      febc5916
    • D
      Add support for explicit -sdl flag to QEMU · 4f6c9990
      Daniel P. Berrange 提交于
      Not all QEMU builds default to SDL graphics for their display.
      Newer QEMU now has an explicit -sdl flag, which we can use to
      explicitly request SDL intead of relying on the default. This
      protects libvirt against unexpected changes in graphics default
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Probe for -sdl
        flag and use it if it is found
      * tests/qemuhelptest.c: Add SDL flag to tests
      4f6c9990
    • D
      Convert guestfwd to -device, and add -sdl explicit args · d86c876a
      Daniel P. Berrange 提交于
      The old syntax was
      
         -chardev SOMECONFIG
         -nic user,guestfwd=tcp:IP:PORT-chardev:CHARDEV
      
      The new syntax is
      
         -chardev SOMECONFIG
         -netdev user,guestfwd=tcp:IP:PORT,chardev=ID,id=user-ID
      d86c876a
    • D
      Convert PCI device assignment over to -device · 16658da4
      Daniel P. Berrange 提交于
      The old syntax is
      
        -pcidevice host=BUS:SLOT:FUNCTION
      
      The new syntax is
      
        -device pci-assign,host=BUS:SLOT:FUNCTION,addr=<PCI SLOT>,id=host0
      16658da4
    • D
      Convert USB input devices to -device · e8d43d06
      Daniel P. Berrange 提交于
      e8d43d06
    • D
      Convert USB hostdevices over to -device · 42ce352c
      Daniel P. Berrange 提交于
      The old syntax was
      
         -usbdevice host:PRODUCT:VENDOR
      
      Or
      
         -usbdevice host:BUS.DEV
      
      The new syntax is
      
         -device usb-host,product=PRODUCT,vendor=VENDOR
      
      Or
      
         -device usb-host,hostbus=BUS,hostaddr=DEV
      42ce352c
    • D
      Convert USB disks over to -device · 73370e98
      Daniel P. Berrange 提交于
      The previous syntax was severely limited in its options
      
        -usbdevice disk:/home/berrange/output.img
      
      The new syntax is the same as for other disk types
      
        -drive file=/home/berrange/output.img,if=none,id=usb-1,index=1
        -device usb-storage,drive=usb-1
      
      Again, the index= arg is wrong here, and will be removed in a
      later merge
      73370e98
    • D
      Convert NICs over to use -device & -netdev where possible · 1dd6f855
      Daniel P. Berrange 提交于
      The current syntax uses a pair of args
      
         -net nic,macaddr=52:54:00:56:6c:55,vlan=3,model=pcnet,name=pcnet.0
         -net user,vlan=3,name=user.0
      
      The new syntax does not  need the vlan craziness anymore, and
      so has a simplified pair of args
      
         -netdev user,id=user.0
         -device pcnet,netdev=user.0,id=pcnet.0,mac=52:54:00:56:6c:55,addr=<PCI SLOT>
      1dd6f855