1. 13 9月, 2012 2 次提交
  2. 04 9月, 2012 1 次提交
    • V
      Rename iolimit to blockio. · 72f1f220
      Viktor Mihajlovski 提交于
      After discussion with DB we decided to rename the new iolimit
      element as it creates the impression it would be there to
      limit (i.e. throttle) I/O instead of specifying immutable
      characteristics of a block device.
      This is also backed by the fact that the term I/O Limits has
      vanished from newer storage admin documentation.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      72f1f220
  3. 03 9月, 2012 1 次提交
  4. 01 9月, 2012 1 次提交
  5. 22 8月, 2012 1 次提交
  6. 08 8月, 2012 1 次提交
    • G
      qemu: add two qemu caps for lsi and virtio-scsi SCSI controllers · 015c603b
      Guannan Ren 提交于
      Rename qemuDefaultScsiControllerModel to qemuCheckScsiControllerModel.
      When scsi model is given explicitly in XML(model > 0) checking if the
      underlying QEMU supports it or not first, raise an error on checking
      failure.
      When the model is not given(mode <= 0), return LSI by default, if
      the QEMU doesn't support it, raise an error.
      015c603b
  7. 07 8月, 2012 1 次提交
    • D
      Convert public datatypes to inherit from virObject · 46ec5f85
      Daniel P. Berrange 提交于
      This converts the following public API datatypes to use the
      virObject infrastructure:
      
        virConnectPtr
        virDomainPtr
        virDomainSnapshotPtr
        virInterfacePtr
        virNetworkPtr
        virNodeDevicePtr
        virNWFilterPtr
        virSecretPtr
        virStreamPtr
        virStorageVolPtr
        virStoragePoolPtr
      
      The code is significantly simplified, since the mutex in the
      virConnectPtr object now only needs to be held when accessing
      the per-connection virError object instance. All other operations
      are completely lock free.
      
      * src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
        public datatypes to use virObject
      * src/conf/domain_event.c, src/phyp/phyp_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_process.c, src/storage/storage_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
        tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
        tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
        to use virObjectUnref/virObjectRef
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      46ec5f85
  8. 02 8月, 2012 1 次提交
    • P
      qemu: Add support for "none" USB controller · fbe87126
      Peter Krempa 提交于
      This patch enables the "none" USB controller for qemu guests and adds
      valdiation on hot-plugged devices if the guest has USB disabled.
      
      This patch also adds a set of tests to check parsing of domain XMLs that
      use the "none" controller and some forbidden situations concerning it.
      fbe87126
  9. 23 7月, 2012 1 次提交
    • P
      tests: Add support for catching domain XML parsing errors · fa54d2a8
      Peter Krempa 提交于
      This patch enhances qemuxml2argvtest to deal with semantically incorrect
      domain XMLs, that generate errors while parsing.
      
      This patch cleans up macros that invoke the tests and changes boolean
      flags to a bit array flag variable.
      fa54d2a8
  10. 11 7月, 2012 2 次提交
  11. 05 6月, 2012 1 次提交
  12. 18 5月, 2012 1 次提交
  13. 09 5月, 2012 2 次提交
    • O
      numad: Copy 'placement' of <numatune> to <vcpu> by default · 8d26a7fd
      Osier Yang 提交于
      With this patch, one can also fully drive numad by:
      
        <vcpu>2</vcpu>
        <numatune>
          <memory placement='auto'/>
        </numatune>
      
      New tests are added.
      8d26a7fd
    • O
      numad: Set memory policy from numad advisory nodeset · 97010eb1
      Osier Yang 提交于
      Though numad will manage the memory allocation of task dynamically,
      it wants management application (libvirt) to pre-set the memory
      policy according to the advisory nodeset returned from querying numad,
      (just like pre-bind CPU nodeset for domain process), and thus the
      performance could benefit much more from it.
      
      This patch introduces new XML tag 'placement', value 'auto' indicates
      whether to set the memory policy with the advisory nodeset from numad,
      and its value defaults to the value of <vcpu> placement, or 'static'
      if 'nodeset' is specified. Example of the new XML tag's usage:
      
        <numatune>
          <memory placement='auto' mode='interleave'/>
        </numatune>
      
      Just like what current "numatune" does, the 'auto' numa memory policy
      setting uses libnuma's API too.
      
      If <vcpu> "placement" is "auto", and <numatune> is not specified
      explicitly, a default <numatume> will be added with "placement"
      set as "auto", and "mode" set as "strict".
      
      The following XML can now fully drive numad:
      
      1) <vcpu> placement is 'auto', no <numatune> is specified.
      
         <vcpu placement='auto'>10</vcpu>
      
      2) <vcpu> placement is 'auto', no 'placement' is specified for
         <numatune>.
      
         <vcpu placement='auto'>10</vcpu>
         <numatune>
           <memory mode='interleave'/>
         </numatune>
      
      And it's also able to control the CPU placement and memory policy
      independently. e.g.
      
      1) <vcpu> placement is 'auto', and <numatune> placement is 'static'
      
         <vcpu placement='auto'>10</vcpu>
         <numatune>
           <memory mode='strict' nodeset='0-10,^7'/>
         </numatune>
      
      2) <vcpu> placement is 'static', and <numatune> placement is 'auto'
      
         <vcpu placement='static' cpuset='0-24,^12'>10</vcpu>
         <numatune>
           <memory mode='interleave' placement='auto'/>
         </numatume>
      
      A follow up patch will change the XML formatting codes to always output
      'placement' for <vcpu>, even it's 'static'.
      97010eb1
  14. 08 5月, 2012 1 次提交
  15. 04 5月, 2012 1 次提交
    • S
      tests: fix resource leak · a01e6721
      Stefan Berger 提交于
      Error: RESOURCE_LEAK:
      /libvirt/tests/qemuxml2argvtest.c:47:
      alloc_arg: Calling allocation function "virAlloc" on "ret".
      /libvirt/src/util/memory.c:101:
      alloc_fn: Storage is returned from allocation function "calloc".
      /libvirt/src/util/memory.c:101:
      var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /libvirt/tests/qemuxml2argvtest.c:54:
      leaked_storage: Variable "ret" going out of scope leaks the storage it points to.
      a01e6721
  16. 17 4月, 2012 2 次提交
    • O
      qemu: Split ide-drive into ide-cd and ide-hd · a4cda054
      Osier Yang 提交于
      A "ide-drive" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      Upstream qemu splitted "ide-drive" into "ide-hd" and "ide-cd"
      since commit 1f56e32, and ",media=cdrom" is not required for
      ide-cd anymore. "ide-drive" is still supported for backwards
      compatibility, but no doubt we should go foward.
      a4cda054
    • O
      qemu: Split scsi-disk into into scsi-hd and scsi-cd · 02e8d0cf
      Osier Yang 提交于
      A "scsi-disk" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      But upstream qemu splitted "scsi-disk" into "scsi-hd" and
      "scsi-cd" since commit b443ae, and ",media=cdrom" is not
      required for scsi-cd anymore. "scsi-disk" is still supported
      for backwards compatibility, but no doubt we should go
      foward.
      02e8d0cf
  17. 06 4月, 2012 1 次提交
    • L
      test: fix build errors with gcc 4.7.0 and -O0 · 06a1a45c
      Laine Stump 提交于
      When building on Fedora 17 (which uses gcc 4.7.0) with -O0 in CFLAGS,
      three of the tests failed to compile.
      
      cputest.c and qemuxml2argvtest.c had non-static structs defined
      inside the macro that was being repeatedly invoked. Due to some so-far
      unidentified change in gcc, the stack space used by variables defined
      inside { } is not recovered/re-used when the block ends, so all these
      structs have become additive (this is the same problem worked around
      in commit cf57d345). Fortunately, these two files could be fixed with
      a single line addition of "static" to the struct definition in the
      macro.
      
      virnettlscontexttest.c was a bit different, though. The problem structs
      in the do/while loop of macros had non-constant initializers, so it
      took a bit more work and piecemeal initialization instead of member
      initialization to get things to be happy.
      
      In an ideal world, none of these changes should be necessary, but not
      knowing how long it will be until the gcc regressions are fixed, and
      since the code is just as correct after this patch as before, it makes
      sense to fix libvirt's build for -O0 while also reporting the gcc
      problem.
      06a1a45c
  18. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  19. 23 3月, 2012 1 次提交
    • O
      qemu: Do not start with source for removable disks if tray is open · ad7db439
      Osier Yang 提交于
      This is similiar with physical world, one will be surprised if the
      box starts with medium exists while the tray is open.
      
      New tests are added, tests disk-{cdrom,floppy}-tray are for the qemu
      supports "-device" flag, and disk-{cdrom,floppy}-no-device-cap are
      for old qemu, i.e. which doesn't support "-device" flag.
      ad7db439
  20. 14 3月, 2012 1 次提交
  21. 09 3月, 2012 2 次提交
  22. 06 3月, 2012 1 次提交
    • L
      qemu: support type='hostdev' network devices at domain start · 8639a420
      Laine Stump 提交于
      This patch makes sure that each network device ("interface") of
      type='hostdev' appears on both the hostdevs list and the nets list of
      the virDomainDef, and it modifies the qemu driver startup code so that
      these devices will be presented to qemu on the commandline as hostdevs
      rather than as network devices.
      
      It does not add support for hotplug of these type of devices, or code
      to honor the <mac address> or <virtualport> given in the config (both
      of those will be done in separate patches).
      
      Once each device is placed on both lists, much of what this patch does
      is modify places in the code that traverse all the device lists so
      that these hybrid devices are only acted on once - either along with
      the other hostdevs, or along with the other network interfaces. (In
      many cases, only one of the lists is traversed / a specific operation
      is performed on only one type of device. In those instances, the code
      can remain unchanged.)
      
      There is one special case - when building the commandline, interfaces
      are allowed to proceed all the way through
      networkAllocateActualDevice() before deciding to skip the rest of
      netdev-specific processing - this is so that (once we have support for
      networks with pools of hostdev devices) we can get the actual device
      allocated, then rely on the loop processing all hostdevs to generate
      the correct commandline.
      
      (NB: <interface type='hostdev'> is only supported for PCI network
      devices that are SR-IOV Virtual Functions (VF). Standard PCI[e] and
      USB devices, and even the Physical Functions (PF) of SR-IOV devices
      can only be assigned to a guest using the more basic <hostdev> device
      entry. This limitation is mostly due to the fact that non-SR-IOV
      ethernet devices tend to lose mac address configuration whenever the
      card is reset, which happens when a card is assigned to a guest;
      SR-IOV VFs fortunately don't suffer the same problem.)
      8639a420
  23. 28 2月, 2012 1 次提交
  24. 13 2月, 2012 2 次提交
  25. 07 2月, 2012 1 次提交
    • E
      seclabel: make code and RNG match · c052d8a8
      Eric Blake 提交于
      Commit b170eb99 introduced a bug: domains that had an explicit
      <seclabel type='none'/> when started would not be reparsed if
      libvirtd restarted.  It turns out that our testsuite was not
      exercising this because it never tried anything but inactive
      parsing.  Additionally, the live XML for such a domain failed
      to re-validate.  Applying just the tests/ portion of this patch
      will expose the bugs that are fixed by the other two files.
      
      * docs/schemas/domaincommon.rng (seclabel): Allow relabel under
      type='none'.
      * src/conf/domain_conf.c (virSecurityLabelDefParseXML): Per RNG,
      presence of <seclabel> with no type implies dynamic.  Don't
      require sub-elements for type='none'.
      * tests/qemuxml2xmltest.c (mymain): Add test.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml: Add file.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args: Add file.
      Reported by Ansis Atteka.
      c052d8a8
  26. 04 2月, 2012 1 次提交
    • E
      build: expand rule to cover testsuite · 8fe454ce
      Eric Blake 提交于
      The bulk of this patch was done with:
      
      sed -i 's/\(\bfree *(/VIR_FREE(/g' tests/*.c
      
      followed by fixing the few compile errors that resulted.
      
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation):
      Remove tests from exemption.
      * tests/testutils.h: Add common header.
      * tests/commandhelper.c: Fix offenders.
      * tests/cputest.c: Likewise.
      * tests/domainsnapshotxml2xmltest.c: Likewise.
      * tests/interfacexml2xmltest.c: Likewise.
      * tests/networkxml2argvtest.c: Likewise.
      * tests/networkxml2xmltest.c: Likewise.
      * tests/nodedevxml2xmltest.c: Likewise.
      * tests/nodeinfotest.c: Likewise.
      * tests/nwfilterxml2xmltest.c: Likewise.
      * tests/qemuargv2xmltest.c: Likewise.
      * tests/qemuxml2argvtest.c: Likewise.
      * tests/qemuxml2xmltest.c: Likewise.
      * tests/qemuxmlnstest.c: Likewise.
      * tests/qparamtest.c: Likewise.
      * tests/sexpr2xmltest.c: Likewise.
      * tests/storagepoolxml2xmltest.c: Likewise.
      * tests/storagevolxml2xmltest.c: Likewise.
      * tests/testutils.c: Likewise.
      * tests/virshtest.c: Likewise.
      * tests/xencapstest.c: Likewise.
      * tests/xmconfigtest.c: Likewise.
      * tests/xml2sexprtest.c: Likewise.
      8fe454ce
  27. 31 1月, 2012 1 次提交
    • L
      qemu: (and conf) support rombar for network devices · 3284ac04
      Laine Stump 提交于
      When support for the rombar option was added, it was only added for
      PCI passthrough devices, configured with <hostdev>. The same option is
      available for any network device that is attached to the guest's PCI
      bus. This patch allows setting rombar for any PCI network device type.
      
      After adding cases to test this to qemuxml2argv-hostdev-pci-rombar.*,
      I decided to rename those files (to qemuxml2argv-pci-rom.*) to more
      accurately reflect the additional tests, and also noticed that up to
      now we've only been performing a domainschematest for that case, so I
      added the "pci-rom" test to both qemuxml2argv and qemuxml2xml (and in
      the process found some bugs whose fixes I squashed into previous
      commits of this series).
      3284ac04
  28. 27 1月, 2012 1 次提交
    • P
      qemu: parse and create -cpu ...,-kvmclock · b66d1bef
      Paolo Bonzini 提交于
      QEMU supports a bunch of CPUID features that are tied to the kvm CPUID
      nodes rather than the processor's.  They are "kvmclock",
      "kvm_nopiodelay", "kvm_mmu", "kvm_asyncpf".  These are not known to
      libvirt and their CPUID leaf might move if (for example) the Hyper-V
      extensions are enabled. Hence their handling would anyway require some
      special-casing.
      
      However, among these the most useful is kvmclock; an additional
      "property" of this feature is that a <timer> element is a better model
      than a CPUID feature.  Although, creating part of the -cpu command-line
      from something other than the <cpu> XML element introduces some
      ugliness.
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b66d1bef
  29. 19 1月, 2012 1 次提交
    • M
      Added capability checking for block <iotune> setting. · 4c82f09e
      Martin Kletzander 提交于
      There was missing capability for blkiotune and thus specifying these
      settings caused libvirt to run qemu with invalid parameters and then
      reporting qemu error instead of the standard libvirt one. The support
      for blkiotune setting was added in upstream qemu repo under commit
      0563e191516289c9d2f282a8c50f2eecef2fa773.
      4c82f09e
  30. 18 1月, 2012 1 次提交
    • D
      Add new attribute wrpolicy to <driver> element · d9e0d820
      Deepak C Shetty 提交于
      This introduces new attribute wrpolicy with only supported
      value as immediate. This will be an optional
      attribute with no defaults. This helps specify whether
      to skip the host page cache.
      
      When wrpolicy is specified, meaning when wrpolicy=immediate
      a writeback is explicitly initiated for the dirty pages in
      the host page cache as part of the guest file write operation.
      
      Usage:
      <filesystem type='mount' accessmode='passthrough'>
        <driver type='path' wrpolicy='immediate'/>
        <source dir='/export/to/guest'/>
        <target dir='mount_tag'/>
      </filesystem>
      
      Currently this only works with type='mount' for the QEMU/KVM driver.
      Signed-off-by: NDeepak C Shetty <deepakcs@linux.vnet.ibm.com>
      d9e0d820
  31. 17 1月, 2012 3 次提交
    • J
      qemu: Add support for host CPU modes · e7201afd
      Jiri Denemark 提交于
      This adds support for host-model and host-passthrough CPU modes to qemu
      driver. The host-passthrough mode is mapped to -cpu host.
      e7201afd
    • J
      cpu: Optionally forbid fallback CPU models · a6f88cbd
      Jiri Denemark 提交于
      In case a hypervisor doesn't support the exact CPU model requested by a
      domain XML, we automatically fallback to a closest CPU model the
      hypervisor supports (and make sure we add/remove any additional features
      if needed). This patch adds 'fallback' attribute to model element, which
      can be used to disable this automatic fallback.
      a6f88cbd
    • O
      docs: Add missed RNG schema for interface · a5f8a01a
      Osier Yang 提交于
      We support <interface> of type "mcast", "server", and "client",
      but the RNG schema for them are missed. Attribute "address" is
      optional for "server" type. And these 3 types support
      <mac address='MAC'/>, too.
      a5f8a01a
  32. 14 1月, 2012 1 次提交
    • M
      tests: Add qemuxml2argv tests for PPC64 pseries machine · 4b942fe8
      Michael Ellerman 提交于
      Add four tests of the XML -> argv handling for the PPC64 pseries machine.
      
      The first is just a basic test of a bare bones machine.
      
      The three others test various aspects of the spapr-vio address handling.
      
      It seems that currently we can't include network devices, doing so leads
      to a segfault because the network driverState is not initialised. Working
      around that leads us to the problem that the 'default' network doesn't
      exist. So for now just leave network devices out.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      4b942fe8