On Tue, Aug 14, 2012 at 9:47 AM, Vaclav Ehrlich <[email protected]> wrote:
> Hi Lucas,
> thank you for patch. I've copied the code into my branch and I've tried to
> run rv_connect, migration and rv_disconnect tests.
> This test fails during migration where clone.create(....) is called and it
> is before your patch . That's because spice port is the same.
>
> Problem is that spice port has to be changed during migration (on single
> host). Someone told me that this is not real life. But in our single host
> environment is.
> Without this single host migration will fail.

I don't understand. I have tested this on my machine and worked flawlessly.

>
> Vaclav
>
>
>
> On 08/13/2012 09:53 PM, Lucas Meneghel Rodrigues wrote:
>>
>> A spice client can be informed of a migration, so it
>> connects to the new vm automatically, keeping the
>> client connection alive during any number of migrations,
>> through a monitor command.
>>
>> This patch implements calling the appropriate command
>> (there are 3 different valid commands for RHEL userspace,
>> older upstream and current upstream qemu), for both
>> human monitor and qmp. This way it'll be possible to
>> create a test for spice seamless migration test (issue #158).
>>
>> Spice team, please take a look at this and provide feedback.
>>
>> Signed-off-by: Lucas Meneghel Rodrigues<[email protected]>
>> ---
>>   client/virt/kvm_vm.py | 43 +++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 43 insertions(+)
>>
>> diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
>> index 90f26fd..c1e5e74 100644
>> --- a/client/virt/kvm_vm.py
>> +++ b/client/virt/kvm_vm.py
>> @@ -2329,6 +2329,49 @@ class VM(virt_vm.BaseVM):
>>               error.context()
>>
>>           try:
>> +            if self.params["display"] == "spice":
>> +                dest_port = clone.spice_options['spice_port']
>> +                logging.debug("Informing migration to spice client")
>> +                commands = ["__com.redhat_spice_migrate_info",
>> +                            "spice_migrate_info",
>> +                            "client_migrate_info"]
>> +
>> +                if self.monitor.protocol == "human":
>> +                    out = self.monitor.cmd("help", debug=False)
>> +                    for command in commands:
>> +                        if "\n%s" % command in out:
>> +                            # spice_migrate_info requires dest_host,
>> dest_port
>> +                            if command in commands[:2]:
>> +                                command = "%s %s %s" % (command,
>> dest_host,
>> +                                                        dest_port)
>> +                            # client_migrate_info also requires protocol
>> +                            else:
>> +                                command = "%s %s %s %s" % (command,
>> +
>> self.params['display'],
>> +                                                         dest_host,
>> dest_port)
>> +                            break
>> +                    self.monitor.cmd(command)
>> +
>> +                elif self.monitor.protocol == "qmp":
>> +                    out = self.monitor.cmd_obj({"execute":
>> "query-commands"})
>> +                    for command in commands:
>> +                        if {'name': command} in out['return']:
>> +                            # spice_migrate_info requires dest_host,
>> dest_port
>> +                            if command in commands[:2]:
>> +                                command_dict = {"execute": command,
>> +                                                "arguments":
>> +                                                 {"hostname": dest_host,
>> +                                                  "port": dest_port}}
>> +                            # client_migrate_info also requires protocol
>> +                            else:
>> +                                command_dict = {"execute": command,
>> +                                                "arguments":
>> +                                            {"protocol":
>> self.params['display'],
>> +                                             "hostname": dest_host,
>> +                                             "port": dest_port}}
>> +                            break
>> +                    self.monitor.cmd_obj(command_dict)
>> +
>>               if protocol == "tcp":
>>                   if local:
>>                       uri = "tcp:0:%d" % clone.migration_port
>
>
> _______________________________________________
> Autotest-kernel mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/autotest-kernel



-- 
Lucas

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to