Re: [PATCH 3/4] vz: fix notification subscription

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



28.01.2016 18:38, Mikhail Feoktistov пишет:
Bug cause:
Update the domain that is subscribed to hypervisor notification.
LoadDomain() rewrites notifications fields in vzDomObj structure and makes domain as "unsubscribed".
Fix:
Initialize notification fields in vzDomObj only if we create a new domain.
And do not reinitialize these fields if we update domain (by calling LoadDomain with olddom argument)
---
  src/vz/vz_sdk.c | 13 ++++++-------
  1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 40ab2d9..6fb2a97 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1270,6 +1270,12 @@ prlsdkLoadDomain(vzConnPtr privconn,
      if (!olddom) {
          if (VIR_ALLOC(pdom) < 0)
              goto error;
+        pdom->cache.stats = PRL_INVALID_HANDLE;
+        pdom->cache.count = -1;
+        if (virCondInit(&pdom->cache.cond) < 0) {
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("cannot initialize condition"));
+            goto error;
+        }
      } else {
          pdom = olddom->privateData;
      }
@@ -1281,13 +1287,6 @@ prlsdkLoadDomain(vzConnPtr privconn,
def->id = -1; - pdom->cache.stats = PRL_INVALID_HANDLE;
-    pdom->cache.count = -1;
-    if (virCondInit(&pdom->cache.cond) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("cannot initialize condition"));
-        goto error;
-    }
-
      if (prlsdkGetDomainIds(sdkdom, &def->name, def->uuid) < 0)
          goto error;
Actually I'm not sure this patch is necessary at all as soon as you rewrite this function in the next patch.
The problem you are fixing could be just mentioned there.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]