1. 14 1月, 2015 1 次提交
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  2. 13 1月, 2015 1 次提交
  3. 21 11月, 2014 2 次提交
    • P
      conf: Add channel state for virtio channels to the XML · 24c25a68
      Peter Krempa 提交于
      To track state of virtio channels this patch adds a new output-only
      attribute called 'state' to the <target> element of virtio channels.
      
      This will be later populated with the guest state of the channel.
      24c25a68
    • P
      test: xml2xml: Print full filenames if xml2xml test fails · c5942a9f
      Peter Krempa 提交于
      To simplify looking for a problem instrument the XML comparator function
      with possibility to print the filename of the failed/expected XML
      output.
      
      This is necessary as the VIR_TEST_DIFFERENT macro possibly tests two XML
      files for the inactive/active state and the resulting error may not be
      obvious.
      c5942a9f
  4. 06 11月, 2014 1 次提交
  5. 25 10月, 2014 1 次提交
  6. 04 10月, 2014 1 次提交
    • M
      docs, conf, schema: add support for shmem device · 540a84ec
      Martin Kletzander 提交于
      This patch adds parsing/formatting code as well as documentation for
      shared memory devices.  This will currently be only accessible in QEMU
      using it's ivshmem device, but is designed as generic as possible to
      allow future expansion for other hypervisors.
      
      In the devices section in the domain XML users may specify:
      
      - For shmem device using a server:
      
       <shmem name='shmem0'>
         <server path='/tmp/socket-ivshmem0'/>
         <size unit='M'>32</size>
         <msi vectors='32' ioeventfd='on'/>
       </shmem>
      
      - For ivshmem device not using an ivshmem server:
      
       <shmem name='shmem1'>
         <size unit='M'>32</size>
       </shmem>
      
      Most of the configuration is made optional so it also allows
      specifications like:
      
       <shmem name='shmem1/>
       <shmem name='shmem2'>
         <server/>
       </shmem>
      Signed-off-by: NMaxime Leroy <maxime.leroy@6wind.com>
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      540a84ec
  7. 24 9月, 2014 1 次提交
    • J
      conf: add options for disabling segment offloading · 5b3536ae
      Ján Tomko 提交于
      Add options for tuning segment offloading:
      <driver>
        <host csum='off' gso='off' tso4='off' tso6='off'
              ecn='off' ufo='off'/>
        <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
      </driver>
      which control the respective host_ and guest_ properties
      of the virtio-net device.
      5b3536ae
  8. 19 9月, 2014 1 次提交
  9. 17 9月, 2014 1 次提交
  10. 16 9月, 2014 3 次提交
    • J
      conf: add backend element to interfaces · af8b4a2e
      Ján Tomko 提交于
      For tuning the network, alternative devices
      for creating tap and vhost devices can be specified via:
      <backend tap='/dev/net/tun' vhost='/dev/net-vhost'/>
      af8b4a2e
    • E
      cputune: allow interleaved xml · 7e8feed4
      Eric Blake 提交于
      I noticed this with the recent iothread pinning code, but the
      problem existed longer than that. The XML validation required
      users to supply <cputune> children in a strict order, even though
      there was no conceptual reason why they can't occur in any order.
      
      docs/ changes best viewed with -w
      
      * docs/schemas/domaincommon.rng (cputune): Add interleave.
      * tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml: Swap
      up order, copying canonical form...
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml:
      ...here.
      * tests/qemuxml2xmltest.c (mymain): Mark the difference.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7e8feed4
    • J
      domain_conf: Add iothreadpin to cputune · 938fb12f
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1101574
      
      Add an option 'iothreadpin' to the <cpuset> to allow for setting the
      CPU affinity for each IOThread.
      
      The iothreadspin will mimic the vcpupin with respect to being able to
      assign each iothread to a specific CPU, although iothreads ids start
      at 1 while vcpu ids start at 0. This matches the iothread naming scheme.
      938fb12f
  11. 10 9月, 2014 1 次提交
    • M
      conf: Extend <loader/> and introduce <nvram/> · 68bf13db
      Michal Privoznik 提交于
      Up to now, users can configure BIOS via the <loader/> element. With
      the upcoming implementation of UEFI this is not enough as BIOS and
      UEFI are conceptually different. For instance, while BIOS is ROM, UEFI
      is programmable flash (although all writes to code section are
      denied). Therefore we need new attribute @type which will
      differentiate the two. Then, new attribute @readonly is introduced to
      reflect the fact that some images are RO.
      
      Moreover, the OVMF (which is going to be used mostly), works in two
      modes:
      1) Code and UEFI variable store is mixed in one file.
      2) Code and UEFI variable store is separated in two files
      
      The latter has advantage of updating the UEFI code without losing the
      configuration. However, in order to represent the latter case we need
      yet another XML element: <nvram/>. Currently, it has no additional
      attributes, it's just a bare element containing path to the variable
      store file.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      68bf13db
  12. 05 9月, 2014 1 次提交
  13. 29 8月, 2014 2 次提交
    • J
      qemu: Allow use of iothreads for disk definitions · ef8da2ad
      John Ferlan 提交于
      For virtio-blk-pci disks with the disk iothread attribute that are
      running the correct emulator, add the "iothread=iothread#" to the
      -device command line in order to enable iothreads for the disk as
      long as the command is available, the disk iothread value provided is
      valid, and is supported for the disk device being added
      ef8da2ad
    • J
      qemu: Add support for iothreads · 72edaae7
      John Ferlan 提交于
      Add a new capability to ensure the iothreads feature exists for the qemu
      emulator being run - requires the "query-iothreads" QMP command. Using the
      domain XML add correspoding command argument in order to generate the
      threads. The iothreads will use a name space "iothread#" where, the
      future patch to add support for using an iothread to a disk definition to
      merely define which of the available threads to use.
      
      Add tests to ensure the xml/argv processing is correct.  Note that no
      change was made to qemuargv2xmltest.c as processing the -object element
      would require knowing more than just iothreads.
      72edaae7
  14. 26 8月, 2014 1 次提交
  15. 25 8月, 2014 1 次提交
  16. 12 8月, 2014 1 次提交
  17. 08 8月, 2014 1 次提交
    • J
      hostdev: Add iSCSI hostdev XML · 54ac483e
      John Ferlan 提交于
      Introduce a new structure to handle an iSCSI host device based on the
      existing virDomainHostdevSubsysSCSI by adding a "protocol='iscsi'" to
      the <source/> element. The existing scsi_host subsystem RNG was modified
      to read an optional "protocol='adapter'", although it won't be written
      out nor is it documented as an option (by choice).
      
      The new hostdev structure mimics the existing <disk/> element for an
      iSCSI device (network) device. New XML is:
      
        <hostdev mode='subsystem' type='scsi' managed='yes'>
          <source protocol='iscsi' name='iqn.1992-01.com.example'>
            <host name='example.org' port='3260'/>
            <auth username='myname'>
              <secret type='iscsi' usage='mycluster_myname'/>
            </auth>
          </source>
          <address type='drive' controller='0' bus='0' target='2' unit='5'/>
        </hostdev>
      
      The controller element will mimic the existing scsi_host code insomuch
      as when 'lsi' and 'virtio-scsi' are used.
      54ac483e
  18. 30 7月, 2014 1 次提交
    • E
      blockcommit: track job type in xml · 232a31be
      Eric Blake 提交于
      A future patch is going to wire up qemu active block commit jobs;
      but as they have similar events and are canceled/pivoted in the
      same way as block copy jobs, it is easiest to track all bookkeeping
      for the commit job by reusing the <mirror> element.  This patch
      adds domain XML to track which job was responsible for creating a
      mirroring situation, and adds a job='copy' attribute to all
      existing uses of <mirror>.  Along the way, it also massages the
      qemu monitor backend to read the new field in order to generate
      the correct type of libvirt job (even though it requires a
      future patch to actually cause a qemu event that can be reported
      as an active commit).  It also prepares to update persistent XML
      to match changes made to live XML when a copy completes.
      
      * docs/schemas/domaincommon.rng: Enhance schema.
      * docs/formatdomain.html.in: Document it.
      * src/conf/domain_conf.h (_virDomainDiskDef): Add a field.
      * src/conf/domain_conf.c (virDomainBlockJobType): String conversion.
      (virDomainDiskDefParseXML): Parse job type.
      (virDomainDiskDefFormat): Output job type.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Distinguish
      active from regular commit.
      * src/qemu/qemu_driver.c (qemuDomainBlockCopy): Set job type.
      (qemuDomainBlockPivot, qemuDomainBlockJobImpl): Clean up job type
      on completion.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml:
      Update tests.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml: New
      file.
      * tests/qemuxml2xmltest.c (mymain): Drive new test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      232a31be
  19. 29 7月, 2014 2 次提交
  20. 17 7月, 2014 5 次提交
  21. 14 7月, 2014 1 次提交
  22. 02 7月, 2014 1 次提交
  23. 27 6月, 2014 1 次提交
  24. 07 6月, 2014 1 次提交
    • E
      conf: alter disk mirror xml output · 7c6fc394
      Eric Blake 提交于
      Now that we track a disk mirror as a virStorageSource, we might
      as well update the XML to theoretically allow any type of
      mirroring destination (not just a local file).  A later patch
      will also be reusing <mirror> to track the block commit of the
      top layer of a chain, which is another case where libvirt needs
      to update the backing chain after the job is finally pivoted,
      and since backing chains can have network backing files as the
      destination to commit into, it makes more sense to display that
      in the XML.
      
      This patch changes output-only XML; it was already documented
      that <mirror> does not affect a domain definition at this point
      (because qemu doesn't provide persistent bitmaps yet).  Any
      application that was starting a block copy job with older libvirt
      and then relying on the domain XML to determine if it was
      complete will no longer be able to access the file= and format=
      attributes of mirror that were previously used.  However, this is
      not going to be a problem in practice: the only time a block copy
      job works is on a transient domain, and any app that is managing
      a transient domain probably already does enough of its own
      bookkeeping to know which file it is mirroring into without
      having to re-read it from the libvirt XML.  The one thing that
      was likely to be used in a mirroring job was the ready=
      attribute, which is unchanged.  Meanwhile, I made sure the schema
      and parser still accept the old format, even if we no longer
      output it, so that upgrading from an older version of libvirt is
      seamless.
      
      * docs/schemas/domaincommon.rng (diskMirror): Alter definition.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML): Parse two
      styles of mirror elements.
      (virDomainDiskDefFormat): Output new style.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror-old.xml: New
      file, copied from...
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: ...here
      before modernizing.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old*: New
      files.
      * tests/qemuxml2xmltest.c (mymain): Test both styles.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7c6fc394
  25. 19 5月, 2014 1 次提交
    • J
      conf: fix seclabels for chardevs · 5ac9b9dd
      Ján Tomko 提交于
      We allow a seclabel to be specified in the <source> element
      of a chardev:
      
      <serial type='file'>
        <source path='/tmp/serial.file'>
          <seclabel model='dac' relabel='no'/>
        </source>
      </serial>
      
      But we format it outside the source:
      
      <serial type='file'>
        <source path='/tmp/serial.file'/>
        <target port='0'/>
          <seclabel model='dac' relabel='no'/>
      </serial>
      
      Move the formatting inside the source to fix this to make the
      seclabel persistent across XML format->parse.
      
      Introduced by commit f8b08d0e 'Add <seclabel> to character devices.'
      5ac9b9dd
  26. 24 4月, 2014 2 次提交
  27. 16 4月, 2014 1 次提交
    • E
      conf: fix omission of <driver> in domain dumpxml · 8fb44675
      Eric Blake 提交于
      I noticed that depending on the <driver> attributes the user passed
      in, the output may omit the <driver> element altogether.  For example,
      the rerror_policy has had this problem since commit 4bb4109f in Oct
      2011.  But in adding testsuite coverage to expose it, I found another
      problem: the C code is just fine without a driver name, but the
      XML validator required either a name or a cache mode.
      
      * src/conf/domain_conf.c (virDomainDiskDefFormat): Update
      conditional.
      * docs/schemas/domaincommon.rng (diskDriver): Simplify.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.xml:
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args:
      New files.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml:
      Enhance test.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml:
      Likewise.
      * tests/qemuxml2argvtest.c (mymain): New test.
      * tests/qemuxml2xmltest.c (mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      8fb44675
  28. 15 4月, 2014 1 次提交
    • E
      conf: better <disk> interleaving in schema · a9efe2d7
      Eric Blake 提交于
      In general, we try to make virt-xml-validate tolerant of input
      elements in any order when possible.  However, as written, the
      RNG grammar did not permit <source> unless there was an explicit
      type= attribute (even though the C code manages just fine by
      defaulting to type='file').  After making the attribute optional
      on the 'file' branch, I noticed that the use of diskspec was now
      redundant with the branch when no <source> was supplied.
      
      View this patch with 'git diff -b' for a better picture of the
      schema change.
      
      * docs/schemas/domaincommon.rng (disk): Hoist 'diskspec' out of
      choice, make type='file' default, and still preserve interleave.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml:
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml:
      New files.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml:
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml:
      Reorder XML.
      * tests/qemuxml2xmltest.c (mymain): Cover new files.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a9efe2d7
  29. 26 3月, 2014 1 次提交
    • J
      Treat zero cpu shares as a valid value · bdffab0d
      Ján Tomko 提交于
      Currently, <cputune><shares>0</shares></cputune> is treated
      as if it were not specified.
      
      Treat is as a valid value if it was explicitly specified
      and write it to the cgroups.
      bdffab0d
  30. 25 3月, 2014 1 次提交