1. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  2. 01 5月, 2013 1 次提交
  3. 30 4月, 2013 1 次提交
    • P
      network: Don't remove transient network if creating of config file fails · 8e918900
      Peter Krempa 提交于
      On the off-chance that creation of persistent configuration file would
      fail when defining a network that is already started as transient, the
      code would remove the transient data structure and thus the network.
      
      This patch changes the code so that in such case, the network is again
      marked as transient and left behind.
      8e918900
  4. 27 4月, 2013 2 次提交
    • L
      conf: remove extraneous _TYPE from driver backend enums · 19635f7d
      Laine Stump 提交于
      This isn't strictly speaking a bugfix, but I realized I'd gotten a bit
      too verbose when I chose the names for
      VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_*. This shortens them all a bit.
      19635f7d
    • L
      network: support <driver name='vfio'/> in network definitions · d64e114f
      Laine Stump 提交于
      I remembered to document this bit, but somehow forgot to implement it.
      
      This adds <driver name='kvm|vfio'/> as a subelement to the <forward>
      element of a network (this puts it parallel to the match between
      mode='hostdev' attribute in a network and type='hostdev' in an
      <interface>).
      
      Since it's already documented, only the parser, formatter, backend
      driver recognition (it just translates/moves the flag into the
      <interface> at the appropriate time), and a test case were needed.
      
      (I used a separate enum for the values both because the original is
      defined in domain_conf.h, which is unavailable from network_conf.h,
      and because in the future it's possible that we may want to support
      other non-hostdev oriented driver names in the network parser; this
      makes sure that one can be expanded without the other).
      d64e114f
  5. 26 4月, 2013 1 次提交
    • L
      conf: put hostdev pci address in a struct · 9f80fc1b
      Laine Stump 提交于
      There will soon be other items related to pci hostdevs that need to be
      in the same part of the hostdevsubsys union as the pci address (which
      is currently a single member called "pci". This patch replaces the
      single member named pci with a struct named pci that contains a single
      member named "addr".
      9f80fc1b
  6. 24 4月, 2013 3 次提交
  7. 19 4月, 2013 1 次提交
    • P
      network: bridge_driver: don't lose transient networks on daemon restart · 446dd66b
      Peter Krempa 提交于
      Until now tranisent networks weren't really useful as libvirtd wasn't
      able to remember them across restarts. This patch adds support for
      loading status files of transient networks (that already were generated)
      so that the status isn't lost.
      
      This patch chops up virNetworkObjUpdateParseFile and turns it into
      virNetworkLoadState and a few friends that will help us to load status
      XMLs and refactors the functions that are loading the configs to use
      them.
      446dd66b
  8. 18 4月, 2013 1 次提交
  9. 17 4月, 2013 1 次提交
    • O
      cleanup: Remove the duplicate header · bc95be5d
      Osier Yang 提交于
      Detected by a simple Shell script:
      
      for i in $(git ls-files -- '*.[ch]'); do
          awk 'BEGIN {
              fail=0
          }
          /# *include.*\.h/{
              match($0, /["<][^">]*[">]/)
              arr[substr($0, RSTART+1, RLENGTH-2)]++
          }
          END {
              for (key in arr) {
                  if (arr[key] > 1) {
                      fail=1
                      printf("%d %s\n", arr[key], key)
                  }
              }
              if (fail == 1)
                  exit 1
          }' $i
      
          if test $? != 0; then
              echo "Duplicate header(s) in $i"
          fi
      done;
      
      A later patch will add the syntax-check to avoid duplicate
      headers.
      bc95be5d
  10. 11 3月, 2013 1 次提交
    • M
      bandwidth: Require network QoS if interface uses 'floor' · f3fb916d
      Michal Privoznik 提交于
      By current implementation, network inbound is required in order
      to use 'floor' for guaranteeing  minimal throughput. This is so,
      because we want user to tell us the maximal throughput of the
      network instead of finding out ourselves (and detect bogus values
      in case of virtual interfaces). However, we are nowadays
      requiring this only on documentation level. So if user starts a
      domain with 'floor' set on one its interfaces, we silently ignore
      the setting. We should error out instead.
      f3fb916d
  11. 27 2月, 2013 1 次提交
  12. 25 2月, 2013 1 次提交
    • G
      use client id for IPv6 DHCP host definition · 0b73a763
      Gene Czarcinski 提交于
      Originally, only a host name was used to associate a
      DHCPv6 request with a specific IPv6 address.  Further testing
      demonstrates that this is an unreliable method and, instead,
      a client-id or DUID needs to be used.  According to DHCPv6
      standards, this id can be a duid-LLT, duid-LL, or duid-UUID
      even though dnsmasq will accept almost any text string.
      
      Although validity checking of a specified string makes sure it is
      hexadecimal notation with bytes separated by colons, there is no
      rigorous check to make sure it meets the standard.
      
      Documentation and schemas have been updated.
      Signed-off-by: NGene Czarcinski <gene@czarc.net>
      Signed-off-by: NLaine Stump <laine@laine.org>
      0b73a763
  13. 23 2月, 2013 1 次提交
  14. 20 2月, 2013 3 次提交
  15. 06 2月, 2013 2 次提交
  16. 22 1月, 2013 1 次提交
  17. 18 1月, 2013 3 次提交
    • J
      network: Remove dead code getting, but not using ipdef · 7d31dd64
      John Ferlan 提交于
      The fetch of 'ipdef' in networkRefreshDhcpDaemon() when the loop to fill
      in ipv4def fails to find an ipv4 address with dhcp defined. The filled in
      ipdef value was not used.  Code was made unnecessary with commit it 2d5cd1.
      7d31dd64
    • L
      network: use bandwidth from portgroup when appropriate · 7d480a46
      Laine Stump 提交于
      The bandwidth plug and unplug functions were assuming that an
      interface's bandwidth setting was always specified directly in the
      domain's <interface> definition, but that's not necessarily true - it
      could have been obtained from a <portgroup> definition in the network
      definition. This patch fixes those functions to use
      virDomainNetGetActualBandwidth(), which gets the bandwidth pointer
      from iface->data.network.actual if it exists, otherwise returns
      iface->bandwidth.
      7d480a46
    • J
      network: Resolve some issues around vlan copying · 35ed25bd
      John Ferlan 提交于
      Remove extraneous check for 'netdef' when dereferencing for vlan.nTags.
      Prior code would already check if netdef was NULL.
      
      Coverity complained about a path where the 'vlan' was potentially valid,
      but a prior checks may not have allocated 'iface->data.network.actual',
      so like other paths it needs to be allocated on the fly.
      
      Move the copying of vlan up earlier in networkAllocateActualDevice, so
      that actual.type gets properly set.
      
      Since the first assignment to vlan is redundant except in the case of
      jumping immediately to validate from the start of the function,
      eliminate its initial setting at the top of the function in favor of
      calling the helper function virDomainNetGetActualVlan() (which doesn't
      depend on the local vlan pointer being initialized) down at validate:
      Signed-off-by: NLaine Stump <laine@redhat.com>
      35ed25bd
  18. 11 1月, 2013 2 次提交
  19. 21 12月, 2012 10 次提交
  20. 18 12月, 2012 2 次提交
    • L
      network: don't require private addresses if dnsmasq uses SO_BINDTODEVICE · 4b31da34
      Laine Stump 提交于
      This is yet another refinement to the fix for CVE-2012-3411:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=833033
      
      It turns out that it would be very intrusive to correctly backport the
      entire --bind-dynamic option to older dnsmasq versions
      (e.g. dnsmasq-2.48 that is used on RHEL6.x and CentOS 6.x), but very
      simple to patch those versions to just use SO_BINDTODEVICE on all
      their listening sockets (SO_BINDTODEVICE also has the desired effect
      of permitting only traffic that was received on the interface(s) where
      dnsmasq was set to listen.)
      
      This patch modifies the dnsmasq capabilities detection to detect the
      string:
      
          --bind-interfaces with SO_BINDTODEVICE
      
      in the output of "dnsmasq --version", and in that case realize that
      using the old --bind-interfaces option is just as safe as
      --bind-dynamic (and therefore *not* forbid creation of networks that
      use public IP address ranges).
      
      If -bind-dynamic is available, it is still preferred over
      --bind-interfaces.
      
      Note that this patch does no harm in upstream, or in any distro's
      downstream if it happens to end up there, but builds for distros that
      have a new enough dnsmasq to support --bind-dynamic do *NOT* need to
      specifically backport this patch; it's only required for distro
      releases that have dnsmasq too old to have --bind-dynamic (and those
      distros will need to add the SO_BINDTODEVICE patch to dnsmasq,
      *including the extra string in the --version output*, as well.
      4b31da34
    • L
      network: fix indentation of networkDnsmasqConfContents · bc5b270c
      Laine Stump 提交于
      Somehow I managed to push the changes to this file with improper
      indentation. This patch just re-indents, reformats the comment lines,
      and re-groups a couple of multi-line strings so that they fit within
      80 columns. The resulting binary should be identical.
      bc5b270c
  21. 15 12月, 2012 1 次提交
    • L
      network: fix (non)update of dnsmasq config during virDomainUpdateDeviceFlags · e3802e13
      Laine Stump 提交于
      A forgotten "!" in recently-modified code at the top of
      networkRefreshDaemon() meant an improper early return, which led to 1)
      dnsmasq config files not being updated from the newly modified config,
      and 2) dnsmasq not being sent a SIGHUP so that it could learn about
      the changes to the config.
      
      virNetworkDefGetIpByIndex() returns NULL if there are no ip objects of
      the requested type, and if there are no IP elements, then dnsmasq
      shouldn't be running, so we can return early. Otherwise we should
      rewrite the config files and send a SIGHUP.
      e3802e13