1. 07 7月, 2016 1 次提交
  2. 02 7月, 2016 2 次提交
    • L
      lxc: support setting host-side IP addresses/routes · 18792027
      Laine Stump 提交于
      (This patch had been pushed earlier in
      commit cd5c9f21, but was reverted in
      commit 1549f168 because it had been
      accidentally pushed during the freeze for release 2.0.0)
      18792027
    • L
      util: new function virNetDevIPInfoAddToDev · 95309424
      Laine Stump 提交于
      This patch takes the code out of
      lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
      IP routes to the interface, and puts it into a utility function
      virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
      anyone.
      
      One small change in functionality -
      lxcContainerRenameAndEnableInterfaces() previously would add all IP
      addresses to the interface while it was still offline, then set the
      interface online, and then add the routes. Because I don't want the
      utility function to set the interface online, I've moved this up so
      the interface is first set online, then IP addresses and routes are
      added. This is the same order that the network service from
      initscripts (in ifup-ether) does it, so it shouldn't pose any problem
      (and hasn't, in the tests that I've run).
      
      (This patch had been pushed earlier in commit
      f1e0d0da, but was reverted in commit
      05eab475 because it had been
      accidentally pushed during the freeze for release 2.0.0)
      95309424
  3. 27 6月, 2016 12 次提交
    • J
      Revert "util: new function virNetDevIPInfoAddToDev" · 05eab475
      Ján Tomko 提交于
      This reverts commit f1e0d0da.
      
      This feature was accidentally pushed in the feature freeze.
      05eab475
    • J
      Revert "lxc: support setting host-side IP addresses/routes" · 1549f168
      Ján Tomko 提交于
      This reverts commit cd5c9f21.
      
      This feature was accidentally pushed in the feature freeze.
      1549f168
    • L
      lxc: support setting host-side IP addresses/routes · cd5c9f21
      Laine Stump 提交于
      cd5c9f21
    • L
      util: new function virNetDevIPInfoAddToDev · f1e0d0da
      Laine Stump 提交于
      This patch takes the code out of
      lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
      IP routes to the interface, and puts it into a utility function
      virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
      anyone.
      
      One small change in functionality -
      lxcContainerRenameAndEnableInterfaces() previously would add all IP
      addresses to the interface while it was still offline, then set the
      interface online, and then add the routes. Because I don't want the
      utility function to set the interface online, I've moved this up so
      the interface is first set online, then IP addresses and routes are
      added. This is the same order that the network service from
      initscripts (in ifup-ether) does it, so it shouldn't pose any problem
      (and hasn't, in the tests that I've run).
      f1e0d0da
    • L
      lxc: move debug/error log when adding IP addresses to virNetDevIPAddrAdd · 4ff9ec7d
      Laine Stump 提交于
      It makes more sense to have the logging at the lower level so other
      callers can share the goodness.
      
      While removing so much stuff from / touching so many lines in
      lxcContainerRenameAndEnableInterfaces() (which used to have this
      debug/error logging), label names were changed and it was updated to
      use the now-more-common method of initializing ret to -1 (failure),
      then setting to 0 right before the cleanup label.
      4ff9ec7d
    • L
      conf: use virNetDevIPInfo for guest-side <interface> config · fbc1843d
      Laine Stump 提交于
      All the same information was already there, just in slightly different
      places in the virDomainNetDef.
      fbc1843d
    • L
      conf: use virNetDevIPInfo in virDomainHostdevCaps · 69e04044
      Laine Stump 提交于
      a.k.a. <hostdev mode='capabilities' type='net'>.
      
      This replaces the existing nips, ips, nroutes, and routes with a
      single virNetDevIPInfo, and simplifies the code by calling that
      object's parse/format/clear functions instead of open coding.
      69e04044
    • L
      util: move IP route & address object-related functions to virnetdevip.c · fa18e814
      Laine Stump 提交于
      These functions all need to be called from a utility function that
      must be located in the util directory, so we move them all into
      util/virnetdevip.[ch] now that it exists.
      
      Function and struct names were appropriately changed for the new
      location, but all code is unchanged aside from motion and renaming.
      fa18e814
    • L
      util: new files virnetdevip.[ch] for IP-related netdev functions · cf0568b0
      Laine Stump 提交于
      This patch splits virnetdev.[ch] into multiple files, with the new
      virnetdevip.[ch] containing all the functions related to setting and
      retrieving IP-related info for a device (both addresses and routes).
      cf0568b0
    • L
      lxc: use correct prefix when setting veth IP address · 70a2c7e0
      Laine Stump 提交于
      Commit c9a641 (first appearred in 1.2.12) added support for setting
      the guest-side IP address of veth devices in lxc domains.
      Unfortunately, it hardcoded the assumption that the proper prefix for
      any IP address with no explicit prefix in the config should be "24";
      that is only correct for class C IPv4 addresses, but not for any other
      IPv4 address, nor for any IPv6 address.
      
      The good news is that there is already a function in libvirt that will
      determine the proper default prefix for any IP address. This patch
      replaces the use of the ill-fated VIR_SOCKET_ADDR_DEFAULT_PREFIX with
      calls to virSocketAddrGetIPPrefix().
      70a2c7e0
    • L
      lxc: eliminate extraneous free of netDef->ifname_guest · f03a4a2a
      Laine Stump 提交于
      lxcContainerRenameAndEnableInterfaces() isn't making a copy of the
      interface's ifname_guest (into newname), it's just copying the pointer
      to it. This means that when it later calls VIR_FREE(newname), it's
      actually freeing up (and fortunately NULLing out, so at least we don't
      try to access free'd memory) netDef->ifname_guest.
      f03a4a2a
    • L
      global: consistently use IP rather than Ip in identifiers · 22a6873a
      Laine Stump 提交于
      I'm tired of mistyping this all the time, so let's do it the same all
      the time (similar to how we changed all "Pci" to "PCI" awhile back).
      
      (NB: I've left alone some things in the esx and vbox drivers because
      I'm unable to compile them and they weren't obviously *not* a part of
      some API. I also didn't change a couple of variables named,
      e.g. "somethingIptables", because they were derived from the name of
      the "iptables" command)
      22a6873a
  4. 20 6月, 2016 1 次提交
  5. 17 6月, 2016 1 次提交
  6. 10 6月, 2016 5 次提交
  7. 08 6月, 2016 9 次提交
  8. 07 6月, 2016 2 次提交
  9. 06 6月, 2016 2 次提交
    • J
      Do not check for domain liveness in virDomainObjSetDefTransient · 8c40ede4
      Ján Tomko 提交于
      Remove the live attribute and mark the definition as transient
      whether the domain is runing or not.
      
      There were only two callers left calling with live=false:
      * testDomainStartState, where the domain already is active
        because we assigned vm->def->id just a few lines above the call
      * virDomainObjGetPersistentDef, which now only calls
        virDomainObjSetDefTransient for an active domain
      8c40ede4
    • J
      Clean up redundant usage of virDomainObjSetDefTransient · 9b111048
      Ján Tomko 提交于
      Commit 45ec297d from November 2010:
          Make state driver device hotplug/update actually transient
      added virDomainObjSetDefTransient calls to the domain startup
      function in several drivers.
      
      In November 2011, commit 8866eed0:
          Set aliases for LXC/UML console devices
      added a call earlier in the startup function, without removing the
      existing ones.
      
      Also, in the UML driver it seems the function never did anything
      useful - vm->def->id is set asynchronnously in umlNotifyEvent.
      At the time of calling virDomainObjSetDefTransient with live=false,
      vm->def->id was likely still -1, making the call a no-op.
      9b111048
  10. 03 6月, 2016 1 次提交
    • M
      Fix building with -Og · 3470cd86
      Martin Kletzander 提交于
      When building using -Og, gcc sees that some variables can be used
      uninitialized  It can be debatable whether it is possible with our
      codeflow, but functions should be self-contained and initializations are
      always good.  The return instead of goto is due to actualType being used
      in the cleanup.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      3470cd86
  11. 27 5月, 2016 1 次提交
  12. 25 5月, 2016 3 次提交
    • P
      conf: Change virDomainCputune member 'shares' to unsigned long long · e6e14468
      Peter Krempa 提交于
      cgroup functions set and get the longer type so use it everywhere
      e6e14468
    • J
      lxc: Fix lxcDomainDestroyFlags endjob processing · cb0159df
      John Ferlan 提交于
      Commit id '15ccb0db' added job functions for the lxc driver; however,
      for shutdown and nonpersistent path, the vm was removed from the domain
      object list and the vm pointer cleared before the endjob.
      
      Adjust the code to perform the endjob first and then perform the
      ObjListRemove as long as the vm wasn't NULL. This follows more closely
      models from qemu and libxl
      
      Found by Coverity (FORWARD_NULL)
      cb0159df
    • L
      lxc: support <interface type='ethernet'> · 002b7704
      Laine Stump 提交于
      This is identical to type='bridge', but without the "connect to a
      bridge" part, so it can be handled by using the same functions (and
      often even the same cases in switch statements), after renaming
      virLXCProcessSetupInterfaceBridged() to virLXCProcessInterfaceTap()
      and enhancing it to skip bridge-related items when brname == NULL.
      
      To be truly useful, we need to support setting the ip address on the
      host side veth as well as guest side veth (already supported for
      type='bridge'), as well as setting the peer address for both.
      
      The <script> element (supported by type='ethernet' in qemu) isn't
      supported in this patch. An error is logged at domain start time if it
      is encountered. This may be changed in a later patch.
      002b7704