1. 20 10月, 2012 1 次提交
    • L
      network: free/null newDef if network fails to start · 78fab277
      Laine Stump 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=866364
      
      pointed out a crash due to virNetworkObjAssignDef free'ing
      network->newDef without NULLing it afterward. A fix for this is in
      upstream commit b7e92024. While the
      NULLing of newDef was a legitimate fix, newDef should have already
      been empty (NULL) anyway (as indicated in the comment that was deleted
      by that commit).
      
      The reason that newDef had a non-NULL value (i.e. the root cause) was
      that networkStartNetwork() had failed after populating
      network->newDef, but then neglected to free/NULL newDef in the
      cleanup.
      
      (A bit of background here: network->newDef should contain the
      persistent config of a network when a network is active (and of course
      only when it is persisten), and NULL at all other times. There is also
      a network->def which should contain the persistent definition of the
      network when it is inactive, and the current live state at all other
      times. The idea is that you can make changes to network->newDef which
      will take effect the next time the network is restarted, but won't
      mess with the current state of the network (virDomainObj has a similar
      pair of virDomainDefs that behave in the same fashion). Personally I
      think there should be a network->live and network->config, and the
      location of the persistent config should *always* be in
      network->config, but that's for a later cleanup).
      
      Since I love things to be symmetric, I created a new function called
      virNetworkObjUnsetDefTransient(), which reverses the effects of
      virNetworkObjSetDefTransient(). I don't really like the name of the
      new function, but then I also didn't really like the name of the old
      one either (it's just named that way to match a similar function in
      the domain conf code).
      78fab277
  2. 15 10月, 2012 2 次提交
    • E
      maint: drop spurious semicolons · 2cfa14bc
      Eric Blake 提交于
      Detected with:
      git grep ';;$' -- '**/*.[ch]'
      
      * src/network/bridge_driver.c (networkRadvdConfContents): Fix
      harmless typo.
      * src/phyp/phyp_driver.c (phypUUIDTable_Pull): Likewise.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDriveDel):
      Likewise.
      2cfa14bc
    • L
      conf: fix virDevicePCIAddressEqual args · 31094559
      Laine Stump 提交于
      This function really should have been taking virDevicePCIAddress*
      instead of the inefficient virDevicePCIAddress (results in copying two
      entire structs onto the stack rather than just two pointers), and
      returning a bool true/false (not matching is not necessarily a
      "failure", as a -1 return would imply, and also using "if
      (!virDevicePCIAddressEqual(x, y))" to mean "if x == y" is just a bit
      counterintuitive).
      31094559
  3. 28 9月, 2012 1 次提交
    • B
      network: fix dnsmasq/radvd binding to IPv6 on recent kernels · db488c79
      Benjamin Cama 提交于
      I hit this problem recently when trying to create a bridge with an IPv6
      address on a 3.2 kernel: dnsmasq (and, further, radvd) would not bind to
      the given address, waiting 20s and then giving up with -EADDRNOTAVAIL
      (resp. exiting immediately with "error parsing or activating the config
      file", without libvirt noticing it, BTW). This can be reproduced with (I
      think) any kernel >= 2.6.39 and the following XML (to be used with
      "virsh net-create"):
      
              <network>
                <name>test-bridge</name>
                <bridge name='testbr0' />
                <ip family='ipv6' address='fd00::1' prefix='64'>
                </ip>
              </network>
      
      (it happens even when you have an IPv4, too)
      
      The problem is that since commit [1] (which, ironically, was made to
      “help IPv6 autoconfiguration”) the linux bridge code makes bridges
      behave like “real” devices regarding carrier detection. This makes the
      bridges created by libvirt, which are started without any up devices,
      stay with the NO-CARRIER flag set, and thus prevents DAD (Duplicate
      address detection) from happening, thus letting the IPv6 address flagged
      as “tentative”. Such addresses cannot be bound to (see RFC 2462), so
      dnsmasq fails binding to it (for radvd, it detects that "interface XXX
      is not RUNNING", thus that "interface XXX does not exist, ignoring the
      interface" (sic)). It seems that this behavior was enhanced somehow with
      commit [2] by avoiding setting NO-CARRIER on empty bridges, but I
      couldn't reproduce this behavior on my kernel. Anyway, with the “dummy
      tap to set MAC address” trick, this wouldn't work.
      
      To fix this, the idea is to get the bridge's attached device to be up so
      that DAD can happen (deactivating DAD altogether is not a good idea, I
      think). Currently, libvirt creates a dummy TAP device to set the MAC
      address of the bridge, keeping it down. But even if we set this device
      up, it is not RUNNING as soon as the tap file descriptor attached to it
      is closed, thus still preventing DAD. So, we must modify the API a bit,
      so that we can get the fd, keep the tap device persistent, run the
      daemons, and close it after DAD has taken place. After that, the bridge
      will be flagged NO-CARRIER again, but the daemons will be running, even
      if not happy about the device's state (but we don't really care about
      the bridge's daemons doing anything when no up interface is connected to
      it).
      
      Other solutions that I envisioned were:
            * Keeping the *-nic interface up: this would waste an fd for each
              bridge during all its life. May be acceptable, I don't really
              know.
            * Stop using the dummy tap trick, and set the MAC address directly
              on the bridge: it is possible since quite some time it seems,
              even if then there is the problem of the bridge not being
              RUNNING when empty, contrary to what [2] says, so this will need
              fixing (and this fix only happened in 3.1, so it wouldn't work
              for 2.6.39)
            * Using the --interface option of dnsmasq, but I saw somewhere
              that it's not used by libvirt for backward compatibility. I am
              not sure this would solve this problem, though, as I don't know
              how dnsmasq binds itself to it with this option.
      
      This is why this patch does what's described earlier.
      
      This patch also makes radvd start even if the interface is
      “missing” (i.e. it is not RUNNING), as it daemonizes before binding to
      it, and thus sometimes does it after the interface has been brought down
      by us (by closing the tap fd), and then originally stops. This also
      makes it stop yelling about it in the logs when the interface is down at
      a later time.
      
      [1]
      http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=1faa4356a3bd89ea11fb92752d897cff3a20ec0e
      [2]
      http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=b64b73d7d0c480f75684519c6134e79d50c1b341
      db488c79
  4. 22 9月, 2012 1 次提交
    • L
      network: don't "refresh" iptables rules on rule-less networks · 36ba0ee7
      Laine Stump 提交于
      The bridge driver implementation of virNetworkUpdate() removes and
      re-adds iptables rules any time a network has an <ip>, <forward>, or
      <forward>/<interface> element updated. There are some types of
      networks that have those elements and yet have no iptables rules
      associated with them, and unfortunately the functions that remove/add
      iptables rules don't check the type of network before attempting to
      remove/add the rules, sometimes leading to an erroneous failure of the
      entire update operation.
      
      Under normal circumstances I would refactor the lower level functions
      to be more robust, but to avoid code churn as much as possible, I've
      just added extra checks directly to networkUpdate().
      36ba0ee7
  5. 21 9月, 2012 1 次提交
  6. 18 9月, 2012 5 次提交
    • M
      virNetDevBandwidthClear: Improve error handling · 2f678bb1
      Martin Kletzander 提交于
      Two changes are introduced in this patch:
      
       - The first change removes ATTRIBUTE_RETURN_CHECK from
         virNetDevBandwidthClear, because it was called with ignore_value
         always, anyway. The function is used even when it's not necessary
         to call it, just for cleanup purposes.
      
       - The second change is added ignoring of the command's exit status,
         since it may report an error even when run just as "to be sure we
         clean up" function. No libvirt errors are suppresed by this.
      2f678bb1
    • L
      network: restart radvd/dnsmasq if needed when libvirtd is restarted · 4cf974b6
      Laine Stump 提交于
      A user on IRC had accidentally killed all of his libvirt-started
      dnsmasq instances (due to a buggy dnsmasq service script in Fedora
      16), and had hoped that libvirtd would notice this on restart and
      reload all the dnsmasq daemons (as it does with iptables
      rules). Unfortunately this was not the case - as long as the network
      object had a pid registered for dnsmasq and/or radvd, it assumed that
      the processes were running.
      
      This patch takes advantage of the new utility functions in
      bridge_driver.c to do a "refresh" of all radvd and dnsmasq processes
      started by libvirt each time libvirtd is restarted - this function
      attempts to do a SIGHUP of each existing process, and if that fails,
      it restarts the process, rebuilding all the associated config files
      and commandline parameters in the process. This normally has no
      effect, but will be useful in solving the occasional "odd situation"
      without needing to take the drastic step of destroying/re-starting the
      network.
      4cf974b6
    • L
      network: implement virNetworkUpdate for bridge_driver · cd331650
      Laine Stump 提交于
      Call the network_conf function that modifies the live/persistent/both
      config, then refresh/restart dnsmasq/radvd if necessary, and finally
      save the config in the proper place(s).
      
      This patch also needed to uncomment a few utility functions that were
      added inside #if 0 in the previous commit (to avoid compiler errors
      due to unreferenced static functions).
      cd331650
    • L
      network: reorganize dnsmasq and radvd config file / startup · 1ce4922e
      Laine Stump 提交于
      This patch splits the starting of dnsmasq and radvd into multiple
      files, and adds new networkRefreshXX() and networkRestartXX()
      functions for each. These new functions are currently commented out
      because they won't be used until the next commit, and the compile options
      require all static functions to be used.
      
      networkRefreshXX() - rewrites any file-based config for dnsmasq/radvd,
      and sends SIGHUP to the process to make it reread its config. If the
      program isn't already running, it's just started.
      
      networkRestartXX() - kills the given program, waits for it to exit
      (see the comments in the function networkKillDaemon()), then calls
      networkStartXX().
      
      This commit is here mostly as a checkpoint to verify no change in
      functional behavior after refactoring networkStartXX() functions to
      fit in with these new functions.
      1ce4922e
    • L
      network: utility functions for updating network config · f36309d6
      Laine Stump 提交于
      These new functions are highly inspired by those in domain_conf.c (but
      not identical), and are intended to make it simpler to update the
      various combinations of live/persistent network configs.
      
      The network driver wasn't previously as careful about the separation
      between the live "status" in network->def and the persistent "config"
      in network->newDef (or sometimes in network->def). This series
      attempts to remedy some of that, but probably doesn't go all the way
      (enough to get these functions working and enable continued work on
      virNetworkUpdate though).
      
      bridge_driver.c and test_driver.c were updated in a few places to take
      advantage of the new functions and/or account for changes in argument
      lists.
      f36309d6
  7. 11 9月, 2012 1 次提交
  8. 07 9月, 2012 1 次提交
  9. 24 8月, 2012 1 次提交
    • L
      network: fix virtual network bridge delay setting · ddf1ccb7
      Laine Stump 提交于
      libvirt's network config documents that a bridge's STP "forward delay"
      (called "delay" in the XML) should be specified in seconds, but
      virNetDevBridgeSetSTPDelay() assumes that it is given a delay in
      milliseconds (although the comment at the top of the function
      incorrectly says "seconds".
      
      This fixes the comment, and converts the delay to milliseconds before
      calling virNetDevBridgeSetSTPDelay().
      ddf1ccb7
  10. 23 8月, 2012 2 次提交
  11. 22 8月, 2012 1 次提交
    • T
      network: use firewalld instead of iptables, when available · bf156385
      Thomas Woerner 提交于
      * configure.ac, spec file: firewalld defaults to enabled if dbus is
        available, otherwise is disabled. If --with_firewalld is explicitly
        requested and dbus is not available, configure will fail.
      
      * bridge_driver: add dbus filters to get the FirewallD1.Reloaded
        signal and DBus.NameOwnerChanged on org.fedoraproject.FirewallD1.
        When these are encountered, reload all the iptables reuls of all
        libvirt's virtual networks (similar to what happens when libvirtd is
        restarted).
      
      * iptables, ebtables: use firewall-cmd's direct passthrough interface
        when available, otherwise use iptables and ebtables commands. This
        decision is made once the first time libvirt calls
        iptables/ebtables, and that decision is maintained for the life of
        libvirtd.
      
      * Note that the nwfilter part of this patch was separated out into
        another patch by Stefan in V2, so that needs to be revised and
        re-reviewed as well.
      
      ================
      
      All the configure.ac and specfile changes are unchanged from Thomas'
      V3.
      
      V3 re-ran "firewall-cmd --state" every time a new rule was added,
      which was extremely inefficient.  V4 uses VIR_ONCE_GLOBAL_INIT to set
      up a one-time initialization function.
      
      The VIR_ONCE_GLOBAL_INIT(x) macro references a static function called
      vir(Ip|Eb)OnceInit(), which will then be called the first time that
      the static function vir(Ip|Eb)TablesInitialize() is called (that
      function is defined for you by the macro). This is
      thread-safe, so there is no chance of any race.
      
      IMPORTANT NOTE: I've left the VIR_DEBUG messages in these two init
      functions (one for iptables, on for ebtables) as VIR_WARN so that I
      don't have to turn on all the other debug message just to see
      these. Even if this patch doesn't need any other modification, those
      messages need to be changed to VIR_DEBUG before pushing.
      
      This one-time initialization works well. However, I've encountered
      problems with testing:
      
      1) Whenever I have enabled the firewalld service, *all* attempts to
      call firewall-cmd from within libvirtd end with firewall-cmd hanging
      internally somewhere. This is *not* the case if firewall-cmd returns
      non-0 in response to "firewall-cmd --state" (i.e. *that* command runs
      and returns to libvirt successfully.)
      
      2) If I start libvirtd while firewalld is stopped, then start
      firewalld later, this triggers libvirtd to reload its iptables rules,
      however it also spits out a *ton* of complaints about deletion failing
      (I suppose because firewalld has nuked all of libvirt's rules). I
      guess we need to suppress those messages (which is a more annoying
      problem to fix than you might think, but that's another story).
      
      3) I noticed a few times during this long line of errors that
      firewalld made a complaint about "Resource Temporarily
      unavailable. Having libvirtd access iptables commands directly at the
      same time as firewalld is doing so is apparently problematic.
      
      4) In general, I'm concerned about the "set it once and never change
      it" method - if firewalld is disabled at libvirtd startup, causing
      libvirtd to always use iptables/ebtables directly, this won't cause
      *terrible* problems, but if libvirtd decides to use firewall-cmd and
      firewalld is later disabled, libvirtd will not be able to recover.
      bf156385
  12. 18 8月, 2012 4 次提交
  13. 17 8月, 2012 1 次提交
  14. 16 8月, 2012 1 次提交
    • L
      network: make network driver vlan-aware · 4eb4c6fa
      Laine Stump 提交于
      The network driver now looks for the vlan element in network and
      portgroup objects, and logs an error at network define time if a vlan
      is requested for a network type that doesn't support it. (Currently
      vlan configuration is only supported for openvswitch networks, and
      networks used to do hostdev assignment of SR-IOV VFs.)
      
      At runtime, the three potential sources of vlan information are
      examined in this order: interface, chosen portgroup, network, and the
      first that is non-empty is used.  Another check for valid network type
      is made at this time, since the interface may have requested a vlan (a
      legal thing to have in the interface config, since it's not known
      until runtime if the chosen network will actually support it).
      
      Since we must also check for domains requesting vlans for unsupported
      connection types even if they are type='network', and since
      networkAllocateActualDevice() is being called in exactly the correct
      places, and has all of the necessary information to check, I slightly
      modified the logic of that function so that interfaces that aren't
      type='network' don't just return immediately. Instead, they also
      perform all the same validation for supported features. Because of
      this, it's not necessary to make this identical check in the other
      three places that would normally require it: 1) qemu domain startup,
      2) qemu device hotplug, 3) lxc domain startup.
      
      This can be seen as a first step in consolidating network-related
      functionality into the network driver, rather than having copies of
      the same code spread around in multiple places; this will make it
      easier to split the network parts off into a separate daemon, as we've
      discussed recently.
      4eb4c6fa
  15. 15 8月, 2012 5 次提交
    • L
      network: add connections counter to networks · 300bcdb6
      Laine Stump 提交于
      Just as each physical device used by a network has a connections
      counter, now each network has a connections counter which is
      incremented once for each guest interface that connects using this
      network.
      
      The count is output in the live network XML, like this:
      
         <network connections='20'>
         ...
         </network>
      
      It is read-only, and for informational purposes only - it isn't used
      internally anywhere by libvirt.
      300bcdb6
    • L
      network: change cleanup: to success/cleanup/error: in network*() functions · 4fee4e05
      Laine Stump 提交于
      A later patch will be adding a counter that will be
      incremented/decremented each time an guest interface starts/stops
      using a particular network. For this to work, all types of networks
      need to go through a common return sequence rather than returning
      early. To setup for this, a new success: label is added (when
      necessary), a new error: label is added which does any cleanup
      necessary only for error returns and then does goto cleanup, and early
      returns are changed to goto error if it's a failure, or goto success
      if it's successful. This way the intent of all the gotos is
      unambiguous, and a successful return path never encounters the
      "error:" label.
      4fee4e05
    • L
      conf: rename interface "usageCount" to "connections" · 643feae7
      Laine Stump 提交于
      I want to include this count in the xml output of networks, but
      calling it "connections" in the XML sounds better than "usageCount", and it
      would be better if the name in the XML matched the variable name.
      
      In a few places, usageCount was being initialized to 0, but this is
      unnecessary, because VIR_ALLOC_N zero-fills everything anyway.
      643feae7
    • L
      network: merge relevant virtualports rather than choosing one · 6a3691b7
      Laine Stump 提交于
      One of the original ideas behind allowing a <virtualport> in an
      interface definition as well as in the <network> definition *and*one
      or more <portgroup>s within the network, was that guest-specific
      parameteres (like instanceid and interfaceid) could be given in the
      interface's virtualport, and more general things (portid, managerid,
      etc) could be given in the network and/or portgroup, with all the bits
      brought together at guest startup time and combined into a single
      virtualport to be used by the guest. This was somehow overlooked in
      the implementation, though - it simply picks the "most specific"
      virtualport, and uses the entire thing, with no attempt to merge in
      details from the others.
      
      This patch uses virNetDevVPortProfileMerge3() to combine the three
      possible virtualports into one, then uses
      virNetDevVPortProfileCheck*() to verify that the resulting virtualport
      type is appropriate for the type of network, and that all the required
      attributes for that type are present.
      
      An example of usage is this: assuming a <network> definitions on host
      ABC of:
      
        <network>
          <name>testA</name>
          ...
          <virtualport type='openvswitch'/>
          ...
          <portgroup name='engineering'>
            <virtualport>
              <parameters profileid='eng'/>
            </virtualport>
          </portgroup>
          <portgroup name='sales'>
            <virtualport>
              <parameters profileid='sales'/>
            </virtualport>
          </portgroup>
        </network>
      
      and the same <network> on host DEF of:
      
        <network>
          <name>testA</name>
          ...
          <virtualport type='802.1Qbg'>
            <parameters typeid="1193047" typeidversion="2"/>
          </virtualport>
          ...
          <portgroup name='engineering'>
            <virtualport>
              <parameters managerid="11"/>
            </virtualport>
          </portgroup>
          <portgroup name='sales'>
            <virtualport>
              <parameters managerid="55"/>
            </virtualport>
          </portgroup>
        </network>
      
      and a guest <interface> definition of:
      
        <interface type='network'>
          <source network='testA' portgroup='sales'/>
          <virtualport>
            <parameters instanceid="09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f"
                        interfaceid="09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f"\>
          </virtualport>
          ...
        </interface>
      
      If the guest was started on host ABC, the <virtualport> used would be:
      
        <virtualport type='openvswitch'>
          <parameters interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'
                      profileid='sales'/>
        </virtualport>
      
      but if that guest was started on host DEF, the <virtualport> would be:
      
          <virtualport type='802.1Qbg'>
            <parameters instanceid="09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f"
                        typeid="1193047" typeidversion="2"
                        managerid="55"/>
          </virtualport>
      
      Additionally, if none of the involved <virtualport>s had a specified type
      (this includes cases where no virtualport is given at all),
      6a3691b7
    • L
      conf: move virtPortProfile out of unions in virDomainNetDef · 1d174428
      Laine Stump 提交于
      virtPortProfile is now used by 4 different types of network devices
      (NETWORK, BRIDGE, DIRECT, and HOSTDEV), and it's getting cumbersome to
      replicate so much code in 4 different places just because each type
      has the virtPortProfile in a slightly different place. This patch puts
      a single virtPortProfile in a common place (outside the type-specific
      union) in both virDomainNetDef and virDomainActualNetDef, and adjusts
      the parse and format code (and the few other places where it is used)
      accordingly.
      
      Note that when a <virtualport> element is found, the parse functions
      verify that the interface is of a type that supports one, otherwise an
      error is generated (CONFIG_UNSUPPORTED in the case of <interface>, and
      INTERNAL in the case of <actual>, since the contents of <actual> are
      always generated by libvirt itself).
      1d174428
  16. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  17. 19 7月, 2012 2 次提交
  18. 17 7月, 2012 1 次提交
    • S
      Convert 'raw MAC address' usages to use virMacAddr · 387117ad
      Stefan Berger 提交于
      Introduce new members in the virMacAddr 'class'
      - virMacAddrSet: set virMacAddr from a virMacAddr
      - virMacAddrSetRaw: setting virMacAddr from raw 6 byte MAC address buffer
      - virMacAddrGetRaw: writing virMacAddr into raw 6 byte MAC address buffer
      - virMacAddrCmp: comparing two virMacAddr
      - virMacAddrCmpRaw: comparing a virMacAddr with a raw 6 byte MAC address buffer
      
      then replace raw MAC addresses by replacing
      
      - 'unsigned char *' with virMacAddrPtr
      - 'unsigned char ... [VIR_MAC_BUFLEN]' with virMacAddr
      
      and introduce usage of above functions where necessary.
      387117ad
  19. 28 6月, 2012 1 次提交
  20. 14 6月, 2012 1 次提交
    • L
      network: fully support/use VIR_NETWORK_XML_INACTIVE flag · 1f145b2f
      Laine Stump 提交于
      commit 52d064f4 added
      VIR_NETWORK_XML_INACTIVE in order to allow suppressing the
      auto-generated list of VFs in network definitions, and a --inactive
      flag to virsh net-dumpxml to take advantage of the flag. However, it
      missed out on two opportunities:
      
      1) Use INACTIVE to get the current config of the network as it
         exists on disk, rather than the currently active config.
      
      2) Add INACTIVE to the flags used for the virsh net-edit command, so
         that it won't include the forward-pool interfaces that were
         autogenerated, and so that a re-edit of the network prior to
         restarting it will show any other edits made since the last restart
         of the network. (prior to this patch, if you edited a network a 2nd
         time without restarting, all of the previous edits would magically
         disappear).
      
      In order to fit with the new #define-based generic edit function in
      virsh.c, a new function vshNetworkGetXMLDesc() was added. This
      function first tries to call virNetworkGetXMLDesc with the INACTIVE
      flag added, then retries without if the first attempt fails (in the
      manner expected when the server doesn't support it).
      1f145b2f
  21. 28 5月, 2012 1 次提交
  22. 14 5月, 2012 1 次提交
    • W
      Use XDG Base Directories instead of storing in home directory · 32a9aac2
      William Jon McCann 提交于
      As defined in:
      http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
      
      This offers a number of advantages:
       * Allows sharing a home directory between different machines, or
      sessions (eg. using NFS)
       * Cleanly separates cache, runtime (eg. sockets), or app data from
      user settings
       * Supports performing smart or selective migration of settings
      between different OS versions
       * Supports reseting settings without breaking things
       * Makes it possible to clear cache data to make room when the disk
      is filling up
       * Allows us to write a robust and efficient backup solution
       * Allows an admin flexibility to change where data and settings are stored
       * Dramatically reduces the complexity and incoherence of the
      system for administrators
      32a9aac2
  23. 09 3月, 2012 1 次提交
    • A
      Attach vm-id to Open vSwitch interfaces. · ac8bbdbd
      Ansis Atteka 提交于
      This patch will allow OpenFlow controllers to identify which interface
      belongs to a particular VM by using the Domain UUID.
      
      ovs-vsctl get Interface vnet0 external_ids
      {attached-mac="52:54:00:8C:55:2C", iface-id="83ce45d6-3639-096e-ab3c-21f66a05f7fa", iface-status=active, vm-id="142a90a7-0acc-ab92-511c-586f12da8851"}
      
      V2 changes:
      Replaced vm-uuid with vm-id. There was a discussion in Open vSwitch
      mailinglist that we should stick with the same DB key postfixes for the
      sake of consistency (e.g iface-id, vm-id ...).
      ac8bbdbd
  24. 03 3月, 2012 2 次提交
    • L
      util: combine bools in virNetDevTapCreateInBridgePort into flags · d1c31023
      Laine Stump 提交于
      With an additional new bool added to determine whether or not to
      discourage the use of the supplied MAC address by the bridge itself,
      virNetDevTapCreateInBridgePort had three booleans (well, 2 bools and
      an int used as a bool) in the arg list, which made it increasingly
      difficult to follow what was going on. This patch combines those three
      into a single flags arg, which not only shortens the arg list, but
      makes it more self-documenting.
      d1c31023
    • A
      util: centralize tap device MAC address 1st byte "0xFE" modification · c1b164d7
      Ansis Atteka 提交于
      When a tap device for a domain is created and attached to a bridge,
      the first byte of the tap device MAC address is set to 0xFE, while the
      rest is set to match the MAC address that will be presented to the
      guest as its network device MAC address. Setting this high value in
      the tap's MAC address discourages the bridge from using the tap
      device's MAC address as the bridge's own MAC address (Linux bridges
      always take on the lowest numbered MAC address of all attached devices
      as their own).
      
      In one case within libvirt, a tap device is created and attached to
      the bridge with the intent that its MAC address be taken on by the
      bridge as its own (this is used to assure that the bridge has a fixed
      MAC address to prevent network outages created by the bridge MAC
      address "flapping" as guests are started and stopped). In this case,
      the first byte of the mac address is *not* altered to 0xFE.
      
      In the current code, callers to virNetDevTapCreateInBridgePort each
      make the MAC address modification themselves before calling, which
      leads to code duplication, and also prevents lower level functions
      from knowing the real MAC address being used by the guest. The problem
      here is that openvswitch bridges must be informed about this MAC
      address, or they will be unable to pass traffic to/from the guest.
      
      This patch centralizes the location of the MAC address "0xFE fixup"
      into virNetDevTapCreateInBridgePort(), meaning 1) callers of this
      function no longer need the extra strange bit of code, and 2)
      bitNetDevTapCreateBridgeInPort itself now is called with the guest's
      unaltered MAC address, and can pass it on, unmodified, to
      virNetDevOpenvswitchAddPort.
      
      There is no other behavioral change created by this patch.
      c1b164d7
  25. 16 2月, 2012 1 次提交
    • A
      network: support Open vSwitch · df810046
      Ansis Atteka 提交于
      This patch allows libvirt to add interfaces to already
      existing Open vSwitch bridges. The following syntax in
      domain XML file can be used:
      
          <interface type='bridge'>
            <mac address='52:54:00:d0:3f:f2'/>
            <source bridge='ovsbr'/>
            <virtualport type='openvswitch'>
              <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d'/>
            </virtualport>
            <address type='pci' domain='0x0000' bus='0x00'
                                slot='0x03' function='0x0'/>
          </interface>
      
      or if libvirt should auto-generate the interfaceid use
      following syntax:
      
          <interface type='bridge'>
            <mac address='52:54:00:d0:3f:f2'/>
            <source bridge='ovsbr'/>
            <virtualport type='openvswitch'>
            </virtualport>
            <address type='pci' domain='0x0000' bus='0x00'
                                slot='0x03' function='0x0'/>
          </interface>
      
      It is also possible to pass an optional profileid. To do that
      use following syntax:
      
         <interface type='bridge'>
           <source bridge='ovsbr'/>
           <mac address='00:55:1a:65:a2:8d'/>
           <virtualport type='openvswitch'>
             <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d'
                         profileid='test-profile'/>
           </virtualport>
         </interface>
      
      To create Open vSwitch bridge install Open vSwitch and
      run the following command:
      
          ovs-vsctl add-br ovsbr
      df810046