1. 30 7月, 2014 2 次提交
    • 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
    • E
      blockcopy: add more XML for state tracking · 9a212d67
      Eric Blake 提交于
      Doing a blockcopy operation across a libvirtd restart is not very
      robust at the moment.  In particular, we are clearing the <mirror>
      element prior to telling qemu to finish the job.  Also, thanks to the
      ability to request async completion, the user can easily regain
      control prior to qemu actually finishing the effort, and they should
      be able to poll the domain XML to see if the job is still going.
      
      A future patch will fix things to actually wait until qemu is done
      before modifying the XML to reflect the job completion.  But since
      qemu issues identical BLOCK_JOB_COMPLETE events regardless of whether
      the job was cancelled (kept the original disk) or completed (pivoted
      to the new disk), we have to track which of the two operations were
      used to end the job.  Furthermore, we'd like to avoid attempts to
      end a job where we are already waiting on an earlier request to qemu
      to end the job.  Likewise, if we miss the qemu event (perhaps because
      it arrived during a libvirtd restart), we still need enough state
      recorded to be able to determine how to modify the domain XML once
      we reconnect to qemu and manually learn whether the job still exists.
      
      Although this patch doesn't actually fix the problem, it is a
      preliminary step that makes it possible to track whether a job
      has already begun steps towards completion.
      
      * src/conf/domain_conf.h (virDomainDiskMirrorState): New enum.
      (_virDomainDiskDef): Convert bool mirroring to new enum.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Handle new values.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Adjust
      client.
      * src/qemu/qemu_driver.c (qemuDomainBlockPivot)
      (qemuDomainBlockJobImpl): Likewise.
      * docs/schemas/domaincommon.rng (diskMirror): Expose new values.
      * docs/formatdomain.html.in (elementsDisks): Document it.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9a212d67
  2. 29 7月, 2014 2 次提交
  3. 23 7月, 2014 1 次提交
    • C
      lxc: allow to keep or drop capabilities · 47e5b5ae
      Cédric Bosdonnat 提交于
      Added <capabilities> in the <features> section of LXC domains
      configuration. This section can contain elements named after the
      capabilities like:
      
        <mknod state="on"/>, keep CAP_MKNOD capability
        <sys_chroot state="off"/> drop CAP_SYS_CHROOT capability
      
      Users can restrict or give more capabilities than the default using
      this mechanism.
      47e5b5ae
  4. 22 7月, 2014 3 次提交
    • J
      Add unique_id to nodedev output · f3271f4c
      John Ferlan 提交于
      Add an optional unique_id parameter to nodedev.  Allows for easier lookup
      and display of the unique_id value in order to document for use with
      scsi_host code.
      f3271f4c
    • O
      storage: Introduce parentaddr into virStoragePoolSourceAdapter · a4bd62ad
      Osier Yang 提交于
      Between reboots and kernel reloads, the SCSI host number used for SCSI
      storage pools may change requiring modification to the storage pool XML
      in order to use a specific SCSI host adapter.
      
      This patch introduces the "parentaddr" element and "unique_id" attribute
      for the SCSI host adapter in order to uniquely identify the adapter
      between reboots and kernel reloads. For now the goal is to only parse
      and format the XML. Both will be required to be provided in order to
      uniquely identify the desired SCSI host.
      
      The new XML is expected to be as follows:
      
        <adapter type='scsi_host'>
          <parentaddr unique_id='3'>
            <address domain='0x0000' bus='0x00' slot='0x1f' func='0x2'/>
          </parentaddr>
        </adapter>
      
      where "parentaddr" is the parent device of the SCSI host using the PCI
      address on which the device resides and the value from the unique_id file
      for the device. Both the PCI address and unique_id values will be used
      to traverse the /sys/class/scsi_host/ directories looking at each link
      to match the PCI address reformatted to the directory link format where
      "domain:bus:slot:function" is found.  Then for each matching directory
      the unique_id file for the scsi_host will be used to match the unique_id
      value in the xml.
      
      For a PCI address listed above, this will be formatted to "0000:00:1f.2"
      and the links in /sys/class/scsi_host will be used to find the host#
      to be used for the 'scsi_host' device. Each entry is a link to the
      /sys/bus/pci/devices directories, e.g.:
      
      %  ls -al /sys/class/scsi_host/host2
      lrwxrwxrwx. 1 root root 0 Jun  1 00:22 /sys/class/scsi_host/host2 -> ../../devices/pci0000:00/0000:00:1f.2/ata3/host2/scsi_host/host2
      
      % cat /sys/class/scsi_host/host2/unique_id
      3
      
      The "parentaddr" and "name" attributes are mutually exclusive to identify
      the SCSI host number. Use of the "parentaddr" element will be the preferred
      mechanism.
      
      This patch only supports to parse and format the XMLs. Later patches will
      add code to find out the scsi host number.
      a4bd62ad
    • P
      schema: pool: netfs: Don't enforce slash in glusterfs pool source · b325be12
      Peter Krempa 提交于
      Gluster volumes don't start with a leading slash. Our schema for netfs
      gluster pools enforces it though. Luckily mount.glusterfs skips it.
      Allow a slashless volume name for glusterfs netfs mounts in the schema.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1101999
      b325be12
  5. 18 7月, 2014 1 次提交
  6. 17 7月, 2014 5 次提交
  7. 16 7月, 2014 1 次提交
    • C
      storagevol: add nocow to vol xml · a9fd30e6
      Chunyan Liu 提交于
      Add 'nocow' to storage volume xml so that user can have an option
      to set NOCOW flag to the newly created volume. It's useful on btrfs
      file system to enhance performance.
      
      Btrfs has low performance when hosting VM images, even more when the guest
      in those VM are also using btrfs as file system. One way to mitigate this
      bad performance is to turn off COW attributes on VM files. Generally, there
      are two ways to turn off COW on btrfs: a) by mounting fs with nodatacow,
      then all newly created files will be NOCOW. b) per file. Add the NOCOW file
      attribute. It could only be done to empty or new files.
      
      This patch tries the second way, according to 'nocow' option, it could set
      NOCOW flag per file:
      for raw file images, handle 'nocow' in libvirt code; for non-raw file images,
      pass 'nocow=on' option to qemu-img, and let qemu-img to handle that (requires
      qemu-img version >= 2.1).
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      a9fd30e6
  8. 03 7月, 2014 1 次提交
    • M
      Introduce domain_capabilities · 614581f3
      Michal Privoznik 提交于
      This new module holds and formats capabilities for emulator. If you
      are about to create a new domain, you may want to know what is the
      host or hypervisor capable of. To make sure we don't regress on the
      XML, the formatting is not something left for each driver to
      implement, rather there's general format function.
      
      The domain capabilities is a lockable object (even though the locking
      is not necessary yet) which uses reference counter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      614581f3
  9. 02 7月, 2014 1 次提交
  10. 20 6月, 2014 1 次提交
    • L
      interface: report link state for bonds and vlans too · 69db5f92
      Laine Stump 提交于
      The interface state for bonds and vlans does seem to reflect the state
      of the underlying physical devices, at least in some cases, so it
      makes sense to allow reporting it (netcf now does).
      
      The link state/speed for bridge devices is meaningless though, so we
      don't even look for it.
      69db5f92
  11. 19 6月, 2014 2 次提交
    • L
      interface: allow reordering of elements in xml · a341fc73
      Laine Stump 提交于
      The interface xml schema was written with strict rules about the
      ordering of the elements. This was never intentional, but just due to
      omission of <interleave> in the appropriate places. This patch just
      adds in <interleave> wherever there is more than one element, and
      re-indents everything else appropriately.
      a341fc73
    • M
      virCaps: expose pages info · 02129b7c
      Michal Privoznik 提交于
      There are two places where you'll find info on page sizes. The first
      one is under <cpu/> element, where all supported pages sizes are
      listed. Then the second one is under each <cell/> element which refers
      to concrete NUMA node. At this place, the size of page's pool is
      reported. So the capabilities XML looks something like this:
      
      <capabilities>
      
        <host>
          <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
          <cpu>
            <arch>x86_64</arch>
            <model>Westmere</model>
            <vendor>Intel</vendor>
            <topology sockets='1' cores='1' threads='1'/>
            ...
            <pages unit='KiB' size='4'/>
            <pages unit='KiB' size='2048'/>
            <pages unit='KiB' size='1048576'/>
          </cpu>
          ...
          <topology>
            <cells num='4'>
              <cell id='0'>
                <memory unit='KiB'>4054408</memory>
                <pages unit='KiB' size='4'>1013602</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4071072</memory>
                <pages unit='KiB' size='4'>1017768</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                </cpus>
              </cell>
              ...
            </cells>
          </topology>
          ...
        </host>
      
        <guest/>
      
      </capabilities>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      02129b7c
  12. 17 6月, 2014 1 次提交
    • E
      blockjob: don't remove older-style mirror XML · b50e1049
      Eric Blake 提交于
      Commit 7c6fc394 introduced a regression in the XML produced for older
      clients.  The argument at the time was that clients shouldn't be
      depending on output-only data for something that is only going to
      be triggered for a transient guest; but John Ferlan reported that
      the automated testsuite was such a client.  It's better to be safe
      than sorry by guaranteeing back-compat cruft.  Note that later
      patches will be using <mirror> for active block commit, but there
      we don't have to worry about back-compat.
      
      * src/conf/domain_conf.c (virDomainDiskDefFormat): Restore old
      style output when necessary.
      * docs/schemas/domaincommon.rng: Validate back-compat style.
      * docs/formatdomain.html.in: Update the documentation.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml:
      Update tests.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b50e1049
  13. 16 6月, 2014 1 次提交
  14. 11 6月, 2014 2 次提交
    • M
      node_device: Expose link state & speed · 0311ef3d
      Michal Privoznik 提交于
      While exposing the info under <interface/> in previous patch works, it
      may work only in cases where interface is configured on the host.
      However, orchestrating application may want to know the link state and
      speed even in that case. That's why we ought to expose this in nodedev
      XML too:
      
      virsh # nodedev-dumpxml net_eth0_f0_de_f1_2b_1b_f3
      <device>
        <name>net_eth0_f0_de_f1_2b_1b_f3</name>
        <path>/sys/devices/pci0000:00/0000:00:19.0/net/eth0</path>
        <parent>pci_0000_00_19_0</parent>
        <capability type='net'>
          <interface>eth0</interface>
          <address>f0:de:f1:2b:1b:f3</address>
          <link speed='1000' state='up'/>
          <capability type='80203'/>
        </capability>
      </device>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0311ef3d
    • M
      virInterface: Expose link state & speed · 3db89662
      Michal Privoznik 提交于
      Currently it is not possible to determine the speed of an interface
      and whether a link is actually detected from the API. Orchestrating
      platforms want to be able to determine when the link has failed and
      where multiple speeds may be available which one the interface is
      actually connected at. This commit introduces an extension to our
      interface XML (without implementation to interface driver backends):
      
        <interface type='ethernet' name='eth0'>
          <start mode='none'/>
          <mac address='aa:bb:cc:dd:ee:ff'/>
          <link speed='1000' state='up'/>
          <mtu size='1492'/>
          ...
        </interface>
      
      Where @speed is negotiated link speed in Mbits per second, and state
      is the current NIC state (can be one of the following:  "unknown",
      "notpresent", "down", "lowerlayerdown","testing", "dormant", "up").
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3db89662
  15. 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
  16. 06 6月, 2014 1 次提交
    • M
      nodedev: Export NUMA node locality for PCI devices · 1c702778
      Michal Privoznik 提交于
      A PCI device can be associated with a specific NUMA node. Later, when
      a guest is pinned to one NUMA node the PCI device can be assigned on
      different NUMA node. This makes DMA transfers travel across nodes and
      thus results in suboptimal performance. We should expose the NUMA node
      locality for PCI devices so management applications can make better
      decisions.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1c702778
  17. 04 6月, 2014 1 次提交
    • M
      virCaps: Expose distance between host NUMA nodes · 8ba0a58f
      Michal Privoznik 提交于
      If user or management application wants to create a guest,
      it may be useful to know the cost of internode latencies
      before the guest resources are pinned. For example:
      
      <capabilities>
      
        <host>
          ...
          <topology>
            <cells num='2'>
              <cell id='0'>
                <memory unit='KiB'>4004132</memory>
                <distances>
                  <sibling id='0' value='10'/>
                  <sibling id='1' value='20'/>
                </distances>
                <cpus num='2'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                  <cpu id='2' socket_id='0' core_id='2' siblings='2'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4030064</memory>
                <distances>
                  <sibling id='0' value='20'/>
                  <sibling id='1' value='10'/>
                </distances>
                <cpus num='2'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                  <cpu id='3' socket_id='0' core_id='2' siblings='3'/>
                </cpus>
              </cell>
            </cells>
          </topology>
          ...
        </host>
        ...
      </capabilities>
      
      We can see the distance from node1 to node0 is 20 and within nodes 10.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8ba0a58f
  18. 27 5月, 2014 1 次提交
  19. 24 4月, 2014 1 次提交
    • J
      conf: Output disk backing store details in domain XML · a2e369bc
      Jiri Denemark 提交于
      The XML for quite a longish backing chain is shown below:
      
        <disk type='network' device='disk'>
          <driver name='qemu' type='qcow2'/>
          <source protocol='nbd' name='bar'>
            <host transport='unix' socket='/var/run/nbdsock'/>
          </source>
          <backingStore type='block' index='1'>
            <format type='qcow2'/>
            <source dev='/dev/HostVG/QEMUGuest1'/>
            <backingStore type='file' index='2'>
              <format type='qcow2'/>
              <source file='/tmp/image2.qcow'/>
              <backingStore type='file' index='3'>
                <format type='qcow2'/>
                <source file='/tmp/image3.qcow'/>
                <backingStore type='file' index='4'>
                  <format type='qcow2'/>
                  <source file='/tmp/image4.qcow'/>
                  <backingStore type='file' index='5'>
                    <format type='qcow2'/>
                    <source file='/tmp/image5.qcow'/>
                    <backingStore type='file' index='6'>
                      <format type='raw'/>
                      <source file='/tmp/Fedora-17-x86_64-Live-KDE.iso'/>
                      <backingStore/>
                    </backingStore>
                  </backingStore>
                </backingStore>
              </backingStore>
            </backingStore>
          </backingStore>
          <target dev='vdb' bus='virtio'/>
        </disk>
      
      Various disk types and formats can be mixed in one chain. The
      <backingStore/> empty element marks the end of the backing chain and it
      is there mostly for future support of parsing the chain provided by a
      user. If it's missing, we are supposed to probe for the rest of the
      chain ourselves, otherwise complete chain was provided by the user. The
      index attributes of backingStore elements can be used to unambiguously
      identify a specific part of the image chain.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      a2e369bc
  20. 16 4月, 2014 3 次提交
    • 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
    • E
      conf: split <disk> schema into more pieces · fec1a939
      Eric Blake 提交于
      To make <disk> schema more maintainable and to allow for moving the
      pieces to a common file in the future. It relies on the ability to
      override definitions as part of an include, set up in the previous
      patch.
      
      The diff is a bit hard to read, because it mixes reindentation
      with refactoring; 'git diff -b --patience' may help.
      
      * docs/schemas/domaincommon.rng (disk): Refactor into pieces.
      (diskSource, diskSourceFile, diskSourceBlock, diskSourceDir)
      (diskSourceVolume: New defines.
      (diskSourceNetwork): Revise scope.
      * docs/schemas/domainsnapshot.rng (disksnapshot): Adjust.
      * tests/domainsnapshotxml2xmlin/disk-seclabel-invalid.xml,
      tests/domainsnapshotxml2xmlin/disk-network-seclabel-invalid.xml: New
      tests to check seclabel is forbidden in domain snapshot by schema.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      fec1a939
    • E
      conf: set up for per-grammar overrides in schemas · 369cdfa8
      Eric Blake 提交于
      This patch is my first experience playing with nested grammars,
      as documented in http://relaxng.org/tutorial-20011203.html#IDA3PZR.
      I plan on doing more overrides in order to make the RelaxNG
      grammar mirror the C code refactoring into a common
      virStorageSource, but where different clients of that source do
      not support the same subset of functionality.  By starting with
      something fairly easy to validate, I can make sure my later
      patches will be possible.
      
      This patch adds a use of the no-op <ref
      name='sourceStartupPolicy'/> to the disksnapshot definition, so
      that the snapshot version of a type='file' <source> more closely
      resembles the version in domaincommon.  A future patch will merge
      the two files into using a common define, but this patch is
      sufficient for testing that adding <source
      startupPolicy='optional'/> in any of the
      tests/domainsnapshotxml2xmlin/*.xml files still gets rejected
      unless it occurs within the <domain> subelement, because the
      definition of startupPolicy is empty outside of domain.rng.
      
      * docs/schemas/storagecommon.rng (storageStartupPolicy)
      (storageSourceExtra): Create no-op defaults.
      * docs/schemas/domainsnapshot.rng (domain): Use nested grammar
      to avoid restricting <domain>.
      (storageSourceExtra): Create new override.
      (disksnapshot): Access overrides through common names.
      * docs/schemas/domaincommon.rng (disk): Access overrides through
      common names.
      * docs/schemas/domain.rng (storageStartupPolicy)
      (storageSourceExtra): Create new overrides.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      369cdfa8
  21. 15 4月, 2014 3 次提交
    • E
      conf: restrict external snapshots to backing store formats · db7d7c0e
      Eric Blake 提交于
      Domain snapshots should only permit an external snapshot into
      a storage format that permits a backing chain, since the new
      snapshot file necessarily must be backed by the existing file.
      The C code for the qemu driver is a little bit stricter in
      currently enforcing only qcow2 or qed, but at the XML parser
      level, including virt-xml-validate, it is fairly easy to
      enforce that a user can't request a 'raw' external snapshot.
      
      * docs/schemas/storagecommon.rng (storageFormat): Split out...
      (storageFormatBacking): ...new sublist.
      * docs/schemas/domainsnapshot.rng (disksnapshotdriver): Use new
      type.
      * src/util/virstoragefile.h (virStorageFileFormat): Rearrange for
      easier code management.
      * src/util/virstoragefile.c (virStorageFileFormat, fileTypeInfo):
      Likewise.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML): Use
      new marker to limit selection of formats.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      db7d7c0e
    • E
      conf: move storage formats to common RNG file · 4f596a07
      Eric Blake 提交于
      We had incomplete RelaxNG support for storage formats listed
      in virstoragefile.h: commit 027bf2ea added 'vdi' but forgot
      to update the <volume> and <domain> xml lists; the <volume>
      list was also missing 'fat' and 'vhd'.  Maintaining two lists
      is a recipe for them getting out of sync, so make the list
      common so that both contexts benefit the next time we add a
      format in a single location.
      
      * docs/schemas/domaincommon.rng (storageFormat): Move...
      * docs/schemas/storagecommon.rng: ...here, and add vdi.
      * docs/schemas/storagevol.rng (formatfile): Use common list.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4f596a07
    • 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
  22. 14 4月, 2014 1 次提交
    • E
      conf: create common storage RNG grammar file · 110c0db8
      Eric Blake 提交于
      Having two tiny files with a couple definitions didn't make
      as much sense as one common file, especially since I plan to
      add more definitions and use it in more places.
      
      * docs/schemas/storageencryption.rng: Merge this...
      * docs/schemas/storagefilefeatures.rng: ...and this, into...
      * docs/schemas/storagecommon.rng: ...this new file.
      * docs/schemas/Makefile.am (schema_DATA): Reflect renames.
      * docs/schemas/storagevol.rng: Likewise.
      * docs/schemas/domaincommon.rng: Likewise.
      * libvirt.spec.in: Likewise.
      * mingw-libvirt.spec.in: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      110c0db8
  23. 26 3月, 2014 1 次提交
  24. 13 3月, 2014 1 次提交
  25. 19 2月, 2014 1 次提交
  26. 11 2月, 2014 1 次提交