]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Don't update graphic definitions on password change failure
authorPeter Krempa <pkrempa@redhat.com>
Mon, 3 Sep 2012 14:52:27 +0000 (16:52 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 Sep 2012 14:52:27 +0000 (16:52 +0200)
When the password change failed we updated the graphic definition
anyways, which is not desired.

src/qemu/qemu_hotplug.c

index 1251d6bc091f600aa919fb69a46b793fdb4b4764..a8a904c24f0f363c6196c62b9fb36e28a84a43f4 100644 (file)
@@ -1517,6 +1517,8 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
                                                     VIR_DOMAIN_GRAPHICS_TYPE_VNC,
                                                     &dev->data.vnc.auth,
                                                     driver->vncPassword);
+            if (ret < 0)
+                return ret;
 
             /* Steal the new dev's  char * reference */
             VIR_FREE(olddev->data.vnc.auth.passwd);
@@ -1576,6 +1578,9 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
                                                     &dev->data.spice.auth,
                                                     driver->spicePassword);
 
+            if (ret < 0)
+                return ret;
+
             /* Steal the new dev's char * reference */
             VIR_FREE(olddev->data.spice.auth.passwd);
             olddev->data.spice.auth.passwd = dev->data.spice.auth.passwd;