Hi~

On 02/07/2012 01:52 AM, Chris Evich wrote:
> Rather than lock the code into the implementation details of particular
> virsh options, just code for the minimum necessary.  However, expose
> a set of free-form variables tests can use to exercize more specific
> options.
> 
OK, that will solve the compatibility problems.

> +    # Rely on test-code to verify guest state on receiving-end
> +    # Assume success unless proven otherwise
But here, migrate command needs users to input a password when connecting to 
destination host, such as a ssh password.
Do we need to implement it as an auto-login function ?

> +    migrate_cmd = "migrate " + migrate_cmd
> +    logging.debug("Mirating VM with command: virsh %s" % migrate_cmd)
>      try:
> -        cmd = "virsh %s %s" % (uri_arg, migrate_cmd)
> -        session = aexpect.ShellSession(cmd, linesep="\n")
> -        virt_utils._remote_login(session, destuser, destpwd, "", timeout=60)
> -        return True
> -    # If migration succeeds, migrate command will terminate the session
> -    # automically. So we have to catch the LoginProcessTerminatedError.
> -    except virt_utils.LoginProcessTerminatedError, e:
> -        logging.info("%s", e)
> -        session.close()
> -        if str(e).find("status: 0") >= 0:
> -            return True
> -        else:
> -            return False
> -    except error.CmdError:
> -        logging.error("Migrating VM %s failed", name)
> +        virsh_cmd(migrate_cmd, uri)
> +    except error.CmdError, defail:
> +        logging.warning("Migration error: %s" % (detail))
>          return False
> +    return True


-- 
Best Regards,
Tang chen
--------------------------------------------------
Tang Chen
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
No.6 Wenzhu Road, Nanjing, 210012, China 
TEL: +86+25-86630566-8527
FUJITSU INTERNAL: 7998-8527
FAX: +86+25-83317685
EMail: [email protected]
--------------------------------------------------
This communication is for use by the intended recipient(s) only and may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If you are not an intended recipient of this communication, you 
are hereby notified that any dissemination, distribution or copying hereof is 
strictly prohibited.  If you have received this communication in error, please 
notify me by reply e-mail, permanently delete this communication from your 
system, and destroy any hard copies you may have printed

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to