Commit b462bf5d authored by Aurélien Dunand's avatar Aurélien Dunand
Browse files

Fix title update on stopped VM

Close: #4
parent a2ad3b63
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -149,9 +149,11 @@ class VirtualMachine(object):
    @title.setter
    def title(self, value):
        try:
            tags = libvirt.VIR_DOMAIN_AFFECT_CONFIG
            if self._state != 'stopped':
                tags = tags | libvirt.VIR_DOMAIN_AFFECT_LIVE
            self.lv_dom.setMetadata(libvirt.VIR_DOMAIN_METADATA_TITLE, value,
                None, None, (libvirt.VIR_DOMAIN_AFFECT_LIVE |
                libvirt.VIR_DOMAIN_AFFECT_CONFIG))
                                    None, None, tags)
        except AttributeError:
            raise NotImplementedError('This hv doesn\'t handle VM titles')
        else: