1. 19 6月, 2015 4 次提交
    • M
      virNetSocket: Fix @watch corner case · 9ee5a798
      Michal Privoznik 提交于
      Although highly unlikely, nobody says that virEventAddHandle()
      can't return 0 as a handle to socket callback. It can't happen
      with our default implementation since all watches will have value
      1 or greater, but users can register their own callback functions
      (which can re-use unused watch IDs for instance). If this is the
      case, weird things may happen.
      
      Also, there's a little bug I'm fixing too, upon
      virNetSocketRemoveIOCallback(), the variable holding callback ID
      was not reset. Therefore calling AddIOCallback() once again would
      fail. Not that we are doing it right now, but we might.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9ee5a798
    • M
      virNetSocketRemoveIOCallback: Be explicit about unref · 899e49a2
      Michal Privoznik 提交于
      When going through the code I've notice that
      virNetSocketAddIOCallback() increases the reference counter of
      @socket. However, its counter part RemoveIOCallback does not. It took
      me a while to realize this disproportion. The AddIOCallback registers
      our own callback which eventually calls the desired callback and then
      unref the @sock. Yeah, a bit complicated but it works. So, lets note
      this hard learned fact in a comment in RemoveIOCallback().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      899e49a2
    • M
      daemonSetupNetworking: Don't leak services · 058d18bd
      Michal Privoznik 提交于
      When setting up the daemon networking, new services are created. These
      services then have sockets to listen on. Once created, the service
      objects are added to corresponding server object. However, during that
      process, server increases reference counter of the service object. So,
      at the end of the function, we should decrease it again. This way the
      service objects will have only 1 reference, but that's okay since
      servers are the only objects having a reference.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      058d18bd
    • P
      lib: setvcpus: Remove bogus flag check · 1d0fc808
      Peter Krempa 提交于
      Since VIR_DOMAIN_AFFECT_CURRENT is 0 the flag check does not make sense
      as masking @flags with 0 will always equal to false.
      1d0fc808
  2. 18 6月, 2015 36 次提交