Commit 112b6e89 authored by Iustin Pop's avatar Iustin Pop

Merge branch 'stable-2.6' into devel-2.6

* stable-2.6:
  Improve error message when migration status fail
  Fix type error in kvm/GetMigrationStatus
  Fix PID file writing in Haskell daemons
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parents 22105827 4041a4e3
......@@ -196,14 +196,19 @@ parseArgs cmd options = do
parseOpts cmd_args cmd options
-- * Daemon-related functions
-- | PID file mode.
pidFileMode :: FileMode
pidFileMode = unionFileModes ownerReadMode ownerWriteMode
-- | PID file open flags.
pidFileFlags :: OpenFileFlags
pidFileFlags = defaultFileFlags { noctty = True, trunc = False }
-- | Writes a PID file and locks it.
_writePidFile :: FilePath -> IO Fd
_writePidFile path = do
fd <- createFile path pidFileMode
fd <- openFd path ReadWrite (Just pidFileMode) pidFileFlags
setLock fd (WriteLock, AbsoluteSeek, 0, 0)
my_pid <- getProcessID
_ <- fdWrite fd (show my_pid ++ "\n")
......
......@@ -8458,6 +8458,8 @@ class TLMigrateInstance(Tasklet):
self.feedback_fn("Migration failed, aborting")
self._AbortMigration()
self._RevertDiskStatus()
if not msg:
msg = "hypervisor returned failure"
raise errors.OpExecError("Could not migrate instance %s: %s" %
(instance.name, msg))
......
......@@ -1780,8 +1780,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
time.sleep(self._MIGRATION_INFO_RETRY_DELAY)
return objects.MigrationStatus(status=constants.HV_MIGRATION_FAILED,
info="Too many 'info migrate' broken answers")
return objects.MigrationStatus(status=constants.HV_MIGRATION_FAILED)
def BalloonInstanceMemory(self, instance, mem):
"""Balloon an instance memory to a certain value.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment