1. 27 7月, 2017 14 次提交
  2. 26 7月, 2017 15 次提交
  3. 25 7月, 2017 11 次提交
    • M
      Move machineName generation from virsystemd into domain_conf · eaf2c9f8
      Martin Kletzander 提交于
      It is more related to a domain as we might use it even when there is
      no systemd and it does not use any dbus/systemd functions.  In order
      not to use code from conf/ in util/ pass machineName in cgroups code
      as a parameter.  That also fixes a leak of machineName in the lxc
      driver and cleans up and de-duplicates some code.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      eaf2c9f8
    • M
      lxc: Make lxcProcessStop callable even without PID being available · aa0dfb91
      Martin Kletzander 提交于
      This way the function can work as a central point of clean-up code and
      we don't have to duplicate code.  And it works similarly to the qemu
      driver.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      aa0dfb91
    • M
      qemu: Save qemu driver in qemuDomainObjPrivateData · 2e6ecba1
      Martin Kletzander 提交于
      This way we can finally make it static and not use any externs anywhere.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      2e6ecba1
    • M
      conf: Pass config.priv to xmlopt->privateData.alloc · 6e6faf6d
      Martin Kletzander 提交于
      This will help us to get to some data more easily.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      6e6faf6d
    • J
      secret: Handle object list removal and deletion properly · 867bcc9c
      John Ferlan 提交于
      Rather than rely on virSecretObjEndAPI to make the final virObjectUnref
      after the call to virSecretObjListRemove, be more explicit by calling
      virObjectUnref and setting @obj to NULL for secretUndefine and in
      the error path of secretDefineXML. Calling EndAPI will end up calling
      Unlock on an already unlocked object which has indeteriminate results
      (usually an ignored error).
      
      The virSecretObjEndAPI will both Unref and Unlock the object; however,
      the virSecretObjListRemove would have already Unlock'd the object so
      calling Unlock again is incorrect. Once the virSecretObjListRemove
      is called all that's left is to Unref our interest since that's the
      corrollary to the virSecretObjListAdd which returned our ref interest
      plus references for each hash table in which the object resides. In math
      terms, after an Add there's 2 refs on the object (1 for the object and
      1 for the list). After calling Remove there's just 1 ref on the object.
      For the Add callers, calling EndAPI removes the ref for the object and
      unlocks it, but since it's in a list the other 1 remains.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      867bcc9c
    • J
      secret: Fix memory leak in virSecretLoad · d04bc027
      John Ferlan 提交于
      If the virSecretLoadValue fails, the code jumped to cleanup without
      setting @ret = obj, thus calling virSecretObjListRemove which only
      accounts for the object reference related to adding the object to
      the list during virSecretObjListAdd, but does not account for the
      reference to the object itself as the return of @ret would be NULL
      so the caller wouldn't call virSecretObjEndAPI on the object recently
      added thus reducing the refcnt to zero.
      
      This patch will perform the ObjListRemove in the failure path of
      virSecretLoadValue and Unref @obj in order to perform clean up
      and return @obj as NULL. The @def will be freed as part of the
      virObjectUnref.
      d04bc027
    • J
      secret: Properly handle @def after virSecretObjAdd in driver · e4c0aff2
      John Ferlan 提交于
      Since the virSecretObjListAdd technically consumes @def on success,
      the secretDefineXML should set @def = NULL immediately and process
      the remaining calls using a new @objDef variable. We can use use
      VIR_STEAL_PTR since we know the Add function just stores @def in
      obj->def.
      
      Because we steal @def into @objDef, if we jump to restore_backup:
      and @backup is set, then we need to ensure the @def would be
      free'd properly, so we'll steal it back from @objDef. For the other
      condition this fixes a double free of @def if the code had jumped to
      @backup == NULL thus calling virSecretObjListRemove without setting
      @def = NULL. In this case, the subsequent call to DefFree would
      succeed and free @def; however, the call to EndAPI would also
      call DefFree because the Unref done would be the last one for
      the @obj meaning the obj->def would be used to call DefFree,
      but it's already been free'd because @def wasn't managed right
      within this error path.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      e4c0aff2
    • J
      secret: Remove need for local configFile and base64File in ObjectAdd · 7ca17da9
      John Ferlan 提交于
      Rather than assign to a local variable, let's just assign directly to the
      object using the error path for cleanup.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      7ca17da9
    • M
      Revert "virthread: Introduce virRWLockInitPreferWriter" · 2d3c7122
      Michal Privoznik 提交于
      This reverts commit 328bd244.
      
      As it turns out, this is not portable and very Linux & glibc
      specific. Worse, this may lead to not starving writers on Linux
      but everywhere else. Revert this and if the starvation occurs
      resolve it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      2d3c7122
    • A
      conf: Rename virDomainControllerIsPCIHostBridge() to IsPSeriesPHB() · bbda2883
      Andrea Bolognani 提交于
      The original name didn't hint at the fact that PHBs are
      a pSeries-specific concept.
      Suggested-by: NPeter Krempa <pkrempa@redhat.com>
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      bbda2883
    • A
      conf: Fix backwards migration of pSeries guests · 9b45cd8f
      Andrea Bolognani 提交于
      Recent commits made it so that pci-root controllers for
      pSeries guests are automatically assigned the
      spapr-pci-host-bridge model name; however, that prevents
      guests to migrate to older versions of libvirt which don't
      know about that model name at all, which at the moment is
      all of them :)
      
      To avoid the issue, just strip the model name from PHBs
      when formatting the migratable XML; guests that use more
      than one PHB are not going to be migratable anyway.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      9b45cd8f