1. 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
  2. 18 4月, 2012 1 次提交
    • O
      docs: Improve the schema for fs device · 7adeac67
      Osier Yang 提交于
      <filesystemtgt> is redundant, as every group uses it; <address>
      shouldn't be in <filesystemtgt> in case of the meaning could be
      "filesystemtarget"; The elements <address>, <alias>, <target>,
      ... should be interleaved.
      7adeac67
  3. 02 4月, 2012 1 次提交
    • P
      Support clock=variable relative to localtime · b8bf79aa
      Philipp Hahn 提交于
      Since Xen 3.1 the clock=variable semantic is supported. In addition to
      qemu/kvm Xen also knows about a variant where the offset is relative to
      'localtime' instead of 'utc'.
      
      Extends the libvirt structure with a flag 'basis' to specify, if the
      offset is relative to 'localtime' or 'utc'.
      
      Extends the libvirt structure with a flag 'reset' to force the reset
      behaviour of 'localtime' and 'utc'; this is needed for backward
      compatibility with previous versions of libvirt, since they report
      incorrect XML.
      
      Adapt the only user 'qemu' to the new name.
      Extend the RelaxNG schema accordingly.
      Document the new 'basis' attribute in the HTML documentation.
      Adapt test for the new attribute.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      b8bf79aa
  4. 27 3月, 2012 2 次提交
    • D
      Add LXC XML files to schema test & fix problems this uncovers · 72c50731
      Daniel P. Berrange 提交于
      * docs/schemas/domaincommon.rng: Add missing lxc & openvz
        console target types. Allow arch on LXC <os> type element
      * tests/domainschematest: Include tests/lxcxml2xmldata/
      72c50731
    • D
      Add support for setting init argv for LXC · c91cff25
      Daniel P. Berrange 提交于
      Pass argv to the init binary of LXC, using a new <initarg> element.
      
      * docs/formatdomain.html.in: Document <os> usage for containers
      * docs/schemas/domaincommon.rng: Add <initarg> element
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
        formatting of <initarg>
      * src/lxc/lxc_container.c: Setup LXC argv
      * tests/Makefile.am, tests/lxcxml2xmldata/lxc-systemd.xml,
        tests/lxcxml2xmltest.c, tests/testutilslxc.c,
        tests/testutilslxc.h: Test parsing/formatting of LXC related
        XML parts
      c91cff25
  5. 23 3月, 2012 1 次提交
  6. 20 3月, 2012 1 次提交
    • L
      conf: forbid use of multicast mac addresses · 00072373
      Laine Stump 提交于
      A few times libvirt users manually setting mac addresses have
      complained of a networking failure that ends up being due to a multicast
      mac address being used for a guest interface. This patch prevents that
      by logging an error and failing if a multicast mac address is
      encountered in each of the three following cases:
      
      1) domain xml <interface> mac address.
      2) network xml bridge mac address.
      3) network xml dhcp/host mac address.
      
      There are several other places where a mac address can be input that
      aren't controlled in this manner because failure to do so has no
      consequences (e.g., if the address will be used to search through
      existing interfaces for a match).
      
      The RNG has been updated to add multiMacAddr and uniMacAddr along with
      the existing macAddr, and macAddr was switched to uniMacAddr where
      appropriate.
      00072373
  7. 16 3月, 2012 1 次提交
    • D
      Add support for forcing a private network namespace for LXC guests · 10a8b1f9
      Daniel P. Berrange 提交于
      If no <interface> elements are included in an LXC guest XML
      description, then the LXC guest will just see the host's
      network interfaces. It is desirable to be able to hide the
      host interfaces, without having to define any guest interfaces.
      
      This patch introduces a new feature flag <privnet/> to allow
      forcing of a private network namespace for LXC. In the future
      I also anticipate that we will add <privuser/> to force a
      private user ID namespace.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add support
        for <privnet/> feature. Auto-set <privnet> if any <interface>
        devices are defined
      * src/lxc/lxc_container.c: Honour request for private network
        namespace
      10a8b1f9
  8. 15 3月, 2012 1 次提交
    • O
      qemu: Support numad · 0f8e7ae3
      Osier Yang 提交于
      numad is an user-level daemon that monitors NUMA topology and
      processes resource consumption to facilitate good NUMA resource
      alignment of applications/virtual machines to improve performance
      and minimize cost of remote memory latencies. It provides a
      pre-placement advisory interface, so significant processes can
      be pre-bound to nodes with sufficient available resources.
      
      More details: http://fedoraproject.org/wiki/Features/numad
      
      "numad -w ncpus:memory_amount" is the advisory interface numad
      provides currently.
      
      This patch add the support by introducing a new XML attribute
      for <vcpu>. e.g.
      
        <vcpu placement="auto">4</vcpu>
        <vcpu placement="static" cpuset="1-10^6">4</vcpu>
      
      The returned advisory nodeset from numad will be printed
      in domain's dumped XML. e.g.
        <vcpu placement="auto" cpuset="1-10^6">4</vcpu>
      
      If placement is "auto", the number of vcpus and the current
      memory amount specified in domain XML will be used for numad
      command line (numad uses MB for memory amount):
        numad -w $num_of_vcpus:$current_memory_amount / 1024
      
      The advisory nodeset returned from numad will be used to set
      domain process CPU affinity then. (e.g. qemuProcessInitCpuAffinity).
      
      If the user specifies both CPU affinity policy (e.g.
      (<vcpu cpuset="1-10,^7,^8">4</vcpu>) and placement == "auto"
      the specified CPU affinity will be overridden.
      
      Only QEMU/KVM drivers support it now.
      
      See docs update in patch for more details.
      0f8e7ae3
  9. 12 3月, 2012 1 次提交
    • E
      qemu: support disk filenames with comma · 6e0ff1d4
      Eric Blake 提交于
      If there is a disk file with a comma in the name, QEmu expects a double
      comma instead of a single one (e.g., the file "virtual,disk.img" needs
      to be specified as "virtual,,disk.img" in QEmu's command line). This
      patch fixes libvirt to work with that feature. Fix RHBZ #801036.
      
      Based on an initial patch by Crístian Viana.
      
      * src/util/buf.h (virBufferEscape): Alter signature.
      * src/util/buf.c (virBufferEscape): Add parameter.
      (virBufferEscapeSexpr): Fix caller.
      * src/qemu/qemu_command.c (qemuBuildRBDString): Likewise.  Also
      escape commas in file names.
      (qemuBuildDriveStr): Escape commas in file names.
      * docs/schemas/basictypes.rng (absFilePath): Relax RNG to allow
      commas in input file names.
      * tests/qemuxml2argvdata/*-disk-drive-network-sheepdog.*: Update
      test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6e0ff1d4
  10. 09 3月, 2012 1 次提交
  11. 08 3月, 2012 6 次提交
    • P
      xml: Clean up schemas to use shared data types instead of local · cdab483e
      Peter Krempa 提交于
      The schema files contained duplicate data types that can be shared from
      the basictypes.rng file.
      cdab483e
    • 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
    • E
      xml: drop unenforced minimum memory limit from RNG · 1b1402b9
      Eric Blake 提交于
      The test domain allows <memory>0</memory>, but the RNG was stating
      that memory had to be at least 4096000 bytes.  Hypervisors should
      enforce their own limits, rather than complicating the RNG.
      
      Meanwhile, some copy and paste had introduced some fishy constructs
      in various unit tests.
      
      * docs/schemas/domaincommon.rng (memoryKB, memoryKBElement): Drop
      limit that isn't enforced in code.
      * src/conf/domain_conf.c (virDomainDefParseXML): Require current
      <= maximum.
      * tests/qemuxml2argvdata/*.xml: Fix offenders.
      1b1402b9
    • E
      storage: support more scaling suffixes · 2e148612
      Eric Blake 提交于
      Disk manufacturers are fond of quoting sizes in powers of 10,
      rather than powers of 2 (after all, 2.1 GB sounds larger than
      2.0 GiB, even though the exact opposite is true).  So, we might
      as well follow coreutils' lead in supporting three types of
      suffix: single letter ${u} (which we already had) and ${u}iB
      for the power of 2, and ${u}B for power of 10.
      
      Additionally, it is impossible to create a file with more than
      2**63 bytes, since off_t is signed (if you have enough storage
      to even create one 8EiB file, I'm jealous).  This now reports
      failure up front rather than down the road when the kernel
      finally refuses an impossible size.
      
      * docs/schemas/basictypes.rng (unit): Add suffixes.
      * src/conf/storage_conf.c (virStorageSize): Use new function.
      * docs/formatstorage.html.in: Document it.
      * tests/storagevolxml2xmlin/vol-file-backing.xml: Test it.
      * tests/storagevolxml2xmlin/vol-file.xml: Likewise.
      2e148612
    • E
      xml: output memory unit for clarity · 26545784
      Eric Blake 提交于
      Make it obvious to 'dumpxml' readers what unit we are using,
      since our default of KiB for memory (1024) differs from qemu's
      default of MiB; and differs from our use of bytes for storage.
      
      Tests were updated via:
      
      $ find tests/*data tests/*out -name '*.xml' | \
        xargs sed -i 's/<\(memory\|currentMemory\|hard_limit\|soft_limit\|min_guarantee\|swap_hard_limit\)>/<\1 unit='"'KiB'>/"
      $ find tests/*data tests/*out -name '*.xml' | \
        xargs sed -i 's/<\(capacity\|allocation\|available\)>/<\1 unit='"'bytes'>/"
      
      followed by a few fixes for the stragglers.
      
      Note that with this patch, the RNG for <memory> still forbids
      validation of anything except unit='KiB', since the code silently
      ignores the attribute; a later patch will expand <memory> to allow
      scaled input in the code and update the RNG to match.
      
      * docs/schemas/basictypes.rng (unit): Add 'bytes'.
      (scaledInteger): New define.
      * docs/schemas/storagevol.rng (sizing): Use it.
      * docs/schemas/storagepool.rng (sizing): Likewise.
      * docs/schemas/domaincommon.rng (memoryKBElement): New define; use
      for memory elements.
      * src/conf/storage_conf.c (virStoragePoolDefFormat)
      (virStorageVolDefFormat): Likewise.
      * src/conf/domain_conf.h (_virDomainDef): Document unit used
      internally.
      * src/conf/storage_conf.h (_virStoragePoolDef, _virStorageVolDef):
      Likewise.
      * tests/*data/*.xml: Update all tests.
      * tests/*out/*.xml: Likewise.
      * tests/define-dev-segfault: Likewise.
      * tests/openvzutilstest.c (testReadNetworkConf): Likewise.
      * tests/qemuargv2xmltest.c (blankProblemElements): Likewise.
      26545784
    • E
      xml: share 'unit' in RNG · cb7583e1
      Eric Blake 提交于
      The code supported unit='E' for "exabyte", but the RNG did not;
      conversely, the RNG supported "z" and "y" but the code did not
      (I'm jealous if you have that much storage, particularly since
      it won't fit in 64-bit off_t).  Also, the code supported
      <allocation unit='...'>, but not the RNG.
      
      In an effort to make 'unit' more worthwhile in future patches,
      it's easier to share it between files.
      
      In making this factorization, note that absFilePath is more
      permissive than 'path', so storage pools and storage volumes
      will now validate with a wider set of file names than before.
      I don't think this should be a problem in practice.
      
      * docs/schemas/storagepool.rng: Include basic types, rather than
      repeating things here.
      * docs/schemas/storagevol.rng: Likewise.
      * docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix
      to match storage code.
      cb7583e1
  12. 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
  13. 28 2月, 2012 3 次提交
  14. 13 2月, 2012 2 次提交
  15. 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
  16. 03 2月, 2012 1 次提交
    • D
      Add two new security label types · b170eb99
      Daniel P. Berrange 提交于
      Curently security labels can be of type 'dynamic' or 'static'.
      If no security label is given, then 'dynamic' is assumed. The
      current code takes advantage of this default, and avoids even
      saving <seclabel> elements with type='dynamic' to disk. This
      means if you temporarily change security driver, the guests
      can all still start.
      
      With the introduction of sVirt to LXC though, there needs to be
      a new default of 'none' to allow unconfined LXC containers.
      
      This patch introduces two new security label types
      
       - default:  the host configuration decides whether to run the
                   guest with type 'none' or 'dynamic' at guest start
       - none:     the guest will run unconfined by security policy
      
      The 'none' label type will obviously be undesirable for some
      deployments, so a new qemu.conf option allows a host admin to
      mandate confined guests. It is also possible to turn off default
      confinement
      
        security_default_confined = 1|0  (default == 1)
        security_require_confined = 1|0  (default == 0)
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add new
        seclabel types
      * src/security/security_manager.c, src/security/security_manager.h:
        Set default sec label types
      * src/security/security_selinux.c: Handle 'none' seclabel type
      * src/qemu/qemu.conf, src/qemu/qemu_conf.c, src/qemu/qemu_conf.h,
        src/qemu/libvirtd_qemu.aug: New security config options
      * src/qemu/qemu_driver.c: Tell security driver about default
        config
      b170eb99
  17. 02 2月, 2012 1 次提交
    • P
      xml: Add element <title> to allow short description of domains · b79ba838
      Peter Krempa 提交于
      This patch adds a new element <title> to the domain XML. This attribute
      can hold a short title defined by the user to ease the identification of
      domains. The title may not contain newlines and should be reasonably short.
      
       *docs/formatdomain.html.in
       *docs/schemas/domaincommon.rng
              - add schema grammar for the new element and documentation
        *src/conf/domain_conf.c
        *src/conf/domain_conf.h
              - add field to hold the new attribute
              - add code to parse and create XML with the new attribute
      b79ba838
  18. 01 2月, 2012 2 次提交
    • E
      build: fix text regression · c3c2cc65
      Eric Blake 提交于
      Commit 8a09ee41 tickles a bug in libxml2-2.7.6 on RHEL 6.2,
      where libxml2 treats the pattern [^\n] as excluding literal
      backslash and n, instead of the intended newline, thus failing
      to validate any domain name containing 'n'.
      
      * docs/schemas/domaincommon.rng: Use literal newline instead.
      c3c2cc65
    • T
      conf: add rawio attribute to disk element of domain XML · 397e6a70
      Taku Izumi 提交于
       This patch adds a new attribute "rawio" to the "disk" element
       of domain XML. Valid values of "rawio" attribute are "yes"
       and "no".
       rawio='yes' indicates the disk is desirous of CAP_SYS_RAWIO.
      
       If you specify the following XML:
      
       <disk type='block' device='lun' rawio='yes'>
        ...
       </disk>
      
       the domain will be granted CAP_SYS_RAWIO.
       (of course, the domain have to be executed with root privilege)
      
      NOTE:
         - "rawio" attribute is only valid when device='lun'
         - At the moment, any other disks you won't use rawio can use rawio.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      397e6a70
  19. 31 1月, 2012 2 次提交
    • L
      qemu: add "romfile" support to specify device boot ROM · 3801831c
      Laine Stump 提交于
      This patch addresses: https://bugzilla.redhat.com/show_bug.cgi?id=781562
      
      Along with the "rombar" option that controls whether or not a boot rom
      is made visible to the guest, qemu also has a "romfile" option that
      allows specifying a binary file to present as the ROM BIOS of any
      emulated or passthrough PCI device. This patch adds support for
      specifying romfile to both passthrough PCI devices, and emulated
      network devices that attach to the guest's PCI bus (just about
      everything other than ne2k_isa).
      
      One example of the usefulness of this option is described in the
      bugzilla report: 82576 sriov network adapters don't provide a ROM BIOS
      for the cards virtual functions (VF), but an image of such a ROM is
      available, and with this ROM visible to the guest, it can PXE boot.
      
      In libvirt's xml, the new option is configured like this:
      
         <hostdev>
           ...
           <rom file='/etc/fake/boot.bin'/>
           ...
         </hostdev
      
      (similarly for <interface>).
      3801831c
    • 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
  20. 27 1月, 2012 1 次提交
  21. 26 1月, 2012 2 次提交
  22. 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
  23. 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
  24. 17 1月, 2012 3 次提交
    • J
      Add support for cpu mode attribute · f7dd3a4e
      Jiri Denemark 提交于
      The mode can be either of "custom" (default), "host-model",
      "host-passthrough". The semantics of each mode is described in the
      following examples:
      
      - guest CPU is a default model with specified topology:
          <cpu>
            <topology sockets='1' cores='2' threads='1'/>
          </cpu>
      
      - guest CPU matches selected model:
          <cpu mode='custom' match='exact'>
            <model>core2duo</model>
          </cpu>
      
      - guest CPU should be a copy of host CPU as advertised by capabilities
        XML (this is a short cut for manually copying host CPU specification
        from capabilities to domain XML):
          <cpu mode='host-model'/>
      
        In case a hypervisor does not support the exact host model, libvirt
        automatically falls back to a closest supported CPU model and
        removes/adds features to match host. This behavior can be disabled by
          <cpu mode='host-model'>
            <model fallback='forbid'/>
          </cpu>
      
      - the same as previous returned by virDomainGetXMLDesc with
        VIR_DOMAIN_XML_UPDATE_CPU flag:
          <cpu mode='host-model' match='exact'>
            <model fallback='allow'>Penryn</model>       --+
            <vendor>Intel</vendor>                         |
            <topology sockets='2' cores='4' threads='1'/>  + copied from
            <feature policy='require' name='dca'/>         | capabilities XML
            <feature policy='require' name='xtpr'/>        |
            ...                                          --+
          </cpu>
      
      - guest CPU should be exactly the same as host CPU even in the aspects
        libvirt doesn't model (such domain cannot be migrated unless both
        hosts contain exactly the same CPUs):
          <cpu mode='host-passthrough'/>
      
      - the same as previous returned by virDomainGetXMLDesc with
        VIR_DOMAIN_XML_UPDATE_CPU flag:
          <cpu mode='host-passthrough' match='minimal'>
            <model>Penryn</model>                        --+ copied from caps
            <vendor>Intel</vendor>                         | XML but doesn't
            <topology sockets='2' cores='4' threads='1'/>  | describe all
            <feature policy='require' name='dca'/>         | aspects of the
            <feature policy='require' name='xtpr'/>        | actual guest CPU
            ...                                          --+
          </cpu>
      f7dd3a4e
    • 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
  25. 16 1月, 2012 2 次提交