1. 26 1月, 2010 1 次提交
  2. 22 1月, 2010 1 次提交
  3. 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
  4. 20 1月, 2010 1 次提交
  5. 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
  6. 18 1月, 2010 18 次提交
    • 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
    • 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
  7. 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
  8. 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
  9. 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
  10. 22 12月, 2009 2 次提交
  11. 18 12月, 2009 1 次提交
  12. 16 12月, 2009 1 次提交
  13. 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
  14. 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
  15. 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
  16. 24 11月, 2009 1 次提交