1. 28 4月, 2015 2 次提交
    • J
      conf: Move virDomainPinIsDuplicate and make static · b96254d4
      John Ferlan 提交于
      Since it's only ever referenced in domain_conf.c, make the function
      static, but also will need to move it to somewhere before it's referenced
      rather than forward referencing it.
      b96254d4
    • J
      conf: Add new domain XML element 'iothreadids' · 93383c1f
      John Ferlan 提交于
      Adding a new XML element 'iothreadids' in order to allow defining
      specific IOThread ID's rather than relying on the algorithm to assign
      IOThread ID's starting at 1 and incrementing to iothreads count.
      
      This will allow future patches to be able to add new IOThreads by
      a specific iothread_id and of course delete any exisiting IOThread.
      
      Each iothreadids element will have 'n' <iothread> children elements
      which will have attribute "id".  The "id" will allow for definition
      of any "valid" (eg > 0) iothread_id value.
      
      On input, if any <iothreadids> <iothread>'s are provided, they will
      be marked so that we only print out what we read in.
      
      On input, if no <iothreadids> are provided, the PostParse code will
      self generate a list of ID's starting at 1 and going to the number
      of iothreads defined for the domain (just like the current algorithm
      numbering scheme).  A future patch will rework the existing algorithm
      to make use of the iothreadids list.
      
      On output, only print out the <iothreadids> if they were read in.
      93383c1f
  2. 24 4月, 2015 1 次提交
  3. 22 4月, 2015 1 次提交
    • L
      util: set MAC address for VF via netlink message to PF+VF# when possible · cb3fe38c
      Laine Stump 提交于
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1113474
      
      When we set the MAC address of a network device as a part of setting
      up macvtap "passthrough" mode (where the domain has an emulated netdev
      connected to a host macvtap device that has exclusive use of the
      physical device, and sets the device MAC address to match its own,
      i.e. "<interface type='direct'> <source mode='passthrough' .../>"), we
      use ioctl(SIOCSIFHWADDR) giving it the name of that device. This is
      true even if it is an SRIOV Virtual Function (VF).
      
      But, when we are setting the MAC address / vlan ID of a VF in
      preparation for "hostdev network" passthrough (this is where we set
      the MAC address and vlan id of the VF after detaching the host net
      driver and before assigning the device to the domain with PCI
      passthrough, i.e. "<interface type='hostdev'>", we do the setting via
      a netlink RTM_SETLINK message for that VF's Physical Function (PF),
      telling it the VF# we want to change. This sets an "administratively
      changed MAC" flag for that VF in the PF's driver, and from that point
      on (until the PF driver is reloaded, *not* merely the VF driver) that
      VF's MAC address can't be changed using ioctl(SIOCSIFHWADDR) - the
      only way to change it is via the PF with RTM_SETLINK.
      
      This means that if a VF is used for hostdev passthrough, it will have
      the admin flag set, and future attempts to use that VF for macvtap
      passthrough will fail.
      
      The solution to this problem is to check if the device being used for
      macvtap passthrough is actually a VF; if so, we use the netlink
      RTM_SETLINK message to the PF to set the VF's mac address instead of
      ioctl(SIOCSIFHWADDR) directly to the VF; if not, behavior does not
      change from previously.
      
      There are three pieces to making this work:
      
      1) virNetDevMacVLan(Create|Delete)WithVPortProfile() now call
         virNetDev(Replace|Restore)NetConfig() rather than
         virNetDev(Replace|Restore)MacAddress() (simply passing -1 for VF#
         and vlanid).
      
      2) virNetDev(Replace|Restore)NetConfig() check to see if the device is
         a VF. If so, they find the PF's name and VF#, allowing them to call
         virNetDev(Replace|Restore)VfConfig().
      
      3) To prevent mixups when detaching a macvtap passthrough device that
         had been attached while running an older version of libvirt,
         virNetDevRestoreVfConfig() is potentially given the preserved name
         of the VF, and if the proper statefile for a VF can't be found in
         the stateDir (${stateDir}/${pfname}_vf${vfid}),
         virNetDevRestoreMacAddress() is called instead (which will look in
         the file named ${stateDir}/${vfname}).
      
      This problem has existed in every version of libvirt that has both
      macvtap passthrough and interface type='hostdev'. Fortunately people
      seem to use one or the other though, so it hasn't caused any real
      world problem reports.
      cb3fe38c
  4. 21 4月, 2015 3 次提交
    • C
      caps: Use DomainDataLookup to replace GuestDefault* · 747761a7
      Cole Robinson 提交于
      This revealed that GuestDefaultEmulator was a bit buggy, capable
      of returning an emulator that didn't match the passed domain type. Fix
      up the test suite input to continue to pass.
      747761a7
    • C
      caps: Add virCapabilitiesDomainDataLookup · a6936523
      Cole Robinson 提交于
      This is a helper function to look up all capabilities data for all
      the OS bits that are relevant to <domain>. This is
      
      - os type
      - arch
      - domain type
      - emulator
      - machine type
      
      This will be used to replace several functions in later commits.
      a6936523
    • C
      caps: Use an enum internally for ostype value · 4231485c
      Cole Robinson 提交于
      But the internal API stays the same, and we just convert the value as
      needed. Not useful yet, but this is the beginning step of using an enum
      for ostype throughout the code.
      4231485c
  5. 17 4月, 2015 1 次提交
    • M
      Introduce virNetDevBandwidthUpdateFilter · 176a95fd
      Michal Privoznik 提交于
      This is a simple wrapper around virNetDevBandwidthManipulateFilter() that
      will update the desired filter on an interface (usually a network bridge)
      with a new MAC address. Although, the MAC address in question usually
      refers to some other interface - the one that the filter is constructed
      for. Yeah, hard to parse. Thing is, our NATed network has a bridge where
      some part of QoS takes place. And vNICs from guests are plugged into
      the bridge. However, if a guest decides to change the MAC of its vNIC,
      the corresponding qemu process emits an event which we can use to
      update the QoS configuration based on the new MAC address.. However,
      our QoS hierarchy is currently not notified, therefore it falls apart.
      This function (when called in response to the aforementioned event)
      will update our QoS hierarchy and duct tape it together again.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      176a95fd
  6. 16 4月, 2015 1 次提交
  7. 15 4月, 2015 3 次提交
  8. 14 4月, 2015 1 次提交
  9. 10 4月, 2015 3 次提交
  10. 08 4月, 2015 1 次提交
  11. 07 4月, 2015 1 次提交
  12. 03 4月, 2015 1 次提交
    • E
      conf: Introduce virStoragePoolSaveState · 39b183b4
      Erik Skultety 提交于
      Introduce virStoragePoolSaveState to properly format the state XML in
      the same manner as virStoragePoolDefFormat, except for adding a
      <poolstate> ... </poolstate> around the definition. This is similar to
      virNetworkObjFormat used to save the live/active network information.
      39b183b4
  13. 02 4月, 2015 3 次提交
    • J
      Allocate virtio-serial addresses when starting a domain · 59033788
      Ján Tomko 提交于
      Instead of always using controller 0 and incrementing port number,
      respect the maximum port numbers of controllers and use all of them.
      
      Ports for virtio consoles are quietly reserved, but not formatted
      (neither in XML nor on QEMU command line).
      
      Also rejects duplicate virtio-serial addresses.
      https://bugzilla.redhat.com/show_bug.cgi?id=890606
      https://bugzilla.redhat.com/show_bug.cgi?id=1076708
      
      Test changes:
      * virtio-auto.args
        Filling out the port when just the controller is specified.
        switched from using
          maxport + 1
        to:
          first free port on the controller
      * virtio-autoassign.args
        Filling out the address when no <address> is specified.
        Started using all the controllers instead of 0, also discards
        the bus value.
      * xml -> xml output of virtio-auto
        The port assignment is no longer done as a part of XML parsing,
        so the unspecified values stay 0.
      59033788
    • J
      Add functions to track virtio-serial addresses · 16db8d2e
      Ján Tomko 提交于
      Create a sorted array of virtio-serial controllers.
      Each of the elements contains the controller index
      and a bitmap of available ports.
      
      Buses are not tracked, because they aren't supported by QEMU.
      16db8d2e
    • S
      conf: Rename virDomainHasDiskMirror and detect block jobs properly · ffe3d3e8
      Shanzhi Yu 提交于
      virDomainHasDiskMirror() currently detects only jobs that add the mirror
      elements. Since some operations like migration are interlocked by
      existing block jobs on the given domain the check needs to be
      instrumented to check regular jobs too.
      
      This patch renames virDomainHasDiskMirror to virDomainHasDiskBlockjob
      and adds an argument that allows to select that it returns true only for
      block copy jobs as those interlock making the domain persistent.
      
      Other two uses trigger on any block job type.
      Signed-off-by: NShanzhi Yu <shyu@redhat.com>
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      ffe3d3e8
  14. 27 3月, 2015 1 次提交
    • L
      util: netlink function to delete any network device · 0473b45c
      Laine Stump 提交于
      libvirt has always used the netlink RTM_DELLINK message to delete
      macvtap/macvlan devices, but it can actually be used to delete other
      types of network devices, such as bonds and bridges. This patch makes
      virNetDevMacVLanDelete() available as a generic function so it can
      intelligibly be called to delete these other types of interfaces.
      0473b45c
  15. 25 3月, 2015 5 次提交
    • P
      tests: qemuxml2xml: Test status XML formatting and parsing · 02f0f1cc
      Peter Krempa 提交于
      Recently we've fixed a bug where the status XML could not be parsed as
      the parser used absolute path XPath queries. This test enhancement tests
      all XML files used in the qemu-xml-2-xml test as a part of a status XML
      snippet to see whether they are parsed correctly. The status XML-2-XML is
      currently tested in 223 cases with this patch.
      02f0f1cc
    • P
      util: buffer: Add support for adding text blocks with indentation · 6ff59cbc
      Peter Krempa 提交于
      The current auto-indentation buffer code applies indentation only on
      complete strings. To allow adding a string containing newlines and
      having it properly indented this patch adds virBufferAddStr.
      6ff59cbc
    • J
      virThreadPool: Set thread worker name · d20f5dde
      Jiri Denemark 提交于
      Every thread created as a worker thread within a pool gets a name
      according to virThreadPoolJobFunc name.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      d20f5dde
    • J
      virThread: Set thread job · 55ebc93a
      Jiri Denemark 提交于
      Automatically assign a job to every thread created by virThreadCreate.
      The name of the virThreadFunc function passed to virThreadCreate is used
      as the job or worker name in case no name is explicitly passed.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      55ebc93a
    • J
      Add support for tracking thread jobs · 95695388
      Jiri Denemark 提交于
      Each thread can use a thread local variable to keep the name of a job
      which is currently running in the job.
      
      The virThreadJobSetWorker API is supposed to be called once by any
      thread which is used as a worker, i.e., it is waiting in a pool, woken
      up to do a job, and returned back to the pool.
      
      The virThreadJobSet/virThreadJobClear APIs are to be called at the
      beginning/end of each job.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      95695388
  16. 23 3月, 2015 4 次提交
    • P
      qemu: conf: Add support for memory device cold(un)plug · 96094fb2
      Peter Krempa 提交于
      Add a few helpers that allow to operate with memory device definitions
      on the domain config and use them to implement memory device coldplug in
      the qemu driver.
      96094fb2
    • P
      conf: Add interface to parse and format memory device information · 3e4230d2
      Peter Krempa 提交于
      This patch adds code that parses and formats configuration for memory
      devices.
      
      A simple configuration would be:
      <memory model='dimm'>
        <target>
          <size unit='KiB'>524287</size>
          <node>0</node>
        </target>
      </memory>
      
      A complete configuration of a memory device:
      <memory model='dimm'>
        <source>
          <pagesize unit='KiB'>4096</pagesize>
          <nodemask>1-3</nodemask>
        </source>
        <target>
          <size unit='KiB'>524287</size>
          <node>1</node>
        </target>
      </memory>
      
      This patch preemptively forbids use of the <memory> device in individual
      drivers so the users are warned right away that the device is not
      supported.
      3e4230d2
    • P
      conf: Add support for parsing and formatting max memory and slot count · bffb9163
      Peter Krempa 提交于
      Add a XML element that will allow to specify maximum supportable memory
      and the count of memory slots to use with memory hotplug.
      
      To avoid possible confusion and misuse of the new element this patch
      also explicitly forbids the use of the maxMemory setting in individual
      drivers's post parse callbacks. This limitation will be lifted when the
      support is implemented.
      bffb9163
    • M
      network_conf: Drop virNetworkObjIsDuplicate · d9706aea
      Michal Privoznik 提交于
      This function does not make any sense now, that network driver is
      (almost) dropped. I mean, previously, when threads were
      serialized, this function was there to check, if no other network
      with the same name or UUID exists. However, nowadays that threads
      can run more in parallel, this function is useless, in fact it
      gives misleading return values. Consider the following scenario.
      Two threads, both trying to define networks with same name but
      different UUID (e.g. because it was generated during XML parsing
      phase, whatever). Lets assume that both threads are about to call
      networkValidate() which immediately calls
      virNetworkObjIsDuplicate().
      
      T1: calls virNetworkObjIsDuplicate() and since no network with
      given name or UUID exist, success is returned.
      T2: calls virNetworkObjIsDuplicate() and since no network with
      given name or UUID exist, success is returned.
      
      T1: calls virNetworkAssignDef() and successfully places its
      network into the virNetworkObjList.
      T2: calls virNetworkAssignDef() and since network with the same
      name exists, the network definition is replaced.
      
      Okay, this is mainly because virNetworkAssignDef() does not check
      whether name and UUID matches. Well, lets make it so! And drop
      useless function too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      d9706aea
  17. 20 3月, 2015 1 次提交
  18. 18 3月, 2015 2 次提交
  19. 16 3月, 2015 5 次提交