1. 18 1月, 2010 17 次提交
    • 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
    • D
      Convert disk drive over to use -device where available · 6237e9c8
      Daniel P. Berrange 提交于
      The current preferred syntax for disk drives uses
      
        -drive file=/vms/plain.qcow,if=virtio,index=0,boot=on,format=qcow
      
      The new syntax splits this up into a pair of linked args
      
        -drive file=/vms/plain.qcow,if=none,id=drive-virtio-0,format=qcow2
        -device virtio-blk-pci,drive=drive-virtio-0,id=virtio-0,addr=<PCI SLOT>
      
      SCSI/IDE devices also get a bus property linking them to the
      controller
      
        -device scsi-disk,drive=drive-scsi0-0-0,id=scsi0-0-0,bus=scsi0.0,scsi-id=0
        -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0,bus=ide0,unit=0
      6237e9c8
    • D
      Convert audio devices over to -device syntax · 4886cba7
      Daniel P. Berrange 提交于
      The current syntax for audio devices is a horrible multiplexed
      arg
      
          -soundhw sb16,pcspk,ac97
      
      The new syntax is
      
          -device sb16,id=sound0
      
      or
      
          -device AC97,id=sound1,addr=<PCI SLOT>
      
      NB, pcspk still uses the old -soundhw syntax
      4886cba7
    • D
      Convert watchdog to -device · 38a22fbf
      Daniel P. Berrange 提交于
      The current syntax for watchdogs is
      
          -watchdog i6300esb
      
      The new syntax will now be
      
          -device i6300esb,id=watchdogNN,addr=<PCI-SLOT>
      38a22fbf
    • D
      Convert character devices over to use -device · 7b2f8cdd
      Daniel P. Berrange 提交于
      The current character device syntax uses either
      
        -serial tty,path=/dev/ttyS2
      
      Or
      
        -chardev tty,id=serial0,path=/dev/ttyS2 -serial chardev:serial0
      
      With the new -device support, we now prefer
      
        -chardev file,id=serial0,path=/tmp/serial.log -device isa-serial,chardev=serial0
      
      This patch changes the existing -chardev syntax to use this new
      scheme, and fallbacks to the old plain -serial syntax for old
      QEMU.
      
      The monitor device changes to
      
        -chardev socket,id=monitor,path=/tmp/test-monitor,server,nowait -mon chardev=monitor
      
      In addition, this patch adds --nodefaults, which kills off the
      default serial, parallel, vga and nic devices. THis avoids the
      need for us to explicitly turn each off
      7b2f8cdd
    • D
      Assign device aliases for all devices at startup · 05330717
      Daniel P. Berrange 提交于
      When starting a guest, give every device a unique alias. This will
      be used for the 'id' parameter in -device args in later patches.
      It can also be used to uniquely identify devices in the monitor
      
      For old QEMU without -device, assign disk names based on QEMU's
      historical naming scheme.
      
      * src/qemu/qemu_conf.c: Assign unique device aliases
      * src/qemu/qemu_driver.c: Remove obsolete qemudDiskDeviceName
        and use the device alias in eject & blockstats commands
      05330717
    • D
      Probe for -device and use -nodefaults · 1ed1bf3a
      Daniel P. Berrange 提交于
      Probe for the new -device flag and if available set the -nodefaults
      flag, instead of using -net none, -serial none or -parallel none.
      Other device types will be converted to use -device in later patches.
      The -nodefaults flag will help avoid unwelcome surprises from future
      QEMU releases
      
      * src/qemu/qemu_conf.c: Probe for -device. Add -nodefaults flag.
        Remove -net none, -serial none or -parallel none
      * src/qemu/qemu_conf.h: Define QEMU_CMD_FLAG_DEVICE
      * tests/qemuhelpdata/qemu-0.12.1: New data file for 0.12.1 QEMU
      * tests/qemuhelptest.c: Test feature extraction from 0.12.1 QEMU
      1ed1bf3a
    • 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
      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
  2. 16 1月, 2010 3 次提交
    • D
      Specify bus/unit instead of index for disks with QEMU · d78554d8
      Daniel P. Berrange 提交于
      The current code for using -drive simply sets the -drive 'index'
      parameter. QEMU internally converts this to bus/unit depending
      on the type of drive. This does not give us precise control over
      the bus/unit assignment though. This change switches over to make
      libvirt explicitly calculate the bus/unit number.
      
      In addition bus/unit/index are actually irrelevant for VirtIO
      disks, since each virtio disk is a separate PCI device. No disk
      controller is involved.
      
      Doing the conversion to bus/unit in libvirt allows us to correctly
      attach SCSI controllers when required.
      
      * src/qemu/qemu_conf.c: Specify bus/unit instead of index for
        disks
      * tests/qemuxml2argvdata/qemuxml2argv-disk*.args: Switch over from
        using index=NNNN, to bus=NN, unit=NN for SCSI/IDE/Floppy disks
      d78554d8
    • D
      Split code for building QEMU -drive arg in separate method · 2982d73a
      Daniel P. Berrange 提交于
      To enable it to be called from multiple locations, split out
      the code for building the -drive arg string. This will be needed
      by later patches which do drive hotplug, the conversion to use
      -device, and the conversion to controller/bus/unit addressing
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuBuildDriveStr
        for building -drive arg string
      2982d73a
    • 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
  3. 08 1月, 2010 1 次提交
    • D
      Qemu: ask for memory preallocation with large pages · edcae5a7
      Daniel Veillard 提交于
      The -mem-prealloc flag should be used when using large pages
      This ensures qemu tries to allocate all required memory immediately,
      rather than when first used. The latter mode will crash qemu
      if hugepages aren't available when accessed, while the former
      should gracefully fallback to non-hugepages.
      
      * src/qemu/qemu_conf.c: add -mem-prealloc flag to qemu command line
        when using large pages
      edcae5a7
  4. 07 1月, 2010 1 次提交
    • A
      qemu: Always enable the virtio balloon driver · 7a90f216
      Adam Litke 提交于
      The behavior for the qemu balloon device has changed.  Formerly, a virtio
      balloon device was provided by default.  Now, '-balloon virtio' must be
      specified on the command line to enable it.  This patch causes libvirt to
      add '-balloon virtio' to the command line whenever the -balloon option is
      available.
      * src/qemu/qemu_conf.c src/qemu/qemu_conf.h: check for the new flag and
        add "-baloon vitio" to qemu command when needed
      * tests/qemuhelptest.c: add the new flag for detection
      7a90f216
  5. 22 12月, 2009 2 次提交
  6. 18 12月, 2009 1 次提交
  7. 16 12月, 2009 1 次提交
  8. 14 12月, 2009 1 次提交
    • M
      Make QEMU driver use -chardev everywhere if available · a8eb010e
      Matthew Booth 提交于
      Change -monitor, -serial and -parallel output to use -chardev if it is
      available.
      * src/qemu/qemu_conf.c: Update qemudBuildCommandLine to use -chardev where
        available.
      * tests/qemuxml2argvtest.c tests/qemuxml2argvdata/: Add -chardev equivalents
        for all current serial and parallel tests.
      a8eb010e
  9. 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
  10. 08 12月, 2009 1 次提交
    • D
      Support for JSON mode monitor · 3a4f172f
      Daniel P. Berrange 提交于
      Initial support for the new QEMU monitor protocol  using JSON
      as the data encoding format instead of plain text
      
      * po/POTFILES.in: Add src/qemu/qemu_monitor_json.c
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Hack to turn on QMP
        mode. Replace with a version number check on >= 0.12 later
      * src/qemu/qemu_monitor.c: Delegate to json monitor if enabled
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
        impl of QMP protocol
      * src/Makefile.am: Add src/qemu/qemu_monitor_json.{c,h}
      3a4f172f
  11. 24 11月, 2009 1 次提交
  12. 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
  13. 20 11月, 2009 1 次提交
    • S
      qemu-kvm needs -enable-kvm flag for VT optimization · b827338a
      Steve Yarmie 提交于
      Recent qemu releases require command option '-enable-qemu' in order
      for the kvm functionality be activated. Libvirt needs to pass this flag
      to qemu when starting a domain. Note that without the option,
      even if both the kernel and qemu support KVM, KVM will not be activated
      and VMs will be very slow.
      
      * src/qemu/qemu_conf.h src/qemu/qemu_conf.c: parse the extra command
        line option from help and add it when running kvm
      * tests/qemuhelptest.c: this modified the flags output for qemu-0.10.5
        and qemu-kvm-0.11.0-rc2 regression tests
      b827338a
  14. 13 11月, 2009 1 次提交
  15. 12 11月, 2009 1 次提交
    • P
      Support for SATA Disks in virDomainDiskBus · 2e236074
      pritesh 提交于
      * src/conf/domain_conf.h src/conf/domain_conf.c: add the new entry in
        the enum and lists of virDomainDiskBus
      * src/qemu/qemu_conf.c: same for virDomainDiskQEMUBus
      2e236074
  16. 11 11月, 2009 1 次提交
  17. 10 11月, 2009 1 次提交
  18. 06 11月, 2009 2 次提交
  19. 05 11月, 2009 2 次提交
    • M
      Support for <channel> in domain and QEmu backend · af249ea4
      Matthew Booth 提交于
      allows the following to be specified in a domain:
      <channel type='pipe'>
        <source path='/tmp/guestfwd'/>
        <target type='guestfwd' address='10.0.2.1' port='4600'/>
      </channel>
      
      * proxy/Makefile.am: add network.c as dep of domain_conf.c
      * docs/schemas/domain.rng src/conf/domain_conf.[ch]: extend the domain
        schemas and the parsing/serialization side for the new construct
      
      QEmu support will add the following on the qemu command line:
       -chardev pipe,id=channel0,path=/tmp/guestfwd
       -net user,guestfwd=tcp:10.0.2.1:4600-chardev:channel0
      
      * src/qemu/qemu_conf.c: Add argument output for channel
      * tests/qemuxml2(argv|xml)test.c: Add test for <channel> domain syntax
      af249ea4
    • M
      Detect availability of QEMU -chardev CLI option · 74003968
      Matthew Booth 提交于
      * src/qemu/qemu_conf.h: defines a new QEMUD_CMD_FLAG_CHARDEV flag
      * src/qemu/qemu_conf.c: parse the output for -chardev and set flag
        appropriately
      74003968