1. 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
  2. 27 1月, 2012 1 次提交
  3. 26 1月, 2012 2 次提交
  4. 25 1月, 2012 3 次提交
    • L
      docs: fix a few small typos in formatdomain.html.in · 0ad35376
      Laine Stump 提交于
      0ad35376
    • E
      metadata: group metadata next to description · 4d71ff45
      Eric Blake 提交于
      It's better to group all the metadata together.  This is a
      cosmetic output change; since the RNG allows interleave, it
      doesn't matter where the user stuck it on input, and an XPath
      query will find the same information when parsing the output.
      
      * src/conf/domain_conf.c (virDomainDefFormatInternal): Output
      metadata earlier.
      * docs/formatdomain.html.in: Update documentation.
      * tests/domainsnapshotxml2xmlout/metadata.xml: Update test.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml: Likewise.
      4d71ff45
    • 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
  5. 24 1月, 2012 1 次提交
    • D
      QEMU guest agent support · c160ce33
      Daniel P. Berrange 提交于
      There is now a standard QEMU guest agent that can be installed
      and given a virtio serial channel
      
          <channel type='unix'>
            <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
            <target type='virtio' name='org.qemu.guest_agent.0'/>
          </channel>
      
      The protocol that runs over the guest agent is JSON based and
      very similar to the JSON monitor. We can't use exactly the same
      code because there are some odd differences in the way messages
      and errors are structured. The qemu_agent.c file is based on
      a combination and simplification of qemu_monitor.c and
      qemu_monitor_json.c
      
      * src/qemu/qemu_agent.c, src/qemu/qemu_agent.h: Support for
        talking to the agent for shutdown
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add thread
        helpers for talking to the agent
      * src/qemu/qemu_process.c: Connect to agent whenever starting
        a guest
      * src/qemu/qemu_monitor_json.c: Make variable static
      c160ce33
  6. 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
  7. 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
  8. 16 1月, 2012 2 次提交
  9. 14 1月, 2012 3 次提交
  10. 13 1月, 2012 1 次提交
    • O
      qemu: Support copy on read for disk · 5edfcaae
      Osier Yang 提交于
      The new introduced optional attribute "copy_on_read</code> controls
      whether to copy read backing file into the image file. The value can
      be either "on" or "off". Copy-on-read avoids accessing the same backing
      file sectors repeatedly and is useful when the backing file is over a
      slow network. By default copy-on-read is off.
      5edfcaae
  11. 12 1月, 2012 1 次提交
  12. 11 1月, 2012 2 次提交
    • S
      Add documentation new ways to access members of variables · a20cc3cc
      Stefan Berger 提交于
      This patch adds documentation about the new 'ways' that users can
      access the contents of variables in filters:
      
      - access via index: $TEST[2]
      - access via iterators $TEST[@1]
      a20cc3cc
    • S
      Introduce possibility to have an iterator per variable · 80e9a5cd
      Stefan Berger 提交于
      This patch introduces the capability to use a different iterator per
      variable.
      
      The currently supported notation of variables in a filtering rule like
      
        <rule action='accept' direction='out'>
           <tcp  srcipaddr='$A' srcportstart='$B'/>
        </rule>
      
      processes the two lists 'A' and 'B' in parallel. This means that A and B
      must have the same number of 'N' elements and that 'N' rules will be 
      instantiated (assuming all tuples from A and B are unique).
      
      In this patch we now introduce the assignment of variables to different
      iterators. Therefore a rule like
      
        <rule action='accept' direction='out'>
           <tcp  srcipaddr='$A[@1]' srcportstart='$B[@2]'/>
        </rule>
      
      will now create every combination of elements in A with elements in B since
      A has been assigned to an iterator with Id '1' and B has been assigned to an
      iterator with Id '2', thus processing their value independently.
      
      The first rule has an equivalent notation of
      
        <rule action='accept' direction='out'>
           <tcp  srcipaddr='$A[@0]' srcportstart='$B[@0]'/>
        </rule>
      80e9a5cd
  13. 10 1月, 2012 1 次提交
  14. 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
  15. 07 1月, 2012 1 次提交
    • D
      Release of libvirt-0.9.9 · 2f667b56
      Daniel Veillard 提交于
      * configure.ac docs/news.html.in libvirt.spec.in: update for the release
      * po/*.po*: updated localizations from transifex and regenerated
      2f667b56
  16. 04 1月, 2012 2 次提交
  17. 02 1月, 2012 1 次提交
    • M
      Implement DNS SRV record into the bridge driver · 973af236
      Michal Novotny 提交于
      Hi,
      this is the fifth version of my SRV record for DNSMasq patch rebased
      for the current codebase to the bridge driver and libvirt XML file to
      include support for the SRV records in the DNS. The syntax is based on
      DNSMasq man page and tests for both xml2xml and xml2argv were added as
      well. There are some things written a better way in comparison with
      version 4, mainly there's no hack in tests/networkxml2argvtest.c and
      also the xPath context is changed to use a simpler query using the
      virXPathInt() function relative to the current node.
      
      Also, the patch is also fixing the networkxml2argv test to pass both
      checks, i.e. both unit tests and also syntax check.
      
      Please review,
      Michal
      Signed-off-by: NMichal Novotny <minovotn@redhat.com>
      973af236
  18. 31 12月, 2011 1 次提交
  19. 30 12月, 2011 2 次提交
    • E
      seclabel: extend XML to allow per-disk label overrides · 6cb4acce
      Eric Blake 提交于
      When doing security relabeling, there are cases where a per-file
      override might be appropriate.  For example, with a static label
      and relabeling, it might be appropriate to skip relabeling on a
      particular disk, where the backing file lives on NFS that lacks
      the ability to track labeling.  Or with dynamic labeling, it might
      be appropriate to use a custom (non-dynamic) label for a disk
      specifically intended to be shared across domains.
      
      The new XML resembles the top-level <seclabel>, but with fewer
      options (basically relabel='no', or <label>text</label>):
      
      <domain ...>
        ...
        <devices>
          <disk type='file' device='disk'>
            <source file='/path/to/image1'>
              <seclabel relabel='no'/> <!-- override for just this disk -->
            </source>
            ...
          </disk>
          <disk type='file' device='disk'>
            <source file='/path/to/image1'>
              <seclabel relabel='yes'> <!-- override for just this disk -->
                <label>system_u:object_r:shared_content_t:s0</label>
              </seclabel>
            </source>
            ...
          </disk>
          ...
        </devices>
        <seclabel type='dynamic' model='selinux'>
          <baselabel>text</baselabel> <!-- used for all devices without override -->
        </seclabel>
      </domain>
      
      This patch only introduces the XML and documentation; future patches
      will actually parse and make use of it.  The intent is that we can
      further extend things as needed, adding a per-device <seclabel> in
      more places (such as the source of a console device), and possibly
      allowing a <baselabel> instead of <label> for labeling where we want
      to reuse the cNNN,cNNN pair of a dynamically labeled domain but a
      different base label.
      
      First suggested by Daniel P. Berrange here:
      https://www.redhat.com/archives/libvir-list/2011-December/msg00258.html
      
      * docs/schemas/domaincommon.rng (devSeclabel): New define.
      (disk): Use it.
      * docs/formatdomain.html.in (elementsDisks, seclabel): Document
      the new XML.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.xml:
      New test, to validate RNG.
      6cb4acce
    • 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
  20. 24 12月, 2011 1 次提交
    • E
      docs: remove stray / · d145fe3b
      Eric Blake 提交于
      Commit e5a84d74 added a new attribute in the wrong location;
      commit c8b9fa74 fixed the missing / at the end but not the extra
      / in the middle.
      
      * docs/formatdomain.html.in (elementsDisks): Fix another typo.
      d145fe3b
  21. 23 12月, 2011 1 次提交
  22. 22 12月, 2011 1 次提交
  23. 21 12月, 2011 1 次提交
  24. 20 12月, 2011 1 次提交
  25. 19 12月, 2011 1 次提交
  26. 13 12月, 2011 1 次提交
    • E
      docs: document <address> elements in one place · fe7fc161
      Eric Blake 提交于
      Improve the documentation of what forms a valid <address> element,
      since these elements appear in numerous devices.
      
      * docs/formatdomain.html.in (elementsAddress): New section.
      (elementsControllers, elementsUSB, elementsNICS, elementsInput)
      (elementsHub, elementsCharChannel, elementsSound): Refer to it.
      fe7fc161
  27. 10 12月, 2011 1 次提交
    • E
      network: allow '-' in model name · dad3c209
      Eric Blake 提交于
      In QEMU PPC64 we have a network device called "spapr-vlan". We can specify
      this using the existing syntax for network devices, however libvirt
      currently rejects "spapr-vlan" in virDomainNetDefParseXML() because of
      the "-". Fix the code to accept "-".
      
      * src/conf/domain_conf.c (virDomainNetDefParseXML): Allow '-' in
      model name, and be more efficient.
      * docs/schemas/domaincommon.rng: Limit valid model names to match code.
      Based on a patch by Michael Ellerman.
      dad3c209
  28. 08 12月, 2011 2 次提交