1. 27 3月, 2010 1 次提交
    • D
      Add disk error policy to domain XML · 447c586a
      David Allan 提交于
      * Fixes per feedback from Dan and Daniel
      * Added test datafiles
      * Re-disabled JSON flags
      * Added code to print the error policy attribute when generating XML
      * Re-add empty tag
      447c586a
  2. 25 3月, 2010 2 次提交
  3. 24 3月, 2010 2 次提交
    • J
      tests: shell script portability and clean-up · ca7db6cb
      Jim Meyering 提交于
      * tests/test-lib.sh: "echo -n" is not portable.  Use printf instead.
      Remove unnecessary uses of "eval-in-subshell" (subshell is sufficient).
      Remove uses of tests' -a operator; it is not portable.
      Instead, use "test cond && test cond2".
      * tests/schematestutils.sh: Replace use of test's -a.
      ca7db6cb
    • M
      tests: Don't add extra padding if counter mod 40 is 0 · 8a7783c1
      Matthias Bolte 提交于
      This change only affects the output of tests that have an exact
      multiple of 40 test cases. For example the domainschematest currently:
      
      TEST: domainschematest
            ........................................ 40
            ........................................ 80
            ........................................ 120
            ........................................ 160
            ........................................                                         200 OK
      PASS: domainschematest
      
      It outputs additional 40 spaces on the last line.
      
      The domainschematest output is fixed by the change in test-lib.sh. The
      change in testutils.c fixes this for tests written in C. Currently no
      C test has an exact multiple of 40 test cases, but I checked it and
      the same problem exists there.
      
      This patch stops that in both cases.
      8a7783c1
  4. 23 3月, 2010 2 次提交
  5. 18 3月, 2010 1 次提交
    • E
      maint: make Red Hat copyright notices consistent · 0a336335
      Eric Blake 提交于
      Spell out 'Red Hat, Inc.':
       git grep -i 'Copyright.*Red Hat' | grep -v Inc
      
      Include (C) consistently:
       git grep -i 'Copyright [^(].*Red Hat'
      
      * src/lxc/lxc_container.c: Update copyright formatting.
      * src/node_device/node_device_udev.c: Likewise.
      * src/node_device/node_device_udev.h: Likewise.
      * src/xen/xend_internal.h: Likewise.
      * src/xen/xm_internal.c: Likewise.
      * src/xen/xm_internal.h: Likewise.
      * tests/xmconfigtest.c: Likewise.
      * tests/object-locking.ml: Likewise.
      * tools/virt-pki-validate.in: Likewise.
      * tools/virt-xml-validate.in: Likewise.
      0a336335
  6. 16 3月, 2010 1 次提交
    • D
      qemu: pass the information when disks are read-only · f92c041a
      Daniel Veillard 提交于
      * src/qemu/qemu_conf.c: add the ",readonly=on" for read-only disks
        and also parse it back in qemuParseCommandLineDisk()
      * tests/qemuxml2argvtest.c
        tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.args
        tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.xml:
        add a specific regression test
      f92c041a
  7. 10 3月, 2010 1 次提交
  8. 08 3月, 2010 1 次提交
    • C
      Get thread and socket information in virsh nodeinfo. · aa2f6f96
      Chris Lalancette 提交于
      The current code for "nodeinfo" is pretty naive
      about socket and thread information.  To determine the
      sockets, it just takes the number of cpus and divides
      by the number of cores.  For the thread count, it always
      sets it to 1.  With more recent Intel machines, however,
      hyperthreading is again an option, meaning that these
      heuristics no longer work and give bogus numbers.  This
      patch goes through /sys to get the additional
      information so we properly report it.
      
      Note that I had to edit the tests not to report on
      socket and thread counts, since these are determined
      dynamically now.
      
      v2: As pointed out by Eric Blake, gnulib provides
          count-one-bits (which is LGPLv2+).  Use it instead
          of a hand-coded popcnt.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      aa2f6f96
  9. 02 3月, 2010 2 次提交
    • D
      Allow configurable timezones with QEMU · 74042b8f
      Daniel P. Berrange 提交于
      Allow an arbitrary timezone with QEMU by setting the $TZ environment
      variable when launching QEMU
      
      * src/qemu/qemu_conf.c: Set TZ environment variable if a timezone
        is requested
      * tests/qemuxml2argvtest.c: Add test case for timezones
      * tests/qemuxml2argvdata/qemuxml2argv-clock-france.xml,
        tests/qemuxml2argvdata/qemuxml2argv-clock-france.args: Data
        for timezone tests
      74042b8f
    • D
      Support variable clock offset mode in QEMU · 200c83b2
      Daniel P. Berrange 提交于
      This allows QEMU guests to be started with an arbitrary clock
      offset
      
      The test case can't actually be enabled, since QEMU argv expects
      an absolute timestring, and this will obviously change every
      time the test runs :-( Hopefully QEMU will allow a relative
      time offset in the future.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Use the -rtc arg
        if available to support variable clock offset mode
      * tests/qemuhelptest.c: Add QEMUD_CMD_FLAG_RTC for qemu 0.12.1
      * qemuxml2argvdata/qemuxml2argv-clock-variable.args,
        qemuxml2argvdata/qemuxml2argv-clock-variable.xml,
        qemuxml2argvtest.c: Test case, except we can't actually enable
        it yet.
      200c83b2
  10. 26 2月, 2010 1 次提交
  11. 25 2月, 2010 2 次提交
  12. 20 2月, 2010 1 次提交
    • D
      Fix daemon-conf invalid failures · b4bf5125
      David Allan 提交于
      The daemon-conf test would fail on my system if there was a system libvirtd
      running.  In the course of troubleshooting that problem, I discovered that the
      daemon-conf script would always fail if run by itself because it found the line:
      
      \# that each "PARAMETER = VALUE" line in this file have the parameter
      
      which it mistook for a line containing a parameter.  I have changed the test to
      avoid mistaking a line containing \"PARAMETER = VALUE\" for a parameter line.
      
      The corrupted config tests turned out to be failing because the test daemon was
      discovering the pid file from the running daemon and exiting before it processed
      the test config file.  Specifying the pid file for the corrupt config tests in
      the same way as for the valid config test solved that problem.
      b4bf5125
  13. 19 2月, 2010 2 次提交
    • M
      Add QEMU support for virtio channel · 3ec09478
      Matthew Booth 提交于
      Support virtio-serial controller and virtio channel in QEMU backend.
      Will output
      the following for virtio-serial controller:
      
      -device
      virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4,max_ports=16,vectors=4
      
      and the following for a virtio channel:
      
      -chardev pty,id=channel0 \
      -device
      virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0
      
      * src/qemu/qemu_conf.c: Add argument output for virtio
      * tests/qemuxml2argvtest.c
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args: Add test for
        QEMU command line generation
      3ec09478
    • M
      Add domain support for virtio channel · 7813a0f8
      Matthew Booth 提交于
      Add support for virtio-serial by defining a new 'virtio' channel target type
      and a virtio-serial controller. Allows the following to be specified in a
      domain:
      
      <controller type='virtio-serial' index='0' ports='16' vectors='4'/>
      <channel type='pty'>
        <target type='virtio' name='org.linux-kvm.port.0'/>
        <address type='virtio-serial' controller='0' bus='0'/>
      </channel>
      
      * docs/schemas/domain.rng: Add virtio-serial controller and virtio
        channel type.
      * src/conf/domain_conf.[ch]: Domain parsing/serialization for
        virtio-serial controller and virtio channel.
      * tests/qemuxml2xmltest.c
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: add domain xml
        parsing test
      * src/libvirt_private.syms src/qemu/qemu_conf.c:
        virDomainDefAddDiskControllers() renamed to
        virDomainDefAddImplicitControllers()
      7813a0f8
  14. 17 2月, 2010 1 次提交
  15. 10 2月, 2010 8 次提交
  16. 03 2月, 2010 4 次提交
    • 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
      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
      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
  17. 26 1月, 2010 1 次提交
  18. 21 1月, 2010 2 次提交
    • J
      fix "make distcheck" failure · 2c8eb689
      Jim Meyering 提交于
      * tests/Makefile.am (qemuhelpdata): Add qemu-0.12.1.
      2c8eb689
    • 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
  19. 20 1月, 2010 1 次提交
  20. 19 1月, 2010 1 次提交
    • 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
  21. 18 1月, 2010 3 次提交
    • 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