qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1 2/2] s390x/pv: Add support for asynchronous teardown for r


From: Thomas Huth
Subject: Re: [PATCH v1 2/2] s390x/pv: Add support for asynchronous teardown for reboot
Date: Tue, 3 Jan 2023 12:51:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 03/01/2023 12.48, Claudio Imbrenda wrote:
On Tue, 3 Jan 2023 12:27:32 +0100
Thomas Huth <thuth@redhat.com> wrote:

On 22/12/2022 16.04, Claudio Imbrenda wrote:
This patch adds support for the asynchronous teardown for reboot for
protected VMs.
[...]
+bool s390_pv_vm_try_disable_async(void)
+{
+    char tname[VCPU_THREAD_NAME_SIZE];
+    QemuThread *t;
+
+    if (!kvm_check_extension(kvm_state, KVM_CAP_S390_PROTECTED_ASYNC_DISABLE)) 
{
+        return false;
+    }
+    if (s390_pv_cmd(KVM_PV_ASYNC_CLEANUP_PREPARE, NULL) != 0) {
+        return false;
+    }
+
+    t = g_malloc0(sizeof(QemuThread));
+    snprintf(tname, VCPU_THREAD_NAME_SIZE, "async_unpr/KVM");
+
+    qemu_thread_create(t, tname, s390_pv_do_unprot_async_fn, NULL,
+                       QEMU_THREAD_DETACHED);

I think you could get along without the tname[] array here by simply passing
the string directly to qemu_thread_create() ?

ahh, you're right

maybe I should also pick a better name? in retrospect it looks quite
cryptic

Yes, please!

 Thomas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]