1. 30 11月, 2011 2 次提交
    • D
      Remove internal only virHostPMCapability enum · 6fb5400f
      Daniel P. Berrange 提交于
      The internal virHostPMCapability enum just duplicates the
      public virNodeSuspendTarget enum, but with different names.
      
      * src/util/util.c: Use VIR_NODE_SUSPEND_TARGET constants
      * src/util/util.h: Remove virHostPMCapability enum
      * src/conf/capabilities.c: Use VIR_NODE_SUSPEND_TARGET_LAST
      6fb5400f
    • 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
  2. 29 11月, 2011 2 次提交
  3. 28 11月, 2011 1 次提交
  4. 25 11月, 2011 1 次提交
    • M
      conf: Don't drop console definition on domain restart · c3a6a1e1
      Michal Privoznik 提交于
      One of my latest patches 2e37bf42
      copy serial console definition. On domain shutdown we save this
      info into state XML. However, later on the daemon start we simply
      drop this info and since we are not re-reading qemu log,
      vm->def->consoles[0] does not get populated with copy. Therefore
      we need to avoid dropping console definition if it is just alias
      for serial console.
      c3a6a1e1
  5. 24 11月, 2011 1 次提交
  6. 23 11月, 2011 4 次提交
    • S
      Enable detection of multiple IP addresses · ad6c67cf
      Stefan Berger 提交于
      In preparation of DHCP Snooping and the detection of multiple IP
      addresses per interface:
      
      The hash table that is used to collect the detected IP address of an
      interface can so far only handle one IP address per interface. With
      this patch we extend this to allow it to handle a list of IP addresses.
      
      Above changes the returned variable type of virNWFilterGetIpAddrForIfname()
      from char * to virNWFilterVarValuePtr; adapt all existing functions calling
      this function.
      ad6c67cf
    • S
      Pass additional parameter into applyDHCPOnly function · 7ca82ecb
      Stefan Berger 提交于
      In preparation for the DHCP Snooping code:
      Pass an additional parameter into the applyDHCPOnly function
      of the 'techdriver'.
      7ca82ecb
    • S
      Add support for STP filtering · ba3bf00a
      Stefan Berger 提交于
      This patch adds support for filtering of STP (spanning tree protocol) traffic
      to the parser and makes us of the ebtables support for STP filtering. This code
      now enables the filtering of traffic in chains with prefix 'stp'.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      ba3bf00a
    • S
      Add a 'mac' chain · af37ce3d
      Stefan Berger 提交于
      With hunks borrowed from one of David Steven's previous patches, we now
      add the capability of having a 'mac' chain which is useful to filter
      for multiple valid MAC addresses.
      Signed-off-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      af37ce3d
  7. 22 11月, 2011 3 次提交
    • D
      Add strings.h include to capabilities.h for ffs() function prototype · 720442e2
      Daniel P. Berrange 提交于
      On Mingw32 the ffs() function was not declared due to missing header
      include
      
      * src/conf/capabilities.c: The ffs() function lives in strings.h
      720442e2
    • 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
    • E
      conf: don't modify cpu set string during parsing · 693d22d4
      Eric Blake 提交于
      None of the callers cared if str was updated to point to the next
      byte after the parsed cpuset; simplifying this results in quite
      a few code simplifications.  Additionally, virCPUDefParseXML was
      strdup()'ing a malloc()'d string; avoiding a memory copy resulted
      in less code.
      
      * src/conf/domain_conf.h (virDomainCpuSetParse): Alter signature.
      * src/conf/domain_conf.c (virDomainCpuSetParse): Don't modify str.
      (virDomainVcpuPinDefParseXML, virDomainDefParseXML): Adjust
      callers.
      * src/conf/cpu_conf.c (virCPUDefParseXML): Likewise.
      * src/xen/xend_internal.c (sexpr_to_xend_topology): Likewise.
      * src/xen/xm_internal.c (xenXMDomainPinVcpu): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxpr): Likewise.
      * src/xenxs/xen_xm.c (xenParseXM): Likewise.
      693d22d4
  8. 21 11月, 2011 1 次提交
    • M
      qemu: Copy console definition from serial · 2e37bf42
      Michal Privoznik 提交于
      Now, when we support multiple consoles per domain,
      the vm->def->console[0] can still remain an alias
      for vm->def->serial[0]; However, we need to copy
      it's source definition as well otherwise we'll regress
      on virDomainOpenConsole.
      2e37bf42
  9. 19 11月, 2011 12 次提交
    • 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
      Create rules for each member of a list · c80296e2
      Stefan Berger 提交于
      This patch extends the NWFilter driver for Linux (ebiptables) to create
      rules for each member of a previously introduced list. If for example
      an attribute value (internally) looks like this:
      
      IP = [10.0.0.1, 10.0.0.2, 10.0.0.3]
      
      then 3 rules will be generated for a rule accessing the variable 'IP',
      one for each member of the list. The effect of this is that this now
      allows for filtering for multiple values in one field. This can then be
      used to support for filtering/allowing of multiple IP addresses per
      interface.
      
      An iterator is introduced that extracts each member of a list and
      puts it into a hash table which then is passed to the function creating
      a rule. For the above example the iterator would cause 3 loops.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      c80296e2
    • S
      Rework value part of name-value pairs · 581d1cea
      Stefan Berger 提交于
      NWFilters can be provided name-value pairs using the following
      XML notation:
      
            <filterref filter='xyz'>
              <parameter name='PORT' value='80'/>
              <parameter name='VAL' value='abc'/>
            </filterref>
      
      The internal representation currently is so that a name is stored as a
      string and the value as well. This patch now addresses the value part of it
      and introduces a data structure for storing a value either as a simple
      value or as an array for later support of lists.
      
      This patch adjusts all code that was handling the values in hash tables
      and makes it use the new data type.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      581d1cea
    • S
      Extend rule priorities into negative numbers · f6e80a71
      Stefan Berger 提交于
      So far rules' priorities have only been valid in the range [0,1000].
      Now I am extending their priority into the range [-1000, 1000] for subsequently
      being able to sort rules and the access of (jumps into) chains following
      priorities.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      f6e80a71
    • 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
    • S
      Use the actual names of chains in data structure · 19028ad6
      Stefan Berger 提交于
      Use the name of the chain rather than its type index (enum).
      This pushes the later enablement of chains with user-given names
      into the XML parser. For now we still only allow those names that
      are well known ('root', 'arp', 'rarp', 'ipv4' and 'ipv6').
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      19028ad6
    • S
      Introduce an internal priority for chains · 4df34ec3
      Stefan Berger 提交于
      For better handling of the sorting of chains introduce an internally used
      priority. Use a lookup table to store the priorities. For now their actual
      values do not matter just that the values cause the chains to be properly
      sorted through changes in the following patches. However, the values are
      chosen as negative so that once they are sorted along with filtering rules
      (whose priority may only be positive for now) they will always be instantiated
      before them (lower values cause instantiation before higher values). This
      is done to maintain backwards compatibility.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      4df34ec3
    • D
      Add missing 'const' annotations for internal domain conf helpers · 914d1b74
      Daniel P. Berrange 提交于
      The virDomainNetGetActualBridgeName and virDomainNetGetActualDirectDev
      methods both return strings that point to data in the virDomainDefPtr
      struct, and should therefore not be freed. The return values should
      thus be 'const char *' not 'char *'.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Mark const
      * src/network/bridge_driver.c: Update to use a const char *
      914d1b74
    • D
      Rename and split the macvtap.c file · 896104c9
      Daniel P. Berrange 提交于
      Rename the macvtap.c file to virnetdevmacvlan.c to reflect its
      functionality. Move the port profile association code out into
      virnetdevvportprofile.c. Make the APIs available unconditionally
      to callers
      
      * src/util/macvtap.h: rename to src/util/virnetdevmacvlan.h,
      * src/util/macvtap.c: rename to src/util/virnetdevmacvlan.c
      * src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h:
        Pull in vport association code
      * src/Makefile.am, src/conf/domain_conf.h, src/qemu/qemu_conf.c,
        src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update include
        paths & remove conditional compilation
      896104c9
    • D
      Rename Macvtap management APIs · 43925db7
      Daniel P. Berrange 提交于
      In preparation for code re-organization, rename the Macvtap
      management APIs to have the following patterns
      
        virNetDevMacVLanXXXXX     - macvlan/macvtap interface management
        virNetDevVPortProfileXXXX - virtual port profile management
      
      * src/util/macvtap.c, src/util/macvtap.h: Rename APIs
      * src/conf/domain_conf.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_command.h,
        src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
        src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
        src/qemu/qemu_process.h: Update for renamed APIs
      43925db7
  10. 18 11月, 2011 3 次提交
    • B
      qemu: Generate -numa option · 9b6bb0fe
      Bharata B Rao 提交于
      Add routines to generate -numa QEMU command line option based on
      <numa> ... </numa> XML specifications.
      Signed-off-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      9b6bb0fe
    • B
      XML definitions for guest NUMA and parsing routines · 5f7b71b4
      Bharata B Rao 提交于
      This patch adds XML definitions for guest NUMA specification and contains
      routines to parse the same. The guest NUMA specification looks like this:
      
      <cpu>
              ...
              <topology sockets='2' cores='4' threads='2'/>
              <numa>
                      <cell cpus='0-7' memory='512000'/>
                      <cell cpus='8-15' memory='512000'/>
              </numa>
              ...
      </cpu>
      Signed-off-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      5f7b71b4
    • E
      snapshot: refuse to generate names for non-regular backing files · c74b9715
      Eric Blake 提交于
      For whatever reason, the kernel allows you to create a regular
      file named /dev/sdc.12345; although this file will disappear the
      next time devtmpfs is remounted.  If you let libvirt generate
      the name of the external snapshot for a disk image originally
      using the block device /dev/sdc, then the domain will be rendered
      unbootable once the qcow2 file is lost on the next devtmpfs
      remount.  In this case, the user should have used 'virsh
      snapshot-create --xmlfile' or 'virsh snapshot-create-as --diskspec'
      to specify the name for the qcow2 file in a sane location, rather
      than relying on libvirt generating a name that is most likely to
      be wrong.  We can help avoid naive mistakes by enforcing that
      the user provide the external name for any backing file that is
      not a regular file.
      
      * src/conf/domain_conf.c (virDomainSnapshotAlignDisks): Only
      generate names if backing file exists as regular file.
      Reported by MATSUDA Daiki.
      c74b9715
  11. 15 11月, 2011 3 次提交
    • D
      Split src/util/network.{c,h} into 5 pieces · d3406045
      Daniel P. Berrange 提交于
      The src/util/network.c file is a dumping ground for many different
      APIs. Split it up into 5 pieces, along functional lines
      
       - src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
       - src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
       - src/util/virsocketaddr.c: virSocketAddr and APIs
       - src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
         for virNetDevBandwidth
       - src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
         for virNetDevVPortProfile
      
      * src/util/network.c, src/util/network.h: Split into 5 pieces
      * src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
        src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
        src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
        src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
        src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
      * daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
        src/conf/domain_conf.h, src/conf/network_conf.c,
        src/conf/network_conf.h, src/conf/nwfilter_conf.h,
        src/esx/esx_util.h, src/network/bridge_driver.c,
        src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
        src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
        src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
        src/util/virnetdev.h, src/util/virnetdevtap.c,
        tools/virsh.c: Update include files
      d3406045
    • D
      Fix error reporting in port profile parsing/formatting APIs · df64f480
      Daniel P. Berrange 提交于
      The virtual port profile parsing/formatting APIs do not
      correctly handle unknown profile type strings/numbers.
      They behave as a no-op, instead of raising an error
      
      * src/util/network.c, src/util/network.h: Fix error
        handling of port profile APIs
      * src/conf/domain_conf.c, src/conf/network_conf.c: Update
        for API changes
      df64f480
    • D
      Rename virVirtualPortProfileParams & APIs · 767e01ce
      Daniel P. Berrange 提交于
      Rename the virVirtualPortProfileParams struct to be
      virNetDevVPortProfile, and rename the APIs to match
      this prefix.
      
      * src/util/network.c, src/util/network.h: Rename port profile
        APIs
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/conf/network_conf.c, src/conf/network_conf.h,
        src/network/bridge_driver.c, src/qemu/qemu_hotplug.c,
        src/util/macvtap.c, src/util/macvtap.h: Update for
        renamed APIs/structs
      767e01ce
  12. 10 11月, 2011 2 次提交
    • D
      Adjust naming of network device bandwidth management APIs · 0eee075d
      Daniel P. Berrange 提交于
      Rename virBandwidth to virNetDevBandwidth, and virRate to
      virNetDevBandwidthRate.
      
      * src/util/network.c, src/util/network.h: Rename bandwidth
        structs and APIs
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/conf/network_conf.c, src/conf/network_conf.h,
        src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/util/macvtap.c,
        src/util/macvtap.h, tools/virsh.c: Update for API changes.
      0eee075d
    • D
      Santize naming of socket address APIs · 4c544e6c
      Daniel P. Berrange 提交于
      The socket address APIs in src/util/network.h either take the
      form  virSocketAddrXXX, virSocketXXX or virSocketXXXAddr.
      
      Sanitize this so everything is virSocketAddrXXXX, and ensure
      that the virSocketAddr parameter is always the first one.
      
      * src/util/network.c, src/util/network.h: Santize socket
        address API naming
      * src/conf/domain_conf.c, src/conf/network_conf.c,
        src/conf/nwfilter_conf.c, src/network/bridge_driver.c,
        src/nwfilter/nwfilter_ebiptables_driver.c,
        src/nwfilter/nwfilter_learnipaddr.c,
        src/qemu/qemu_command.c, src/rpc/virnetsocket.c,
        src/util/dnsmasq.c, src/util/iptables.c,
        src/util/virnetdev.c, src/vbox/vbox_tmpl.c: Update for
        API renaming
      4c544e6c
  13. 04 11月, 2011 1 次提交
  14. 03 11月, 2011 3 次提交
    • D
      Fix default console type setting · 209c2880
      Daniel P. Berrange 提交于
      The default console type may vary based on the OS type. ie a Xen
      paravirt guests wants a 'xen' console, while a fullvirt guests
      wants a 'serial' console.
      
      A plain integer default console type in the capabilities does
      not suffice. Instead introduce a callback that is passed the
      OS type.
      
      * src/conf/capabilities.h: Use a callback for default console
        type
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Use callback
        for default console type. Add missing LXC/OpenVZ console types.
      * src/esx/esx_driver.c, src/libxl/libxl_conf.c,
        src/lxc/lxc_conf.c, src/openvz/openvz_conf.c,
        src/phyp/phyp_driver.c, src/qemu/qemu_capabilities.c,
        src/uml/uml_conf.c, src/vbox/vbox_tmpl.c,
        src/vmware/vmware_conf.c, src/xen/xen_hypervisor.c,
        src/xenapi/xenapi_driver.c: Set default console type callback
      209c2880
    • D
      Default console target type with no <target> element · 876c8b3b
      Daniel P. Berrange 提交于
      When no <target> element was set at all, the default console
      target type was not being honoured
      
      * src/conf/domain_conf.c: Set default target type for consoles
        with no <target>
      876c8b3b
    • D
      Allow multiple consoles per virtual guest · 0873b688
      Daniel P. Berrange 提交于
      While Xen only has a single paravirt console, UML, and
      QEMU both support multiple paravirt consoles. The LXC
      driver can also be trivially made to support multiple
      consoles. This patch extends the XML to allow multiple
      <console> elements in the XML. It also makes the UML
      and QEMU drivers support this config.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
        multiple <console> devices
      * src/lxc/lxc_driver.c, src/xen/xen_driver.c,
        src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
        internal API changes
      * src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Only label consoles that aren't a copy of the serial device
      * src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
        src/qemu/qemu_process.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Support multiple console devices
      * tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
        tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
        for all console /channel tests
      * tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
        for correct chardev syntax
      * tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
        test file
      0873b688
  15. 01 11月, 2011 1 次提交