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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]