[libvirt] [PATCH 5/5] Implement virDomainMigrateSetDowntime in qemu driver

Jiri Denemark jdenemar at redhat.com
Tue Mar 16 13:48:40 UTC 2010


Actually there is a type in text monitor...

> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index 7a263cb..b259452 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -1088,6 +1088,35 @@ int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon,
>  }
>  
>  
> +int qemuMonitorJSONSetMigrationDowntime(qemuMonitorPtr mon,
> +                                        unsigned long long downtime)
> +{
> +    int ret;
> +    char *downtimestr;
> +    virJSONValuePtr cmd;
> +    virJSONValuePtr reply = NULL;
> +    if (virAsprintf(&downtimestr, "%llun", downtime) < 0) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +    cmd = qemuMonitorJSONMakeCommand("migrate_set_downtime",
> +                                     "s:value", downtimestr,
> +                                     NULL);
...
> diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
> index b7c41a1..99f1180 100644
> --- a/src/qemu/qemu_monitor_text.c
> +++ b/src/qemu/qemu_monitor_text.c
> @@ -999,6 +999,33 @@ cleanup:
>  }
>  
>  
> +int qemuMonitorTextSetMigrationDowntime(qemuMonitorPtr mon,
> +                                        unsigned long long downtime)
> +{
> +    char *cmd = NULL;
> +    char *info = NULL;
> +    int ret = -1;
> +
> +    if (virAsprintf(&cmd, "migrate_set_downtime %llu", downtime) < 0) {
> +        virReportOOMError();
> +        goto cleanup;
> +    }

Here, we should tell qemu we're giving it time in nanoseconds just like we do
in json monitor. I have a fixed version but I'll wait for changes possibly
required by reviewers.

Jirka




More information about the libvir-list mailing list