1. 30 6月, 2016 1 次提交
  2. 23 3月, 2015 3 次提交
    • P
      qemu: Implement memory device hotunplug · 3b289a81
      Peter Krempa 提交于
      Add code to hot-remove memory devices from qemu. Unfortunately QEMU
      doesn't support this right now, so this is just for completenes.
      3b289a81
    • P
      qemu: Implement memory device hotplug · 9b4654f6
      Peter Krempa 提交于
      Add code to hot-add memory devices to running qemu instances.
      9b4654f6
    • 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
  3. 19 3月, 2015 1 次提交
    • L
      util: clean up #includes of virnetdevopenvswitch.h · 451547a4
      Laine Stump 提交于
      virnetdevopenvswitch.h declares a few functions that can be called to
      add ports to and remove them from OVS bridges, and retrieve the
      migration data for a port. It does not contain any data definitions
      that are used by domain_conf.h. But for some reason, domain_conf.h
      virnetdevopenvswitch.h should be directly #including it. This adds a
      few lines to the project, but saves all the files that don't need it
      from the extra computing, and makes the dependencies more clear cut.
      451547a4
  4. 18 3月, 2015 2 次提交
  5. 16 3月, 2015 1 次提交
    • P
      conf: Replace access to def->mem.max_balloon with accessor functions · 4f9907cd
      Peter Krempa 提交于
      As there are two possible approaches to define a domain's memory size -
      one used with legacy, non-NUMA VMs configured in the <memory> element
      and per-node based approach on NUMA machines - the user needs to make
      sure that both are specified correctly in the NUMA case.
      
      To avoid this burden on the user I'd like to replace the NUMA case with
      automatic totaling of the memory size. To achieve this I need to replace
      direct access to the virDomainMemtune's 'max_balloon' field with
      two separate getters depending on the desired size.
      
      The two sizes are needed as:
      1) Startup memory size doesn't include memory modules in some
      hypervisors.
      2) After startup these count as the usable memory size.
      
      Note that the comments for the functions are future aware and document
      state that will be present after a few later patches.
      4f9907cd
  6. 06 3月, 2015 1 次提交
    • P
      memtune: change the way how we store unlimited value · cf521fc8
      Pavel Hrdina 提交于
      There was a mess in the way how we store unlimited value for memory
      limits and how we handled values provided by user.  Internally there
      were two possible ways how to store unlimited value: as 0 value or as
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED.  Because we chose to store memory
      limits as unsigned long long, we cannot use -1 to represent unlimited.
      It's much easier for us to say that everything greater than
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED means unlimited and leave 0 as valid
      value despite that it makes no sense to set limit to 0.
      
      Remove unnecessary function virCompareLimitUlong.  The update of test
      is to prevent the 0 to be miss-used as unlimited in future.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146539Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cf521fc8
  7. 26 2月, 2015 2 次提交
    • L
      qemu: fix ifindex array reported to systemd · 4bbe1029
      Laine Stump 提交于
      Commit f7afeddc added code to report to systemd an array of interface
      indexes for all tap devices used by a guest. Unfortunately it not only
      didn't add code to report the ifindexes for macvtap interfaces
      (interface type='direct') or the tap devices used by type='ethernet',
      it ended up sending "-1" as the ifindex for each macvtap or hostdev
      interface. This resulted in a failure to start any domain that had a
      macvtap or hostdev interface (or actually any type other than
      "network" or "bridge").
      
      This patch does the following with the nicindexes array:
      
      1) Modify qemuBuildInterfaceCommandLine() to only fill in the
      nicindexes array if given a non-NULL pointer to an array (and modifies
      the test jig calls to the function to send NULL). This is because
      there are tests in the test suite that have type='ethernet' and still
      have an ifname specified, but that device of course doesn't actually
      exist on the test system, so attempts to call virNetDevGetIndex() will
      fail.
      
      2) Even then, only add an entry to the nicindexes array for
      appropriate types, and to do so for all appropriate types ("network",
      "bridge", and "direct"), but only if the ifname is known (since that
      is required to call virNetDevGetIndex().
      4bbe1029
    • L
      network: only clear bandwidth if it has been set · 118b2408
      Laine Stump 提交于
      libvirt was unconditionally calling virNetDevBandwidthClear() for
      every interface (and network bridge) of a type that supported
      bandwidth, whether it actually had anything set or not. This doesn't
      hurt anything (unless ifname == NULL!), but is wasteful.
      
      This patch makes sure that all calls to virNetDevBandwidthClear() are
      qualified by checking that the interface really had some bandwidth
      setup done, and checks for a null ifname inside
      virNetDevBandwidthClear(), silently returning success if it is null
      (as well as removing the ATTRIBUTE_NONNULL from that function's
      prototype, since we can't guarantee that it is never null,
      e.g. sometimes a type='ethernet' interface has no ifname as it is
      provided on the fly by qemu).
      118b2408
  8. 13 2月, 2015 1 次提交
  9. 10 2月, 2015 2 次提交
  10. 28 1月, 2015 2 次提交
    • J
      hotplug: only add a chardev to vmdef after monitor call · 21e0e886
      Ján Tomko 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1161024
      
      This way the device is in vmdef only if ret = 0 and the caller
      (qemuDomainAttachDeviceFlags) does not free it.
      
      Otherwise it might get double freed by qemuProcessStop
      and qemuDomainAttachDeviceFlags if the domain crashed
      in monitor after we've added it to vm->def.
      21e0e886
    • J
      Split qemuDomainChrInsert into two parts · daf51be5
      Ján Tomko 提交于
      Do the allocation first, then add the actual device.
      The second part should never fail. This is good
      for live hotplug where we don't want to remove the device
      on OOM after the monitor command succeeded.
      
      The only change in behavior is that on failure, the
      vmdef->consoles array is freed, not just the first console.
      daf51be5
  11. 27 1月, 2015 2 次提交
  12. 19 1月, 2015 3 次提交
  13. 15 1月, 2015 1 次提交
  14. 14 1月, 2015 1 次提交
  15. 07 1月, 2015 1 次提交
  16. 06 1月, 2015 2 次提交
  17. 18 12月, 2014 2 次提交
  18. 17 12月, 2014 1 次提交
  19. 15 12月, 2014 3 次提交
  20. 14 12月, 2014 1 次提交
    • L
      qemu: add a qemuInterfaceStopDevices(), called when guest CPUs stop · c5a54917
      Laine Stump 提交于
      We now have a qemuInterfaceStartDevices() which does the final
      activation needed for the host-side tap/macvtap devices that are used
      for qemu network connections. It will soon make sense to have the
      converse qemuInterfaceStopDevices() which will undo whatever was done
      during qemuInterfaceStartDevices().
      
      A function to "stop" a single device has also been added, and is
      called from the appropriate place in qemuDomainDetachNetDevice(),
      although this is currently unnecessary - the device is going to
      immediately be deleted anyway, so any extra "deactivation" will be for
      naught. The call is included for completeness, though, in anticipation
      that in the future there may be some required action that *isn't*
      nullified by deleting the device.
      
      This patch is a part of a more complete fix for:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1081461
      c5a54917
  21. 11 12月, 2014 1 次提交
    • M
      network: Bring netdevs online later · 82977058
      Matthew Rosato 提交于
      Currently, MAC registration occurs during device creation, which is
      early enough that, during live migration, you end up with duplicate
      MAC addresses on still-running source and target devices, even though
      the target device isn't actually being used yet.
      This patch proposes to defer MAC registration until right before
      the guest can actually use the device -- In other words, right
      before starting guest CPUs.
      Signed-off-by: NMatthew Rosato <mjrosato@linux.vnet.ibm.com>
      Signed-off-by: NLaine Stump <laine@laine.org>
      82977058
  22. 10 12月, 2014 1 次提交
  23. 09 12月, 2014 1 次提交
    • L
      qemu: always use virDomainNetGetActualBridgeName to get interface's bridge · 4aae2ed6
      Laine Stump 提交于
      qemuNetworkIfaceConnect() used to have a special case for
      actualType='network' (a network with forward mode of route, nat, or
      isolated) to call the libvirt public API to retrieve the bridge being
      used by a network. That is no longer necessary - since all network
      types that use a bridge and tap device now get the bridge name stored
      in the ActualNetDef, we can just always use
      virDomainNetGetActualBridgeName() instead.
      
      (an audit of the two callers to qemuNetworkIfaceConnect() confirms
      that it is never called for any other type of network, so the dead
      code in the else statement (logging an internal error if it is called
      for any other type of network) is eliminated in the process.)
      4aae2ed6
  24. 03 12月, 2014 1 次提交
    • J
      Replace virNetworkFree with virObjectUnref · 121c09a9
      John Ferlan 提交于
      Since virNetworkFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      121c09a9
  25. 02 12月, 2014 1 次提交
    • J
      hotplug: Resolve Coverity FORWARD_NULL · 59802f23
      John Ferlan 提交于
      Coverity complained that because the cfg->macFilter call checked
      net->ifname != NULL before calling ebtablesRemoveForwardAllowIn, then
      the virNetDevOpenvswitchRemovePort call should have the same check.
      
      However, if I move the ebtables call prior to the check for TYPE_DIRECT
      (where there is a VIR_FREE(net->ifname)), then it seems Coverity is
      happy.  Since firewall info is tacked on last during setup, removing
      it in the opposite order of initialization seems to be natural anyway
      59802f23
  26. 01 12月, 2014 2 次提交