1. 08 2月, 2013 1 次提交
  2. 07 1月, 2013 1 次提交
    • O
      conf: Parse and format the new XML · 535aed56
      Osier Yang 提交于
      Like "rawio", "sgio" is only allowed for block disk of device
      type "lun".
      
      It doesn't default disk->sgio to "filtered" when parsing, as
      it won't be able to distinguish explicitly requested "filtered"
      and a default "filtered" in driver then. We have to error out for
      explicit request when the kernel doesn't support the new sysfs
      knob "unpriv_sgio", however, for defaulted "filtered", we can
      just ignore it if the kernel doesn't support "unpriv_sgio".
      535aed56
  3. 07 12月, 2012 1 次提交
  4. 29 11月, 2012 1 次提交
  5. 18 10月, 2012 1 次提交
  6. 20 9月, 2012 2 次提交
  7. 14 9月, 2012 1 次提交
    • M
      qemu: Add support for EOI with APIC · fbf9aa12
      Martin Kletzander 提交于
      This patch adds full support for EOI setting for domains. Because this
      is CPU feature (flag), the model needs to be added even when it's not
      specified. Fortunately this problem was already solved with kvmclock,
      so this patch simply abuses that.
      
      And due to the size of the patch (17 lines) I dared to include the tests.
      fbf9aa12
  8. 03 9月, 2012 1 次提交
  9. 16 8月, 2012 1 次提交
    • L
      conf: add <vlan> element to network and domain interface elements · 3f9274a5
      Laine Stump 提交于
      The following config elements now support a <vlan> subelements:
      
      within a domain: <interface>, and the <actual> subelement of <interface>
      within a network: the toplevel, as well as any <portgroup>
      
      Each vlan element must have one or more <tag id='n'/> subelements.  If
      there is more than one tag, it is assumed that vlan trunking is being
      requested. If trunking is required with only a single tag, the
      attribute "trunk='yes'" should be added to the toplevel <vlan>
      element.
      
      Some examples:
      
        <interface type='hostdev'/>
          <vlan>
            <tag id='42'/>
          </vlan>
          <mac address='52:54:00:12:34:56'/>
          ...
        </interface>
      
        <network>
          <name>vlan-net</name>
          <vlan trunk='yes'>
            <tag id='30'/>
          </vlan>
          <virtualport type='openvswitch'/>
        </network>
      
        <interface type='network'/>
          <source network='vlan-net'/>
          ...
        </interface>
      
        <network>
          <name>trunk-vlan</name>
          <vlan>
            <tag id='42'/>
            <tag id='43'/>
          </vlan>
          ...
        </network>
      
        <network>
          <name>multi</name>
          ...
          <portgroup name='production'/>
            <vlan>
              <tag id='42'/>
            </vlan>
          </portgroup>
          <portgroup name='test'/>
            <vlan>
              <tag id='666'/>
            </vlan>
          </portgroup>
        </network>
      
        <interface type='network'/>
          <source network='multi' portgroup='test'/>
          ...
        </interface>
      
      IMPORTANT NOTE: As of this patch there is no backend support for the
      vlan element for *any* network device type. When support is added in
      later patches, it will only be for those select network types that
      support setting up a vlan on the host side, without the guest's
      involvement. (For example, it will be possible to configure a vlan for
      a guest connected to an openvswitch bridge, but it won't be possible
      to do that for one that is connected to a standard Linux host bridge.)
      3f9274a5
  10. 18 5月, 2012 1 次提交
  11. 16 5月, 2012 1 次提交
    • D
      Fix logic for assigning PCI addresses to USB2 companion controllers · 1ebd52cb
      Daniel P. Berrange 提交于
      Currently each USB2 companion controller gets put on a separate
      PCI slot. Not only is this wasteful of PCI slots, but it is not
      in compliance with the spec for USB2 controllers. The master
      echi1 and all companion controllers should be in the same slot,
      with echi1 in function 7, and uhci1-3 in functions 0-2 respectively.
      
      * src/qemu/qemu_command.c: Special case handling of USB2 controllers
        to apply correct pci slot assignment
      * tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.args,
        tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml: Expand
        test to cover automatic slot assignment
      1ebd52cb
  12. 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
  13. 23 4月, 2012 1 次提交
    • E
      blockjob: enhance xml to track mirrors across libvirtd restart · ae6aa8c3
      Eric Blake 提交于
      In order to track a block copy job across libvirtd restarts, we
      need to save internal XML that tracks the name of the file
      holding the mirror.  Displaying this name in dumpxml might also
      be useful to the user, even if we don't yet have a way to (re-)
      start a domain with mirroring enabled up front.  This is done
      with a new <mirror> sub-element to <disk>, as in:
      
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/original.img'/>
            <mirror file='/var/lib/libvirt/images/copy.img' format='qcow2' ready='yes'/>
            ...
          </disk>
      
      For now, the element is output-only, in live domains; it is ignored
      when defining a domain or hot-plugging a disk (since those contexts
      use VIR_DOMAIN_XML_INACTIVE in parsing).  The 'ready' attribute appears
      when libvirt knows that the job has changed from the initial pulling
      phase over to the mirroring phase, although absence of the attribute
      is not a sure indicator of the current phase.  If we come up with a way
      to make qemu start with mirroring enabled, we can relax the xml
      restriction, and allow <mirror> (but not attribute 'ready') on input.
      Testing active-only XML meant tweaking the testsuite slightly, but it
      was worth it.
      
      * docs/schemas/domaincommon.rng (diskspec): Add diskMirror.
      * docs/formatdomain.html.in (elementsDisks): Document it.
      * src/conf/domain_conf.h (_virDomainDiskDef): New members.
      * src/conf/domain_conf.c (virDomainDiskDefFree): Clean them.
      (virDomainDiskDefParseXML): Parse them, but only internally.
      (virDomainDiskDefFormat): Output them.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: New test file.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml: Likewise.
      * tests/qemuxml2xmltest.c (testInfo): Alter members.
      (testCompareXMLToXMLHelper): Allow more test control.
      (mymain): Run new test.
      ae6aa8c3
  14. 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
  15. 08 3月, 2012 1 次提交
    • E
      xml: allow scaled memory on input · 2e22f23b
      Eric Blake 提交于
      Output is still in kibibytes, but input can now be in different
      scales for ease of typing.
      
      * src/conf/domain_conf.c (virDomainParseMemory): New helper.
      (virDomainDefParseXML): Use it when parsing.
      * docs/schemas/domaincommon.rng: Expand XML; rename memoryKBElement
      to memoryElement and update callers.
      * docs/formatdomain.html.in (elementsMemoryAllocation): Document
      scaling.
      * tests/qemuxml2argvdata/qemuxml2argv-memtune.xml: Adjust test.
      * tests/qemuxml2xmltest.c: Likewise.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml: New file.
      2e22f23b
  16. 06 3月, 2012 1 次提交
    • L
      conf: parse/format type='hostdev' network interfaces · 3b1c191f
      Laine Stump 提交于
      This is the new interface type that sets up an SR-IOV PCI network
      device to be assigned to the guest with PCI passthrough after
      initializing some network device-specific things from the config
      (e.g. MAC address, virtualport profile parameters). Here is an example
      of the syntax:
      
        <interface type='hostdev' managed='yes'>
          <source>
            <address type='pci' domain='0' bus='0' slot='4' function='3'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
          <address type='pci' domain='0' bus='0' slot='7' function='0'/>
        </interface>
      
      This would assign the PCI card from bus 0 slot 4 function 3 on the
      host, to bus 0 slot 7 function 0 on the guest, but would first set the
      MAC address of the card to 00:11:22:33:44:55.
      
      NB: The parser and formatter don't care if the PCI card being
      specified is a standard single function network adapter, or a virtual
      function (VF) of an SR-IOV capable network adapter, but the upcoming
      code that implements the back end of this config will work *only* with
      SR-IOV VFs. This is because modifying the mac address of a standard
      network adapter prior to assigning it to a guest is pointless - part
      of the device reset that occurs during that process will reset the MAC
      address to the value programmed into the card's firmware.
      
      Although it's not supported by any of libvirt's hypervisor drivers,
      usb network hostdevs are also supported in the parser and formatter
      for completeness and consistency. <source> syntax is identical to that
      for plain <hostdev> devices, except that the <address> element should
      have "type='usb'" added if bus/device are specified:
      
        <interface type='hostdev'>
          <source>
            <address type='usb' bus='0' device='4'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
        </interface>
      
      If the vendor/product form of usb specification is used, type='usb'
      is implied:
      
        <interface type='hostdev'>
          <source>
            <vendor id='0x0012'/>
            <product id='0x24dd'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
        </interface>
      
      Again, the upcoming patch to fill in the backend of this functionality
      will log an error and fail with "Unsupported Config" if you actually
      try to assign a USB network adapter to a guest using <interface
      type='hostdev'> - just use a standard <hostdev> entry in that case
      (and also for single-port PCI adapters).
      3b1c191f
  17. 28 2月, 2012 1 次提交
  18. 13 2月, 2012 2 次提交
  19. 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
  20. 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
  21. 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
  22. 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
  23. 25 1月, 2012 1 次提交
    • Z
      Allow custom metadata in domain configuration XML · fa981fc9
      Zeeshan Ali (Khattak) 提交于
      Applications can now insert custom nodes and hierarchies into domain
      configuration XML. Although currently not enforced, applications are
      required to use their own namespaces on every custom node they insert,
      with only one top-level element per namespace.
      fa981fc9
  24. 17 1月, 2012 1 次提交
    • 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
  25. 14 1月, 2012 2 次提交
  26. 09 1月, 2012 1 次提交
    • L
      qemu: add new disk device='lun' for bus='virtio' & type='block' · 177db087
      Laine Stump 提交于
      In the past, generic SCSI commands issued from a guest to a virtio
      disk were always passed through to the underlying disk by qemu, and
      the kernel would also pass them on.
      
      As a result of CVE-2011-4127 (see:
      http://seclists.org/oss-sec/2011/q4/536), qemu now honors its
      scsi=on|off device option for virtio-blk-pci (which enables/disables
      passthrough of generic SCSI commands), and the kernel will only allow
      the commands for physical devices (not for partitions or logical
      volumes). The default behavior of qemu is still to allow sending
      generic SCSI commands to physical disks that are presented to a guest
      as virtio-blk-pci devices, but libvirt prefers to disable those
      commands in the standard virtio block devices, enabling it only when
      specifically requested (hopefully indicating that the requester
      understands what they're asking for). For this purpose, a new libvirt
      disk device type (device='lun') has been created.
      
      device='lun' is identical to the default device='disk', except that:
      
      1) It is only allowed if bus='virtio', type='block', and the qemu
         version is "new enough" to support it ("new enough" == qemu 0.11 or
         better), otherwise the domain will fail to start and a
         CONFIG_UNSUPPORTED error will be logged).
      
      2) The option "scsi=on" will be added to the -device arg to allow
         SG_IO commands (if device !='lun', "scsi=off" will be added to the
         -device arg so that SG_IO commands are specifically forbidden).
      
      Guests which continue to use disk device='disk' (the default) will no
      longer be able to use SG_IO commands on the disk; those that have
      their disk device changed to device='lun' will still be able to use SG_IO
      commands.
      
      *docs/formatdomain.html.in - document the new device attribute value.
      *docs/schemas/domaincommon.rng - allow it in the RNG
      *tests/* - update the args of several existing tests to add scsi=off, and
       add one new test that will test scsi=on.
      *src/conf/domain_conf.c - update domain XML parser and formatter
      
      *src/qemu/qemu_(command|driver|hotplug).c - treat
       VIR_DOMAIN_DISK_DEVICE_LUN *almost* identically to
       VIR_DOMAIN_DISK_DEVICE_DISK, except as indicated above.
      
      Note that no support for this new device value was added to any
      hypervisor drivers other than qemu, because it's unclear what it might
      mean (if anything) to those drivers.
      177db087
  27. 30 12月, 2011 2 次提交
    • E
      seclabel: allow a seclabel override on a disk src · b4343293
      Eric Blake 提交于
      Implement the parsing and formatting of the XML addition of
      the previous commit.  The new XML doesn't affect qemu command
      line, so we can now test round-trip XML->memory->XML handling.
      
      I chose to reuse the existing structure, even though per-device
      override doesn't use all of those fields, rather than create a
      new structure, in order to reuse more code.
      
      * src/conf/domain_conf.h (_virDomainDiskDef): Add seclabel member.
      * src/conf/domain_conf.c (virDomainDiskDefFree): Free it.
      (virSecurityLabelDefFree): New function.
      (virDomainDiskDefFormat): Print it.
      (virSecurityLabelDefFormat): Reduce output if model not present.
      (virDomainDiskDefParseXML): Alter signature, and parse seclabel.
      (virSecurityLabelDefParseXML): Split...
      (virSecurityLabelDefParseXMLHelper): ...into new helper.
      (virDomainDeviceDefParse, virDomainDefParseXML): Update callers.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args:
      New file.
      * tests/qemuxml2xmltest.c (mymain): Enhance test.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      b4343293
    • E
      schema: rewrite seclabel rng to match code · 116d6af9
      Eric Blake 提交于
      The RNG for <seclabel> was too strict - if it was present, then it
      had to have sub-elements, even if those didn't make sense for the
      given attributes.  Also, we didn't have any tests of <seclabel>
      parsing or XML output.
      
      In this patch, I added more parsing tests than output tests (since
      the output populates and/or reorders fields not present in certain
      inputs).  Making the RNG reliable is a precursor to using <seclabel>
      variants in more places in the XML in later patches.
      
      See also:
      http://berrange.com/posts/2011/09/29/two-small-improvements-to-svirt-guest-configuration-flexibility-with-kvmlibvirt/
      
      * docs/schemas/domaincommon.rng (seclabel): Tighten rules.
      * tests/qemuxml2argvtest.c (mymain): New tests.
      * tests/qemuxml2xmltest.c (mymain): Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-*.*: New files.
      116d6af9
  28. 02 12月, 2011 1 次提交
    • E
      build: properly skip tests · da8061ee
      Eric Blake 提交于
      I got this failure on FreeBSD:
      
      shunloadtest.c: In function 'main':
      shunloadtest.c:150: error: 'EXIT_AM_SKIP' undeclared (first use in this function)
      
      but inspection showed several other problems, all fixed here.
      
      * tests/domainsnapshotxml2xmltest.c [!WITH_QEMU]: Ensure
      EXIT_AM_SKIP is defined.
      * tests/esxutilstest.c [!WITH_ESX]: Likewise.
      * tests/openvzutilstest.c [!WITH_OPENVZ]: Likewise.
      * tests/qemuargv2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuhelptest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2argvtest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxmlnstest.c [!WITH_QEMU]: Likewise.
      * tests/shunloadtest.c [!linux]: Likewise.
      * tests/vmx2xmltest.c [!WITH_VMX]: Likewise.
      * tests/xml2vmxtest.c [!WITH_VMX]: Likewise.
      da8061ee
  29. 01 12月, 2011 1 次提交
  30. 30 11月, 2011 1 次提交
  31. 03 11月, 2011 1 次提交
    • D
      Allow multiple consoles per virtual guest · 0873b688
      Daniel P. Berrange 提交于
      While Xen only has a single paravirt console, UML, and
      QEMU both support multiple paravirt consoles. The LXC
      driver can also be trivially made to support multiple
      consoles. This patch extends the XML to allow multiple
      <console> elements in the XML. It also makes the UML
      and QEMU drivers support this config.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
        multiple <console> devices
      * src/lxc/lxc_driver.c, src/xen/xen_driver.c,
        src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
        internal API changes
      * src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Only label consoles that aren't a copy of the serial device
      * src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
        src/qemu/qemu_process.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Support multiple console devices
      * tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
        tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
        for all console /channel tests
      * tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
        for correct chardev syntax
      * tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
        test file
      0873b688
  32. 02 9月, 2011 1 次提交
  33. 15 8月, 2011 1 次提交
    • L
      qemu: support event_idx parameter for virtio disk and net devices · 73c0a148
      Laine Stump 提交于
      In some versions of qemu, both virtio-blk-pci and virtio-net-pci
      devices can have an event_idx setting that determines some details of
      event processing. When it is enabled, it "reduces the number of
      interrupts and exits for the guest". qemu will automatically enable
      this feature when it is available, but there may be cases where this
      new feature could actually make performance worse (NB: no such case
      has been found so far).
      
      As a safety switch in case such a situation is encountered in the
      field, this patch adds a new attribute "event_idx" to the <driver>
      element of both disk and interface devices. event_idx can be set to
      "on" (to force event_idx on in case qemu has it disabled by default)
      or "off" (for force event_idx off). In the case that event_idx support
      isn't present in qemu, the attribute is ignored (this on the advice of
      the qemu developer).
      
      docs/formatdomain.html.in: document the new flag (marking it as
         "don't mess with this!"
      docs/schemas/domain.rng: add event_idx in appropriate places
      src/conf/domain_conf.[ch]: add event_idx to parser and formatter
      src/libvirt_private.syms: export
         virDomainVirtioEventIdx(From|To)String
      src/qemu/qemu_capabilities.[ch]: detect and report event_idx in
         disk/net
      src/qemu/qemu_command.c: add event_idx parameter to qemu commandline
          when appropriate.
      tests/qemuxml2argvdata/qemuxml2argv-event_idx.args,
      tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml,
      tests/qemuxml2argvtest.c,
      tests/qemuxml2xmltest.c: test cases for event_idx.
      73c0a148
  34. 29 7月, 2011 2 次提交
    • M
      tests: Unify style of test skipping code · cffba7ea
      Matthias Bolte 提交于
      Prefer 'return EXIT_AM_SKIP' over 'exit(EXIT_AM_SKIP)'.
      
      Prefer 'int main(void)' over 'int main(int argc, char **argv)'.
      
      Fix mymain signature in commandtest and nodeinfotest.
      cffba7ea
    • L
      conf: add <listen> subelement to domain <graphics> element · ef79fb5b
      Laine Stump 提交于
      Once it's plugged in, the <listen> element will be an optional
      replacement for the "listen" attribute that graphics elements already
      have. If the <listen> element is type='address', it will have an
      attribute called 'address' which will contain an IP address or dns
      name that the guest's display server should listen on. If, however,
      type='network', the <listen> element should have an attribute called
      'network' that will be set to the name of a network configuration to
      get the IP address from.
      
      * docs/schemas/domain.rng: updated to allow the <listen> element
      
      * docs/formatdomain.html.in: document the <listen> element and its
        attributes.
      
      * src/conf/domain_conf.[hc]:
      
        1) The domain parser, formatter, and data structure are modified to
           support 0 or more <listen> subelements to each <graphics>
           element. The old style "legacy" listen attribute is also still
           accepted, and will be stored internally just as if it were a
           separate <listen> element. On output (i.e. format), the address
           attribute of the first <listen> element of type 'address' will be
           duplicated in the legacy "listen" attribute of the <graphic>
           element.
      
        2) The "listenAddr" attribute has been removed from the unions in
           virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
           This attribute is now in the <listen> subelement (aka
           virDomainGraphicsListenDef)
      
        3) Helper functions were written to provide simple access
           (both Get and Set) to the listen elements and their attributes.
      
      * src/libvirt_private.syms: export the listen helper functions
      
      * src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
        src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
        src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
      
        Modify all these files to use the listen helper functions rather
        than directly referencing the (now missing) listenAddr
        attribute. There can be multiple <listen> elements to a single
        <graphics>, but the drivers all currently only support one, so all
        replacements of direct access with a helper function indicate index
        "0".
      
      * tests/* - only 3 of these are new files added explicitly to test the
        new <listen> element. All the others have been modified to reflect
        the fact that any legacy "listen" attributes passed in to the domain
        parse will be saved in a <listen> element (i.e. one of the
        virDomainGraphicsListenDefs), and during the domain format function,
        both the <listen> element as well as the legacy attributes will be
        output.
      ef79fb5b