1. 26 9月, 2012 15 次提交
  2. 25 9月, 2012 8 次提交
  3. 24 9月, 2012 4 次提交
  4. 22 9月, 2012 5 次提交
    • L
      network: log error for unknown virNetworkUpdate command codes · 5cdcb75d
      Laine Stump 提交于
      Every level of the code for virNetworkUpdate was assuming that some
      other level was checking for validity of the "command" arg, but none
      actually were. The result was that an invalid command code would do
      nothing, but also report success.
      
      Since the command code isn't used until the very lowest level backend
      functions, that's where I put the check. I made a separate one-line
      function to log the error. The compiler would have combined the
      identical strings used by multiple calls if I'd just called
      virReportError directly in each location, but sending them all to the
      same string in the source guards against inadvertant divergence (which
      would lead to extra work for translators.)
      5cdcb75d
    • L
      network: make virNetworkObjUpdate error detection/recovery better · f59e25e0
      Laine Stump 提交于
      1) virNetworkObjUpdate should be an all or none operation, but in the
      case that we want to update both the live state and persistent config
      versions of the network, it was committing the update to the live
      state before starting to update the persistent config. If update of
      the persistent config failed, we would leave with things in an
      inconsistent state - the live state would be updated (even though an
      error was returned), but persistent config unchanged.
      
      This patch changed virNetworkObjUpdate to use a separate pointer for
      each copy of the virNetworkDef, and not commit either of them in the
      virNetworkObj until both live and config parts of the update have
      successfully completed.
      
      2) The parsers for various pieces of the virNetworkDef have all sorts
      of subtle limitations on them that may not be known by the
      Update[section] function, making it possible for one of these
      functions to make a modification directly to the object that may not
      pass the scrutiny of a subsequent parse. But normally another parse
      wouldn't be done on the data until the *next* time the object was
      updated (which could leave the network definition in an unusable
      state).
      
      Rather than fighting the losing battle of trying to duplicate all the
      checks from the parsers into the update functions as well, the more
      foolproof solution to this is to simply do an extra
      virNetworkDefCopy() operation on the updated networkdef -
      virNetworkDefCopy() does a virNetworkFormat() followed by a
      virNetworkParseString(), so it will do all the checks we need. If this
      fails, then we don't commit the changed def.
      f59e25e0
    • 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
    • M
      Drop unused return value of virLogOutputFunc · fca338a0
      Miloslav Trmač 提交于
      Nothing uses the return value, and creating it requries otherwise
      unnecessary strlen () calls.
      
      This cleanup is conceptually independent from the rest of the series
      (although the later patches won't apply without it).  This just seems
      a good opportunity to clean this up, instead of entrenching the unnecessary
      return value in the virLogOutputFunc instance that will be added in this
      series.
      Signed-off-by: NMiloslav Trmač <mitr@redhat.com>
      fca338a0
    • T
      Remove redundant lines in src/qemu/qemu_driver.c · 9ce64e6a
      Tang Chen 提交于
      maxcpu and hostcpus are defined and calculated in qemudDomainPinVcpuFlags()
      and qemudDomainPinEmulator(), but never used. So remove them including nodeinfo.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      9ce64e6a
  5. 21 9月, 2012 8 次提交