1. 18 1月, 2010 8 次提交
    • 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 3 次提交
    • 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
    • M
      Allow character devices to have different target types · 89d549c3
      Matthew Booth 提交于
      A character device's target (it's interface in the guest) had only a
      single property: port. This patch is in preparation for adding targets
      which require other properties.
      Since this changes the conf type for character devices this affects
      a number of drivers:
      
      * src/conf/domain_conf.[ch] src/esx/esx_vmx.c src/qemu/qemu_conf.c
        src/qemu/qemu_driver.c src/uml/uml_conf.c src/uml/uml_driver.c
        src/vbox/vbox_tmpl.c src/xen/xend_internal.c src/xen/xm_internal.c:
        target properties are moved into a union in virDomainChrDef, and a
        targetType field is added to identify which union member should be
        used. All current code which touches a virDomainChrDef is updated both
        to use the new union field, and to populate targetType if necessary.
      89d549c3
  20. 04 11月, 2009 2 次提交
    • G
      add MAC address based port filtering to qemu · 0aa72ac6
      Gerhard Stenzel 提交于
      * src/qemu/qemu.conf src/qemu/qemu_conf.c src/qemu/qemu_conf.h: there is
        a new config type option for mac filtering
      * src/qemu/qemu_bridge_filter.[ch]: new module for the ebtable entry points
      * src/qemu/qemu_driver.c: plug the MAC filtering at the right places
        in the domain life cycle
      * src/Makefile.am po/POTFILES.in: add the new module
      0aa72ac6
    • C
      Various error reporting fixes · 4c44cdcc
      Cole Robinson 提交于
      - Don't duplicate SystemError
      - Use proper error code in domain_conf
      - Fix a broken error call in qemu_conf
      - Don't use VIR_ERR_ERROR in security driver (isn't a valid code in this case)
      4c44cdcc
  21. 03 11月, 2009 1 次提交
    • D
      Annotate many methods with ATTRIBUTE_RETURN_CHECK & fix problems · 46992453
      Daniel P. Berrange 提交于
      Nearly all of the methods in src/util/util.h have error codes that
      must be checked by the caller to correct detect & report failure.
      Add ATTRIBUTE_RETURN_CHECK to ensure compile time validation of
      this
      
      * daemon/libvirtd.c: Add explicit check on return value of virAsprintf
      * src/conf/domain_conf.c: Add missing check on virParseMacAddr return
        value status & report error
      * src/network/bridge_driver.c: Add missing OOM check on virAsprintf
        and report error
      * src/qemu/qemu_conf.c: Add missing check on virParseMacAddr return
        value status & report error
      * src/security/security_selinux.c: Remove call to virRandomInitialize
        that's done in libvirt.c already
      * src/storage/storage_backend_logical.c: Add check & log on virRun
        return status
      * src/util/util.c: Add missing checks on virAsprintf/Run status
      * src/util/util.h: Annotate all methods with ATTRIBUTE_RETURN_CHECK
        if they return an error status code
      * src/vbox/vbox_tmpl.c: Add missing check on virParseMacAddr
      * src/xen/xm_internal.c: Add missing checks on virAsprintf
      * tests/qemuargv2xmltest.c: Remove bogus call to virRandomInitialize()
      46992453
  22. 27 10月, 2009 1 次提交
  23. 21 10月, 2009 1 次提交
  24. 15 10月, 2009 1 次提交
    • M
      Don't copy old machines from a domain which has none · 2210f8a3
      Mark McLoughlin 提交于
      If the the qemu and kvm binaries are the same, we don't include machine
      types in the kvm domain info.
      
      However, the code which refreshes the machine types info from the
      previous capabilities structure first looks at the kvm domain's info,
      finds it matches and then copies the empty machine types list over
      for the top-level qemu domain.
      
      That doesn't make sense, we shouldn't copy an empty machin types list.
      
      * src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
        empty machine types list.
      2210f8a3
  25. 30 9月, 2009 1 次提交
  26. 29 9月, 2009 1 次提交
    • D
      Allow control over QEMU audio backend · b08e6d38
      Daniel P. Berrange 提交于
      When using VNC for graphics + keyboard + mouse, we shouldn't
      then use the host OS for audio. Audio should go back over
      VNC.
      
      When using SDL for graphics, we should use the host OS for
      audio since that's where the display is. We need to allow
      certain QEMU env variables to be passed through to guest
      too to allow choice of QEMU audio backend.
      
      * qemud/libvirtd.sysconf: Mention QEMU/SDL audio env vars
      * src/qemu_conf.c: Passthrough QEMU/SDL audio env for SDL display,
        disable host audio for VNC display
      b08e6d38