1. 30 12月, 2011 1 次提交
    • 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
  2. 21 12月, 2011 1 次提交
  3. 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
  4. 08 12月, 2011 1 次提交
  5. 07 12月, 2011 1 次提交
    • O
      npiv: Expose fabric_name outside · cc17f092
      Osier Yang 提交于
      This patch is to expose the fabric_name of fc_host class, which
      might be useful for users who wants to known which fabric the
      (v)HBA connects to.
      
      The patch also adds the missed capabilities' XML schema of scsi_host,
      (of course, with fabric_wwn added), and update the documents
      (docs/formatnode.html.in)
      cc17f092
  6. 01 12月, 2011 1 次提交
  7. 30 11月, 2011 2 次提交
    • D
      Fix capabilities XML to use generic terms for suspend targets · ae5e5528
      Daniel P. Berrange 提交于
      The capabilities XML uses the x86 specific terms 'S3', 'S4'
      and 'Hybrid-Syspend'. Switch it to use the same terminology
      as the API constants and virsh options, eg 'suspend_mem'
      'suspend_disk' and 'suspend_hybrid'
      
      * docs/formatcaps.html.in, docs/schemas/capability.rng,
        src/conf/capabilities.c: Rename suspend constants
      ae5e5528
    • H
      blkiotune: add interface for blkiotune.device_weight · 6ac81c8e
      Hu Tao 提交于
      This adds per-device weights to <blkiotune>.  Note that the
      cgroups implementation only supports weights per block device,
      and not per-file within the device; hence this option must be
      global to the domain definition rather than tied to individual
      <devices>/<disk> entries:
      
      <domain ...>
        <blkiotune>
          <device>
            <path>/path/to/block</path>
            <weight>1000</weight>
          </device>
        </blkiotune>
      ..
      
      This patch also adds a parameter --device-weights to virsh command
      blkiotune for setting/getting blkiotune.weight_device for any
      hypervisor that supports it.  All <device> entries under
      <blkiotune> are concatenated into a single string attribute under
      virDomain{Get,Set}BlkioParameters, named "device_weight".
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6ac81c8e
  8. 29 11月, 2011 2 次提交
  9. 23 11月, 2011 2 次提交
  10. 22 11月, 2011 1 次提交
    • S
      Export KVM Host Power Management capabilities · e352b164
      Srivatsa S. Bhat 提交于
      This patch exports KVM Host Power Management capabilities as XML so that
      higher-level systems management software can make use of these features
      available in the host.
      
      The script "pm-is-supported" (from pm-utils package) is run to discover if
      Suspend-to-RAM (S3) or Suspend-to-Disk (S4) is supported by the host.
      If either of them are supported, then a new tag "<power_management>" is
      introduced in the XML under the <host> tag.
      
      However in case the query to check for power management features succeeded,
      but the host does not support any such feature, then the XML will contain
      an empty <power_management/> tag. In the event that the PM query itself
      failed, the XML will not contain any "power_management" tag.
      
      To use this, new APIs could be implemented in libvirt to exploit power
      management features such as S3/S4.
      e352b164
  11. 19 11月, 2011 4 次提交
    • S
      Add support for VLAN filtering · 8047c4bf
      Stefan Berger 提交于
      This patch adds support for filtering of VLAN (802.1Q) traffic to the
      parser and makes us of the ebtables support for VLAN filtering. This code
      now enables the filtering of traffic in chains with prefix 'vlan'.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      8047c4bf
    • S
      Extend NWFilter parameter parser to cope with lists of values · 89513286
      Stefan Berger 提交于
      This patch modifies the NWFilter parameter parser to support multiple
      elements with the same name and to internally build a list of items.
      An example of the XML looks like this:
      
              <parameter name='TEST' value='10.1.2.3'/>
              <parameter name='TEST' value='10.2.3.4'/>
              <parameter name='TEST' value='10.1.1.1'/>
      
      The list of values is then stored in the newly introduced data type
      virNWFilterVarValue.
      
      The XML formatter is also adapted to print out all items in alphabetical
      order sorted by 'name'.
      
      This patch also fixes a bug in the XML schema on the way.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      89513286
    • S
      Enable chains with names having a known prefix · ea7c73a7
      Stefan Berger 提交于
      This patch enables chains that have a known prefix in their name.
      Known prefixes are: 'ipv4', 'ipv6', 'arp', 'rarp'. All prefixes
      are also protocols that can be evaluated on the ebtables level.
      
      Following the prefix they will be automatically connected to an interface's
      'root' chain and jumped into following the protocol they evaluate, i.e.,
      a table 'arp-xyz' will be accessed from the root table using
      
      ebtables -t nat -A <iface root table> -p arp -j I-<ifname>-arp-xyz
      
      thus generating a 'root' chain like this one here:
      
      Bridge chain: libvirt-O-vnet0, entries: 5, policy: ACCEPT
      -p IPv4 -j O-vnet0-ipv4
      -p ARP -j O-vnet0-arp
      -p 0x8035 -j O-vnet0-rarp
      -p ARP -j O-vnet0-arp-xyz
      -j DROP 
      
      where the chain 'arp-xyz' is accessed for filtering of ARP packets.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      ea7c73a7
    • S
      Extend the filter XML to support priorities of chains · 2657822e
      Stefan Berger 提交于
      This patch extends the filter XML to support priorities of chains
      in the XML. An example would be:
      
      <filter name='allow-arpxyz' chain='arp-xyz' priority='200'>
      [...]
      </filter>
      
      The permitted values for priorities are [-1000, 1000].
      By setting the priority of a chain the order in which it is accessed
      from the interface root chain can be influenced.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      2657822e
  12. 18 11月, 2011 1 次提交
  13. 04 11月, 2011 1 次提交
  14. 29 10月, 2011 3 次提交
  15. 25 10月, 2011 2 次提交
  16. 18 10月, 2011 1 次提交
    • J
      Add AHCI support to qemu driver · c1bc3d89
      Jim Fehlig 提交于
      Tested with multiple AHCI controllers and multiple disks attached
      to a controller. E.g.,
      
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk0.raw'/>
            <target dev='sda' bus='sata'/>
            <address type='drive' controller='0' bus='0' unit='0'/>
          </disk>
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk1.raw'/>
            <target dev='sdb' bus='sata'/>
            <address type='drive' controller='0' bus='0' unit='1'/>
          </disk>
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk2.raw'/>
            <target dev='sdc' bus='sata'/>
            <address type='drive' controller='1' bus='0' unit='0'/>
          </disk>
          <controller type='sata' index='0'>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
          </controller>
          <controller type='sata' index='1'>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
          </controller>
      c1bc3d89
  17. 13 10月, 2011 1 次提交
  18. 07 10月, 2011 1 次提交
    • L
      qemu: add separate rerror_policy for disk errors · 4bb4109f
      Laine Stump 提交于
      Previously libvirt's disk device XML only had a single attribute,
      error_policy, to control both read and write error policy, but qemu
      has separate options for controlling read and write. In one case
      (enospc) a policy is allowed for write errors but not read errors.
      
      This patch adds a separate attribute that sets only the read error
      policy. If just error_policy is set, it will apply to both read and
      write error policy (previous behavior), but if the new rerror_policy
      attribute is set, it will override error_policy for read errors only.
      Possible values for rerror_policy are "stop", "report", and "ignore"
      ("report" is the qemu-controlled default for rerror_policy when
      error_policy isn't specified).
      
      For consistency, the value "report" has been added to the possible
      values for error_policy as well.
      4bb4109f
  19. 01 10月, 2011 1 次提交
    • L
      qemu: make PCI multifunction support more manual · c329db71
      Laine Stump 提交于
      When support for was added for PCI multifunction cards (in commit
      9f8baf, first included in libvirt 0.9.3), it was done by always
      turning on the multifunction bit for all PCI devices. Since that time
      it has been realized that this is not an ideal solution, and that the
      multifunction bit must be selectively turned on. For example, see
      
        https://bugzilla.redhat.com/show_bug.cgi?id=728174
      
      and the discussion before and after
      
        https://www.redhat.com/archives/libvir-list/2011-September/msg01036.html
      
      This patch modifies multifunction support so that the multifunction=on
      option is only added to the qemu commandline for a device if its PCI
      <address> definition has the attribute "multifunction='on'", e.g.:
      
        <address type='pci' domain='0x0000' bus='0x00'
                 slot='0x04' function='0x0' multifunction='on'/>
      
      In practice, the multifunction bit should only be turned on if
      function='0' AND other functions will be used in the same slot - it
      usually isn't needed for functions 1-7 (although there are apparently
      some exceptions, e.g. the Intel X53 according to the QEMU source
      code), and should never be set if only function 0 will be used in the
      slot. The test cases have been changed accordingly to illustrate.
      
      With this patch in place, if a user attempts to assign multiple
      functions in a slot without setting the multifunction bit for function
      0, libvirt will issue an error when the domain is defined, and the
      define operation will fail. In the future, we may decide to detect
      this situation and automatically add multifunction=on to avoid the
      error; even then it will still be useful to have a manual method of
      turning on multifunction since, as stated above, there are some
      devices that excpect it to be turned on for all functions in a slot.
      
      A side effect of this patch is that attempts to use the same PCI
      address for two different devices will now log an error (previously
      this would cause the domain define operation to fail, but there would
      be no log message generated). Because the function doing this log was
      almost completely rewritten, I didn't think it worthwhile to make a
      separate patch for that fix (the entire patch would immediately be
      obsoleted).
      c329db71
  20. 27 9月, 2011 1 次提交
    • L
      qemu: add ability to set PCI device "rombar" on or off · dc79852a
      Laine Stump 提交于
      This patch was made in response to:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=738095
      
      In short, qemu's default for the rombar setting (which makes the
      firmware ROM of a PCI device visible/not on the guest) was previously
      0 (not visible), but they recently changed the default to 1
      (visible). Unfortunately, there are some PCI devices that fail in the
      guest when rombar is 1, so the setting must be exposed in libvirt to
      prevent a regression in behavior (it will still require explicitly
      setting <rom bar='off'/> in the guest XML).
      
      rombar is forced on/off by adding:
      
        <rom bar='on|off'/>
      
      inside a <hostdev> element that defines a PCI device. It is currently
      ignored for all other types of devices.
      
      At the moment there is no clean method to determine whether or not the
      rombar option is supported by QEMU - this patch uses the advice of a
      QEMU developer to assume support for qemu-0.12+. There is currently a
      patch in the works to put this information in the output of "qemu-kvm
      -device pci-assign,?", but of course if we switch to keying off that,
      we would lose support for setting rombar on all the versions of qemu
      between 0.12 and whatever version gets that patch.
      dc79852a
  21. 23 9月, 2011 1 次提交
    • O
      Add unsafe cache mode support for disk driver · f887334d
      Oskari Saarenmaa 提交于
      QEMU 0.13 introduced cache=unsafe for -drive, this patch exposes
      it in the libvirt layer.
      
        * Introduced a new QEMU capability flag ($prefix_CACHE_UNSAFE),
          as even if $prefix_CACHE_V2 is set, we can't know if unsafe
          is supported.
      
        * Improved the reliability of qemu cache type detection.
      f887334d
  22. 06 9月, 2011 2 次提交
    • P
      link-state: conf: Add element to XML for controling link state · edd1295e
      Peter Krempa 提交于
      A new element is introduced to XML that allows to control
      state of virtual network interfaces in hypervisors.
      
      Live modification of the link state allows networking tools
      propagate topology changes to guest OS or testing of
      scenarios in complex (virtual) networks.
      
      This patch adds elements to XML grammars and parsing and generating
      code.
      edd1295e
    • M
      redirdev: allows to specify device address · 2e0dbaad
      Marc-André Lureau 提交于
      It is important to be able to attach USB redirected devices to a
      particular controller (one that supports USB2 for instance).
      Without this patch, only the default bus was used.
      
           <redirdev bus='usb' type='spicevmc'>
             <address type='usb' bus='0' port='4'/>
           </redirdev>
      2e0dbaad
  23. 05 9月, 2011 4 次提交
    • E
      snapshot: also support disks by path · 89b6284f
      Eric Blake 提交于
      I got confused when 'virsh domblkinfo dom disk' required the
      path to a disk (which can be ambiguous, since a single file
      can back multiple disks), rather than the unambiguous target
      device name that I was using in disk snapshots.  So, in true
      developer fashion, I went for the best of both worlds - all
      interfaces that operate on a disk (aka block) now accept
      either the target name or the unambiguous path to the backing
      file used by the disk.
      
      * src/conf/domain_conf.h (virDomainDiskIndexByName): Add
      parameter.
      (virDomainDiskPathByName): New prototype.
      * src/libvirt_private.syms (domain_conf.h): Export it.
      * src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow
      searching by path, and decide whether ambiguity is okay.
      (virDomainDiskPathByName): New function.
      (virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update
      callers.
      * src/qemu/qemu_driver.c (qemudDomainBlockPeek)
      (qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig)
      (qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise.
      * src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath):
      Likewise.
      * src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive)
      (libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig)
      (libxlDomainUpdateDeviceConfig): Likewise.
      * src/uml/uml_driver.c (umlDomainBlockPeek): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise.
      * docs/formatsnapshot.html.in: Update documentation.
      * tools/virsh.pod (domblkstat, domblkinfo): Likewise.
      * docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on
      disk targets.
      * docs/schemas/domainsnapshot.rng (disksnapshot): Update to match.
      * tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.
      89b6284f
    • E
      snapshot: add <disks> to snapshot xml · d6f6b2d1
      Eric Blake 提交于
      Adds an optional element to <domainsnapshot>, which will be used
      to give user control over external snapshot filenames on input,
      and specify generated filenames on output.
      
      For now, no driver accepts this element; that will come later.
      
      <domainsnapshot>
        ...
        <disks>
          <disk name='vda' snapshot='no'/>
          <disk name='vdb' snapshot='internal'/>
          <disk name='vdc' snapshot='external'>
            <driver type='qcow2'/>
            <source file='/path/to/new'/>
          </disk>
        </disks>
        <domain>
          ...
          <devices>
            <disk ...>
              <driver name='qemu' type='raw'/>
              <target dev='vdc'/>
              <source file='/path/to/old'/>
            </disk>
          </devices>
        </domain>
      </domainsnapshot>
      
      * src/conf/domain_conf.h (_virDomainSnapshotDiskDef): New type.
      (_virDomainSnapshotDef): Add new elements.
      (virDomainSnapshotAlignDisks): New prototype.
      * src/conf/domain_conf.c (virDomainSnapshotDiskDefClear)
      (virDomainSnapshotDiskDefParseXML, disksorter)
      (virDomainSnapshotAlignDisks): New functions.
      (virDomainSnapshotDefParseString): Parse new fields.
      (virDomainSnapshotDefFree): Clean them up.
      (virDomainSnapshotDefFormat): Output them.
      * src/libvirt_private.syms (domain_conf.h): Export new function.
      * docs/schemas/domainsnapshot.rng (domainsnapshot, disksnapshot):
      Add more xml.
      * docs/formatsnapshot.html.in: Document it.
      * tests/domainsnapshotxml2xmlin/disk_snapshot.xml: New test.
      * tests/domainsnapshotxml2xmlout/disk_snapshot.xml: Update.
      d6f6b2d1
    • E
      snapshot: support extra state in snapshots · 5b30b08d
      Eric Blake 提交于
      In order to distinguish disk snapshots from system checkpoints, a
      new state value that is only valid for snapshots is helpful.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_LAST): New placeholder.
      * src/conf/domain_conf.h (virDomainSnapshotState): New enum mapping.
      (VIR_DOMAIN_DISK_SNAPSHOT): New internal enum value.
      * src/conf/domain_conf.c (virDomainState): Use placeholder.
      (virDomainSnapshotState): Extend mapping by one for use in snapshot.
      (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
      Handle new state.
      (virDomainObjSetState, virDomainStateReasonToString)
      (virDomainStateReasonFromString): Avoid compiler warnings.
      * tools/virsh.c (vshDomainState, vshDomainStateReasonToString):
      Likewise.
      * src/libvirt_private.syms (domain_conf.h): Export new functions.
      * docs/schemas/domainsnapshot.rng: Tighten state definition.
      * docs/formatsnapshot.html.in: Document it.
      * tests/domainsnapshotxml2xmlout/disk_snapshot.xml: New test.
      5b30b08d
    • E
      snapshot: additions to domain xml for disks · 47123530
      Eric Blake 提交于
      As discussed here:
      https://www.redhat.com/archives/libvir-list/2011-August/msg00361.html
      https://www.redhat.com/archives/libvir-list/2011-August/msg00552.html
      
      Adds snapshot attribute and transient sub-element:
      
      <devices>
        <disk type=... snapshot='no|internal|external'>
          ...
          <transient/>
        </disk>
      </devices>
      
      * docs/schemas/domaincommon.rng (snapshot): New define.
      (disk): Add snapshot and persistent attributes.
      * docs/formatdomain.html.in: Document them.
      * src/conf/domain_conf.h (virDomainDiskSnapshot): New enum.
      (_virDomainDiskDef): New fields.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-transient.xml: New
      test of rng, no args counterpart until qemu support is complete.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.args: New
      file, snapshot attribute does not affect args.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.xml: Likewise.
      * tests/qemuxml2argvtest.c (mymain): Run new test.
      47123530
  24. 03 9月, 2011 1 次提交
    • E
      snapshot: update rng to support full domain in xml · 2a95a3e9
      Eric Blake 提交于
      This patch will probably cause merge conflicts to those trying
      to do backports.  The end goal is simple - domaincommon.rng
      should be the state of domain.rng pre-patch, with a few lines
      tweaked in the header, while domain.rng post-patch is now just
      a shell that includes domaincommon.rng and sets the <start>.
      
      * docs/schemas/domain.rng: Move guts...
      * docs/schemas/domaincommon.rng: ...to new file.
      * docs/schemas/domainsnapshot.rng: Allow new xml.
      * docs/schemas/Makefile.am (schema_DATA): Distribute new file.
      * tests/domainsnapshotxml2xmlout/full_domain.xml: New test.
      * libvirt.spec.in (%files client): Ship new file.  Sort lines.
      * mingw32-libvirt.spec.in: Likewise.
      2a95a3e9
  25. 02 9月, 2011 3 次提交