From nobody Fri May 3 10:47:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629932975712776.2497186684898; Wed, 25 Aug 2021 16:09:35 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-322-c8WN6mtZPMWuUUJvtDrmYQ-1; Wed, 25 Aug 2021 19:09:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A94F7871805; Wed, 25 Aug 2021 23:09:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 889C660CC4; Wed, 25 Aug 2021 23:09:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6444A1819AC2; Wed, 25 Aug 2021 23:09:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PN9InX001931 for ; Wed, 25 Aug 2021 19:09:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id A133FFA757; Wed, 25 Aug 2021 23:09:18 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C4A9FA756 for ; Wed, 25 Aug 2021 23:09:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E3EBB967612 for ; Wed, 25 Aug 2021 23:09:14 +0000 (UTC) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-334-loD4HWsYP9eWz2csVfCuYA-1; Wed, 25 Aug 2021 19:09:12 -0400 Received: by mail-qv1-f54.google.com with SMTP id jv8so977724qvb.3 for ; Wed, 25 Aug 2021 16:09:12 -0700 (PDT) Received: from localhost (209-6-122-159.s2973.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [209.6.122.159]) by smtp.gmail.com with UTF8SMTPSA id q192sm1083787qka.93.2021.08.25.16.09.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 16:09:12 -0700 (PDT) X-MC-Unique: c8WN6mtZPMWuUUJvtDrmYQ-1 X-MC-Unique: loD4HWsYP9eWz2csVfCuYA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5TnJP8Zad/MZ3wYH/PAbNkknpcbEfjUJfl16cgHO6K8=; b=P0NSxnUuE3hexQhl9FfzQrv+bOg3WIQRmwP1OTPXV3s1ZUBvzUT193A54gc/hyNScI SD4ktqjVnB3u83RSGWGHilVb0gVpznMXwJaNy/KeHvPGr1FwYPIkOimeVee6/N0Im4Vl DY5+HuMz9VTujDFAHHiCcNnKMGJbwk6TZIk59E3RYaELZImL+H568cYPzlso7AwgZcru EMkU8Lvb1DVaTQRrBUq1fFpxWQhoBPpCgaWg9/bv4zrrh2Vfaw1eiBWOCYyk+dQE40RR iOysOzbsxdKrg5XeCpzz8KMFaURSbgCEbpsAJgVzaeT06HRSoOoKL9jf6j97/FPuR7Bo qWsA== X-Gm-Message-State: AOAM533OKW/LeYuX1liXi2s07F0DaD5JFutUIfEidqs4fAiPKtamhsQL alFpXyf3K2N6LPEgBru0S7J6Xt4Ckw== X-Google-Smtp-Source: ABdhPJwFfc4Oj0wZE3RhX+GHX/KlOlokS0RV7b1Guv2rP9jHarTRZQQlrhFo+oi0Xe+oYlyplOEp2g== X-Received: by 2002:ad4:4b61:: with SMTP id m1mr1206996qvx.32.1629932952339; Wed, 25 Aug 2021 16:09:12 -0700 (PDT) From: Masayoshi Mizuma To: libvir-list@redhat.com Subject: [PATCH] qemuProcessSetupDisksTransientHotplug: Add checking set-action capability Date: Wed, 25 Aug 2021 19:08:46 -0400 Message-Id: <20210825230846.9949-1-msys.mizuma@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Masayoshi Mizuma , Masayoshi Mizuma X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1629932977485100001 Content-Type: text/plain; charset="utf-8" From: Masayoshi Mizuma The VM is terminated abnormally when is set to the disk option and the qemu doesn't have set-action capability. # virsh start guest01 error: Failed to start domain 'guest01' error: internal error: qemu unexpectedly closed the monitor # Add checking the capability before system_reset QMP command is sent so that the VM can stop correctly when the qemu doesn't have the cap. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3b4af61bf8..4bedd04679 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7010,6 +7010,9 @@ qemuProcessSetupDisksTransientHotplug(virDomainObj *v= m, if (hasHotpluggedDisk) { int rc; =20 + if (!(virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION))) + return -1; + if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) return -1; =20 --=20 2.27.0