From nobody Sun May 19 07:12:07 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1674485893; cv=none; d=zohomail.com; s=zohoarc; b=a18u6jN6FUZhmJ2iRuq585koC5ca55E1IMegmLDvv3JuEYAzc3TQvrHWt4nlMAasCvT6GrGhCKWjUopceouNL98xm3okTdGk7jC7ebOtm80RONepTks+dmtgXFGDpWkcq69hOIy4wNjpf8FLMf0RS/Anpc0CRt/aJdYihCa7gdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674485893; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DvuB0kXnuLtW87AuInoML5l2UjLEW2uxM7uwixiWgvg=; b=m5eM7wk0FkDmVqtDzuIkfJNZoPneKNPAOMKtJrTik2zYIAkFuSWw2WJVPsCkBtC6flRmu6YFtL1s44QoeaSpO6heEHGTLnzGscdAxZbwZD9wHm8ElajyoUc5pugFhTp3HWEAma+S3y3f+GxqmRngzcStiMVn1AVsMMYdyx0RbOM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1674485893592218.83033817688113; Mon, 23 Jan 2023 06:58:13 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-APzquN2dOOalwJgAdnTPFw-1; Mon, 23 Jan 2023 09:58:09 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D8D981C04B6C; Mon, 23 Jan 2023 14:58:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C55AB140EBF4; Mon, 23 Jan 2023 14:58:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D717D19465A8; Mon, 23 Jan 2023 14:58:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2279F194658D for ; Mon, 23 Jan 2023 14:58:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C781D492B02; Mon, 23 Jan 2023 14:58:01 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BFC60492B03 for ; Mon, 23 Jan 2023 14:58:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 A29D3101A52E for ; Mon, 23 Jan 2023 14:58:01 +0000 (UTC) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-315-v6GDuk4DN6iVrTecKiaAAw-1; Mon, 23 Jan 2023 09:57:59 -0500 Received: by mail-ej1-f72.google.com with SMTP id hp2-20020a1709073e0200b0084d47e3fe82so7831779ejc.8 for ; Mon, 23 Jan 2023 06:57:59 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o16-20020a170906769000b0087758f5ecd1sm8470848ejm.194.2023.01.23.06.57.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 06:57:57 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 864F6D1AD9BD for ; Mon, 23 Jan 2023 15:57:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674485892; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DvuB0kXnuLtW87AuInoML5l2UjLEW2uxM7uwixiWgvg=; b=A1QnQJdikdutKtMZEa5WU3WaG5TsOAcAle1+3fVGPTe/NdYwpJCG9wSwUhEfMyO3FqR8GS OVqlsIXeoWjumq5FynjJ9Aor8cFKpvpRe7E95Tj7Nk3xcp4gekE2Iq9WzO+zRoIg3zntTy T4XwL+uX1YcO4+oh9naBuT6DNPc6Qew= X-MC-Unique: APzquN2dOOalwJgAdnTPFw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: v6GDuk4DN6iVrTecKiaAAw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DvuB0kXnuLtW87AuInoML5l2UjLEW2uxM7uwixiWgvg=; b=JE9HYbyLWYOBFLyf8t0bBkbFaVNJxohjZWom940VSTvJFCToQ6QFzW4AwFKFot5Bk8 LaE6weYcOqoeaQuzC4wpgPl/E54dBIVmAdExVMhG+WC0w3n3VDemd5TeE2qaXc2i50w/ AIjlXcwcpFvNYy9aIb77OfcOPqR2j//MIftIrBa3ZRNrdF0Yvb+SnzAYm1rRTx1AgBvT aAVvpprsEJD09md/yBx/MUUNbDRdnWLyF/AYAAAdduNEwI8t+rfg1Vi7bWflXMC1N8Qe VIMz1OZcWPAXluionmE6M2j2ILj8WaQVvp7BR7gMCgX/9vPgrzTfWCOjP5qMgyyCSr7e G0dQ== X-Gm-Message-State: AFqh2kpHaiaAD8o5seDifV0mAsYC/0PcokE4/Q7ZyEqsM+IWkQqu3t3y 6oWjHnScA5mu4H07tLC773+AEKo2xFmayoMxTFDgU4X5rWKSF2fbQXaAFf/Raz5LuqzI0mA7SlS ORg5y45R+BwwrTF9NSme2zrIGA3GBSNJjViH6mcJFLRgsrE6N/6YbnWStlVUKQLFVMfEChcI= X-Received: by 2002:a17:906:1798:b0:84d:43e4:3633 with SMTP id t24-20020a170906179800b0084d43e43633mr24446525eje.36.1674485878686; Mon, 23 Jan 2023 06:57:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXtmsZprfqvmqVkv3VA8RJyX7iIlCvJOK9wMAX4Qib5anM/9pduAM0c7G9VL9sSLi+HBXvxcJw== X-Received: by 2002:a17:906:1798:b0:84d:43e4:3633 with SMTP id t24-20020a170906179800b0084d43e43633mr24446506eje.36.1674485878447; Mon, 23 Jan 2023 06:57:58 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 1/7] Avoid unnecessary nesting Date: Mon, 23 Jan 2023 15:57:50 +0100 Message-Id: <7d02f55d8f55f7bc13dade83975fc329ea947d17.1674485748.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1674485894403100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Martin Kletzander Reviewed-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 026e1ee5add7..1fa3cc3ea9b1 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2938,17 +2938,17 @@ qemuDomainAttachWatchdog(virDomainObj *vm, =20 qemuAssignDeviceWatchdogAlias(watchdog); =20 - if (watchdog->model =3D=3D VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) { - if (qemuDomainEnsurePCIAddress(vm, &dev) < 0) - goto cleanup; - releaseAddress =3D true; - } else { + if (watchdog->model !=3D VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("hotplug of watchdog of model %s is not supported= "), virDomainWatchdogModelTypeToString(watchdog->model)= ); goto cleanup; } =20 + if (qemuDomainEnsurePCIAddress(vm, &dev) < 0) + goto cleanup; + releaseAddress =3D true; + if (!(props =3D qemuBuildWatchdogDevProps(vm->def, watchdog))) goto cleanup; =20 --=20 2.39.1 From nobody Sun May 19 07:12:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1674485893; cv=none; d=zohomail.com; s=zohoarc; b=LjQJN1X/lzsGPGnb6wJI+IVyDlv5anVfDFW0/Y0ZUVT4f2xBPo+2MWq8kFfyYM9sy/Gp5RHYQ1lEHLJMQJXD67KQaM/XVexLsx8Bda6BnxeBFiln3rMKdpijRYrSEFnoAwbUxnI1yw3drAdEPisEtVf0E4lYHA3vuKD4XNIyhf0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674485893; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zL1FPKFu0ZBHAB/AxdzmU9E55rYcbkjKPV2R4ZBTDkQ=; b=CjRw3www9C1v2wc1hzt2uoNjS/GQksTSqJ/521z857EQZeHBYT1BagfEeq1ejKy8MdYSzyOTfY3pzfytMwTbVgHdMNEkk9DOKFsqqEmKW0zXKUsWXbmxyCHslrHAUnC9YTQdw+RDwhfGYQ1SZ+b9wFPZOp2xIFAbS421l3dLiBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1674485893821192.27778574587228; Mon, 23 Jan 2023 06:58:13 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-235-5qoI3QgZMluKwxONOoMinw-1; Mon, 23 Jan 2023 09:58:11 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B72A1C06913; Mon, 23 Jan 2023 14:58:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2DCD14171CA; Mon, 23 Jan 2023 14:58:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CBB5B19459C9; Mon, 23 Jan 2023 14:58:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0C4B01946A70 for ; Mon, 23 Jan 2023 14:58:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F1B0F492D0F; Mon, 23 Jan 2023 14:58:02 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9BF8492B03 for ; Mon, 23 Jan 2023 14:58:02 +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 C67D93C22747 for ; Mon, 23 Jan 2023 14:58:02 +0000 (UTC) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-466-8A4P73tCPY-LnCho9tMaSA-1; Mon, 23 Jan 2023 09:58:01 -0500 Received: by mail-ej1-f71.google.com with SMTP id wz4-20020a170906fe4400b0084c7e7eb6d0so7870749ejb.19 for ; Mon, 23 Jan 2023 06:58:00 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id sb25-20020a1709076d9900b0084c6581c16fsm22188903ejc.64.2023.01.23.06.57.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 06:57:58 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 91EDFD1AD9BE for ; Mon, 23 Jan 2023 15:57:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674485892; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zL1FPKFu0ZBHAB/AxdzmU9E55rYcbkjKPV2R4ZBTDkQ=; b=F3D1It7XeitLK+BqQsdhllz9xHYtF7Vp8WIRjbkHssR9c4WXjCpgLL6005L4cQQivGfdHT akZPA0jv9aZ0Vjp/NY/K3j3GXSdymjMnNJJ+O7u0JFprYnHupVEyFT2HAJgKGEj52BP3Vi Ta9k+/c6yECxBu3SruFLkEgtB5O2qXc= X-MC-Unique: 5qoI3QgZMluKwxONOoMinw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 8A4P73tCPY-LnCho9tMaSA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zL1FPKFu0ZBHAB/AxdzmU9E55rYcbkjKPV2R4ZBTDkQ=; b=SyXjxAQ8MXzHUkmE3vfXDsYJmy5lglH47GeYGxPa4HKvu6RarGoYwUm+EhZB3kaUow WEQHkBnNmzAtF42AdZqNKf2x9SMDXjbUHbnFnj4eabMIeDRK8tvfPhIyeS0nMwGE4XVD YMERxeNIIdQWNuEgZj1JFeDw3peppgrPFjQH4tQFAJhwNqtysulzFgUdCQE6IC5wrLfw X2kOf6vIGvvs4o74t6C+YGjhZp4Iv3i4Af+zPVq/G1yMfJG1gIEY/OlYWzPcItkDZ5BC 8w2rW7795jdIRsyGAo83FtrXkC1h2JlrfJUEqDAwKjtKXnzYE/dheQ58l2cTxb9VLMoU Qi8A== X-Gm-Message-State: AFqh2kq7QORM/RcJOAzpN+WMXL/8nib9+/l0P7v2AkaOW5mHk1hnTj6+ yoh4ipdeyjCBTZpdmEYYTR6mKe90Nbd93yjALKLHlbaeUAHakK1Z02TK+Zj8XAs3CtOuzaRM87S XxsNKC5NYwo15WjAzQGD7rBbPuLmSR+Q+UhWhHczxQyNN0h8hGxbjLj2A40g7Lgp/DA4oYiU= X-Received: by 2002:a17:907:a648:b0:854:6e3:2388 with SMTP id vu8-20020a170907a64800b0085406e32388mr28604505ejc.12.1674485879847; Mon, 23 Jan 2023 06:57:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtCFMVUDg+XkO4OmyKOVJWha0aEBjdBcEjtSX1RLbR5p3Wbu/uUZlbrLT2xRV+VtgXbvL5nhg== X-Received: by 2002:a17:907:a648:b0:854:6e3:2388 with SMTP id vu8-20020a170907a64800b0085406e32388mr28604485ejc.12.1674485879393; Mon, 23 Jan 2023 06:57:59 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 2/7] Support multiple watchdog devices Date: Mon, 23 Jan 2023 15:57:51 +0100 Message-Id: <6baaee45557dd3a66f4cea5e43b05cdcb3ad3c8d.1674485748.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1674485894485100002 Content-Type: text/plain; charset="utf-8"; x-default="true" This is already possible with qemu, and actually already happening with q35 machines and a specified watchdog since q35 already includes a watchdog we = do not include in the XML. In order to express such posibility multiple watch= dogs need to be supported. Signed-off-by: Martin Kletzander Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 82 +++++++++++++------ src/conf/domain_conf.h | 8 +- src/conf/schemas/domaincommon.rng | 4 +- src/libvirt_private.syms | 1 + src/qemu/qemu_alias.c | 26 ++++-- src/qemu/qemu_alias.h | 5 +- src/qemu/qemu_command.c | 24 ++++-- src/qemu/qemu_domain_address.c | 8 +- src/qemu/qemu_driver.c | 14 ++-- src/qemu/qemu_hotplug.c | 61 ++++++-------- src/qemu/qemu_process.c | 3 +- src/qemu/qemu_validate.c | 25 ++++++ .../watchdog-q35-multiple.x86_64-latest.args | 39 +++++++++ .../watchdog-q35-multiple.xml | 25 ++++++ tests/qemuxml2argvtest.c | 1 + .../watchdog-q35-multiple.x86_64-latest.xml | 50 +++++++++++ tests/qemuxml2xmltest.c | 1 + 17 files changed, 287 insertions(+), 90 deletions(-) create mode 100644 tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-lat= est.args create mode 100644 tests/qemuxml2argvdata/watchdog-q35-multiple.xml create mode 100644 tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-l= atest.xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 733399e6da0d..7c61da1d765b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3875,7 +3875,9 @@ void virDomainDefFree(virDomainDef *def) def->blkio.ndevices); g_free(def->blkio.devices); =20 - virDomainWatchdogDefFree(def->watchdog); + for (i =3D 0; i < def->nwatchdogs; i++) + virDomainWatchdogDefFree(def->watchdogs[i]); + g_free(def->watchdogs); =20 virDomainMemballoonDefFree(def->memballoon); virDomainNVRAMDefFree(def->nvram); @@ -4647,10 +4649,10 @@ virDomainDeviceInfoIterateFlags(virDomainDef *def, if ((rc =3D cb(def, &device, &def->fss[i]->info, opaque)) !=3D 0) return rc; } - if (def->watchdog) { - device.type =3D VIR_DOMAIN_DEVICE_WATCHDOG; - device.data.watchdog =3D def->watchdog; - if ((rc =3D cb(def, &device, &def->watchdog->info, opaque)) !=3D 0) + device.type =3D VIR_DOMAIN_DEVICE_WATCHDOG; + for (i =3D 0; i < def->nwatchdogs; i++) { + device.data.watchdog =3D def->watchdogs[i]; + if ((rc =3D cb(def, &device, &def->watchdogs[i]->info, opaque)) != =3D 0) return rc; } if (def->memballoon) { @@ -18809,24 +18811,21 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, VIR_FREE(nodes); =20 /* analysis of the watchdog devices */ - def->watchdog =3D NULL; - if ((n =3D virXPathNodeSet("./devices/watchdog", ctxt, &nodes)) < 0) + n =3D virXPathNodeSet("./devices/watchdog", ctxt, &nodes); + if (n < 0) return NULL; - if (n > 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("only a single watchdog device is supported")); - return NULL; - } - if (n > 0) { + if (n) + def->watchdogs =3D g_new0(virDomainWatchdogDef *, n); + for (i =3D 0; i < n; i++) { virDomainWatchdogDef *watchdog; =20 - watchdog =3D virDomainWatchdogDefParseXML(xmlopt, nodes[0], ctxt, = flags); + watchdog =3D virDomainWatchdogDefParseXML(xmlopt, nodes[i], ctxt, = flags); if (!watchdog) return NULL; =20 - def->watchdog =3D watchdog; - VIR_FREE(nodes); + def->watchdogs[def->nwatchdogs++] =3D watchdog; } + VIR_FREE(nodes); =20 /* analysis of the memballoon devices */ def->memballoon =3D NULL; @@ -21255,18 +21254,19 @@ virDomainDefCheckABIStabilityFlags(virDomainDef *= src, dst->redirfilter)) goto error; =20 - if ((!src->watchdog && dst->watchdog) || - (src->watchdog && !dst->watchdog)) { + + if (src->nwatchdogs !=3D dst->nwatchdogs) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target domain watchdog count %d " - "does not match source %d"), - dst->watchdog ? 1 : 0, src->watchdog ? 1 : 0); + _("Target domain watchdog device count %zu " + "does not match source %zu"), + dst->nwatchdogs, src->nwatchdogs); goto error; } =20 - if (src->watchdog && - !virDomainWatchdogDefCheckABIStability(src->watchdog, dst->watchdo= g)) - goto error; + for (i =3D 0; i < src->nwatchdogs; i++) { + if (!virDomainWatchdogDefCheckABIStability(src->watchdogs[i], dst-= >watchdogs[i])) + goto error; + } =20 if ((!src->memballoon && dst->memballoon) || (src->memballoon && !dst->memballoon)) { @@ -27517,8 +27517,8 @@ virDomainDefFormatInternalSetRootName(virDomainDef = *def, return -1; } =20 - if (def->watchdog) - virDomainWatchdogDefFormat(buf, def->watchdog, flags); + for (n =3D 0; n < def->nwatchdogs; n++) + virDomainWatchdogDefFormat(buf, def->watchdogs[n], flags); =20 if (def->memballoon) virDomainMemballoonDefFormat(buf, def->memballoon, flags); @@ -30578,3 +30578,33 @@ virDomainDefHasSpiceGraphics(const virDomainDef *d= ef) =20 return false; } + + +ssize_t +virDomainWatchdogDefFind(const virDomainDef *def, + const virDomainWatchdogDef *watchdog) +{ + size_t i; + + for (i =3D 0; i < def->nwatchdogs; i++) { + const virDomainWatchdogDef *tmp =3D def->watchdogs[i]; + + if (tmp->model !=3D watchdog->model) + continue; + + if (tmp->action !=3D watchdog->action) + continue; + + if (watchdog->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + !virDomainDeviceInfoAddressIsEqual(&watchdog->info, &tmp->info= )) + continue; + + if (watchdog->info.alias && + STRNEQ_NULLABLE(watchdog->info.alias, tmp->info.alias)) + continue; + + return i; + } + + return -1; +} diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3e4985a67da2..da785076151d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3062,12 +3062,14 @@ struct _virDomainDef { size_t nsysinfo; virSysinfoDef **sysinfo; =20 + size_t nwatchdogs; + virDomainWatchdogDef **watchdogs; + /* At maximum 2 TPMs on the domain if a TPM Proxy is present. */ size_t ntpms; virDomainTPMDef **tpms; =20 /* Only 1 */ - virDomainWatchdogDef *watchdog; virDomainMemballoonDef *memballoon; virDomainNVRAMDef *nvram; virCPUDef *cpu; @@ -3526,6 +3528,10 @@ virDomainSoundDef *virDomainSoundDefRemove(virDomain= Def *def, size_t idx); void virDomainAudioDefFree(virDomainAudioDef *def); void virDomainMemballoonDefFree(virDomainMemballoonDef *def); void virDomainNVRAMDefFree(virDomainNVRAMDef *def); +ssize_t +virDomainWatchdogDefFind(const virDomainDef *def, + const virDomainWatchdogDef *watchdog) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; void virDomainWatchdogDefFree(virDomainWatchdogDef *def); virDomainVideoDef *virDomainVideoDefNew(virDomainXMLOption *xmlopt); void virDomainVideoDefFree(virDomainVideoDef *def); diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 6cb0a20e1e10..a5d0505d9b9b 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -6428,9 +6428,9 @@ - + - + diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 576ec8f95f17..2c5489b2b86e 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -692,6 +692,7 @@ virDomainVsockDefFree; virDomainVsockDefNew; virDomainWatchdogActionTypeFromString; virDomainWatchdogActionTypeToString; +virDomainWatchdogDefFind; virDomainWatchdogDefFree; virDomainWatchdogModelTypeFromString; virDomainWatchdogModelTypeToString; diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index ef8e87ab58a2..809a6f03ed46 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -560,12 +560,26 @@ qemuAssignDeviceShmemAlias(virDomainDef *def, =20 =20 void -qemuAssignDeviceWatchdogAlias(virDomainWatchdogDef *watchdog) +qemuAssignDeviceWatchdogAlias(virDomainDef *def, + virDomainWatchdogDef *watchdog, + int idx) { - /* Currently, there's just one watchdog per domain */ + ssize_t i =3D 0; + + if (watchdog->info.alias) + return; + + if (idx =3D=3D -1) { + for (i =3D 0; i < def->nwatchdogs; i++) { + idx =3D MAX(idx, + qemuDomainDeviceAliasIndex(&def->watchdogs[i]->info, + "watchdog")); + } + + idx++; + } =20 - if (!watchdog->info.alias) - watchdog->info.alias =3D g_strdup("watchdog0"); + watchdog->info.alias =3D g_strdup_printf("watchdog%d", idx); } =20 =20 @@ -671,8 +685,8 @@ qemuAssignDeviceAliases(virDomainDef *def) for (i =3D 0; i < def->nsmartcards; i++) { qemuAssignDeviceSmartcardAlias(def->smartcards[i], i); } - if (def->watchdog) { - qemuAssignDeviceWatchdogAlias(def->watchdog); + for (i =3D 0; i < def->nwatchdogs; i++) { + qemuAssignDeviceWatchdogAlias(def, def->watchdogs[i], i); } if (def->memballoon && def->memballoon->model !=3D VIR_DOMAIN_MEMBALLOON_MODEL_NONE) { diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h index 6433ae4cecaf..d7f34489f570 100644 --- a/src/qemu/qemu_alias.h +++ b/src/qemu/qemu_alias.h @@ -62,7 +62,10 @@ void qemuAssignDeviceShmemAlias(virDomainDef *def, virDomainShmemDef *shmem, int idx); =20 -void qemuAssignDeviceWatchdogAlias(virDomainWatchdogDef *watchdog); +void +qemuAssignDeviceWatchdogAlias(virDomainDef *def, + virDomainWatchdogDef *watchdog, + int idx); =20 void qemuAssignDeviceInputAlias(virDomainDef *def, virDomainInputDef *input, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b96f2d33c158..6e28f8b15e1c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4044,22 +4044,28 @@ qemuBuildWatchdogCommandLine(virCommand *cmd, const virDomainDef *def, virQEMUCaps *qemuCaps) { - virDomainWatchdogDef *watchdog =3D def->watchdog; - g_autoptr(virJSONValue) props =3D NULL; + virDomainWatchdogDef *watchdog =3D NULL; const char *action; int actualAction; + ssize_t i =3D 0; =20 - if (!def->watchdog) + if (def->nwatchdogs =3D=3D 0) return 0; =20 - if (qemuCommandAddExtDevice(cmd, &def->watchdog->info, def, qemuCaps) = < 0) - return -1; + for (i =3D 0; i < def->nwatchdogs; i++) { + g_autoptr(virJSONValue) props =3D NULL; =20 - if (!(props =3D qemuBuildWatchdogDevProps(def, watchdog))) - return -1; + watchdog =3D def->watchdogs[i]; =20 - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps)) - return -1; + if (qemuCommandAddExtDevice(cmd, &watchdog->info, def, qemuCaps) <= 0) + return -1; + + if (!(props =3D qemuBuildWatchdogDevProps(def, watchdog))) + return -1; + + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps)) + return -1; + } =20 /* qemu doesn't have a 'dump' action; we tell qemu to 'pause', then libvirt listens for the watchdog event, and we perform the dump diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index b8d1969fbebd..db4e91501d3f 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2326,10 +2326,10 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, } =20 /* A watchdog - check if it is a PCI device */ - if (def->watchdog && - def->watchdog->model =3D=3D VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB && - virDeviceInfoPCIAddressIsWanted(&def->watchdog->info)) { - if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->watchdog->inf= o) < 0) + for (i =3D 0; i < def->nwatchdogs; i++) { + if (def->watchdogs[i]->model =3D=3D VIR_DOMAIN_WATCHDOG_MODEL_I630= 0ESB && + virDeviceInfoPCIAddressIsWanted(&def->watchdogs[i]->info) && + qemuDomainPCIAddressReserveNextAddr(addrs, &def->watchdogs[i]-= >info) < 0) return -1; } =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d6879175fece..dce3bef5b85b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7258,12 +7258,13 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef, break; =20 case VIR_DOMAIN_DEVICE_WATCHDOG: - if (vmdef->watchdog) { + if (virDomainWatchdogDefFind(vmdef, dev->data.watchdog) >=3D 0) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain already has a watchdog")); + _("device is already in the domain configuratio= n")); return -1; } - vmdef->watchdog =3D g_steal_pointer(&dev->data.watchdog); + + VIR_APPEND_ELEMENT(vmdef->watchdogs, vmdef->nwatchdogs, dev->data.= watchdog); break; =20 case VIR_DOMAIN_DEVICE_INPUT: @@ -7457,12 +7458,13 @@ qemuDomainDetachDeviceConfig(virDomainDef *vmdef, =20 =20 case VIR_DOMAIN_DEVICE_WATCHDOG: - if (!vmdef->watchdog) { + idx =3D virDomainWatchdogDefFind(vmdef, dev->data.watchdog); + if (idx < 0) { virReportError(VIR_ERR_DEVICE_MISSING, "%s", - _("domain has no watchdog")); + _("no matching watchdog was found")); return -1; } - g_clear_pointer(&vmdef->watchdog, virDomainWatchdogDefFree); + VIR_DELETE_ELEMENT(vmdef->watchdogs, idx, vmdef->nwatchdogs); break; =20 case VIR_DOMAIN_DEVICE_INPUT: diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1fa3cc3ea9b1..b9832ea7815a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2928,15 +2928,9 @@ qemuDomainAttachWatchdog(virDomainObj *vm, virDomainDeviceDef dev =3D { VIR_DOMAIN_DEVICE_WATCHDOG, { .watchdog = =3D watchdog } }; g_autoptr(virJSONValue) props =3D NULL; bool releaseAddress =3D false; - int rv; + int rv =3D 0; =20 - if (vm->def->watchdog) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain already has a watchdog")); - return -1; - } - - qemuAssignDeviceWatchdogAlias(watchdog); + qemuAssignDeviceWatchdogAlias(vm->def, watchdog, -1); =20 if (watchdog->model !=3D VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -2954,10 +2948,13 @@ qemuDomainAttachWatchdog(virDomainObj *vm, =20 qemuDomainObjEnterMonitor(vm); =20 - /* QEMU doesn't have a 'dump' action; we tell qemu to 'pause', then - libvirt listens for the watchdog event, and we perform the dump - ourselves. so convert 'dump' to 'pause' for the qemu cli */ - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) { + if (vm->def->nwatchdogs) { + /* Domain already has a watchdog and all must have the same action= . */ + rv =3D 0; + } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) { + /* QEMU doesn't have a 'dump' action; we tell qemu to 'pause', then + libvirt listens for the watchdog event, and we perform the dump + ourselves. so convert 'dump' to 'pause' for the qemu cli */ qemuMonitorActionWatchdog watchdogaction =3D QEMU_MONITOR_ACTION_W= ATCHDOG_KEEP; =20 switch (watchdog->action) { @@ -3015,7 +3012,7 @@ qemuDomainAttachWatchdog(virDomainObj *vm, goto cleanup; =20 releaseAddress =3D false; - vm->def->watchdog =3D watchdog; + VIR_APPEND_ELEMENT_COPY(vm->def->watchdogs, vm->def->nwatchdogs, watch= dog); ret =3D 0; =20 cleanup: @@ -4848,11 +4845,20 @@ static int qemuDomainRemoveWatchdog(virDomainObj *vm, virDomainWatchdogDef *watchdog) { + size_t i =3D 0; + VIR_DEBUG("Removing watchdog %s from domain %p %s", watchdog->info.alias, vm, vm->def->name); =20 + for (i =3D 0; i < vm->def->nwatchdogs; i++) { + if (vm->def->watchdogs[i] =3D=3D watchdog) + break; + } + qemuDomainReleaseDeviceAddress(vm, &watchdog->info); - g_clear_pointer(&vm->def->watchdog, virDomainWatchdogDefFree); + virDomainWatchdogDefFree(watchdog); + VIR_DELETE_ELEMENT(vm->def->watchdogs, i, vm->def->nwatchdogs); + return 0; } =20 @@ -5603,33 +5609,20 @@ qemuDomainDetachPrepWatchdog(virDomainObj *vm, virDomainWatchdogDef *match, virDomainWatchdogDef **detach) { - virDomainWatchdogDef *watchdog; - - *detach =3D watchdog =3D vm->def->watchdog; + ssize_t idx =3D virDomainWatchdogDefFind(vm->def, match); =20 - if (!watchdog) { - virReportError(VIR_ERR_DEVICE_MISSING, "%s", - _("watchdog device not present in domain configurat= ion")); + if (idx < 0) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("no matching watchdog was found")); return -1; } =20 - /* While domains can have up to one watchdog, the one supplied by the = user - * doesn't necessarily match the one domain has. Refuse to detach in s= uch - * case. */ - if (!(watchdog->model =3D=3D match->model && - watchdog->action =3D=3D match->action && - virDomainDeviceInfoAddressIsEqual(&match->info, &watchdog->info)= )) { - virReportError(VIR_ERR_DEVICE_MISSING, - _("model '%s' watchdog device not present " - "in domain configuration"), - virDomainWatchdogModelTypeToString(watchdog->model)= ); - return -1; - } + *detach =3D vm->def->watchdogs[idx]; =20 - if (watchdog->model !=3D VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) { + if ((*detach)->model !=3D VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("hot unplug of watchdog of model %s is not suppor= ted"), - virDomainWatchdogModelTypeToString(watchdog->model)= ); + virDomainWatchdogModelTypeToString((*detach)->model= )); return -1; } =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ee9f0784d3a3..218231f3596c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -804,7 +804,8 @@ qemuProcessHandleWatchdog(qemuMonitor *mon G_GNUC_UNUSE= D, qemuDomainSaveStatus(vm); } =20 - if (vm->def->watchdog->action =3D=3D VIR_DOMAIN_WATCHDOG_ACTION_DUMP) { + if (vm->def->nwatchdogs && + vm->def->watchdogs[0]->action =3D=3D VIR_DOMAIN_WATCHDOG_ACTION_DU= MP) { qemuProcessEventSubmit(vm, QEMU_PROCESS_EVENT_WATCHDOG, VIR_DOMAIN_WATCHDOG_ACTION_DUMP, 0, NULL); } diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 6e04b22da43f..cb002dee0eb9 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1188,6 +1188,28 @@ qemuValidateDomainDefTPMs(const virDomainDef *def) } =20 =20 +static int +qemuValidateDomainDefWatchdogs(const virDomainDef *def) +{ + ssize_t i =3D 0; + + for (i =3D 0; i < def->nwatchdogs; i++) { + /* We could theoretically support different watchdogs having dump = and + * pause, but let's be honest, we support multiple watchdogs only + * because we need to be able to add a second, implicit one, not b= ecause + * it is a brilliant idea to have multiple watchdogs. */ + if (def->watchdogs[i]->action !=3D def->watchdogs[0]->action) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("watchdogs with different actions are not sup= ported " + "with this QEMU binary")); + return -1; + } + } + + return 0; +} + + int qemuValidateLifecycleAction(virDomainLifecycleAction onPoweroff, virDomainLifecycleAction onReboot, @@ -1388,6 +1410,9 @@ qemuValidateDomainDef(const virDomainDef *def, if (qemuValidateDomainDefTPMs(def) < 0) return -1; =20 + if (qemuValidateDomainDefWatchdogs(def) < 0) + return -1; + if (def->sec) { switch ((virDomainLaunchSecurity) def->sec->sectype) { case VIR_DOMAIN_LAUNCH_SECURITY_SEV: diff --git a/tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.arg= s b/tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.args new file mode 100644 index 000000000000..eccf5a2e119f --- /dev/null +++ b/tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.args @@ -0,0 +1,39 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine q35,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus= ":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x= 0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus= ":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}= ' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"ib700","id":"watchdog0"}' \ +-device '{"driver":"i6300esb","id":"watchdog1","bus":"pci.2","addr":"0x2"}= ' \ +-watchdog-action poweroff \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/watchdog-q35-multiple.xml b/tests/qemux= ml2argvdata/watchdog-q35-multiple.xml new file mode 100644 index 000000000000..af0cb169f0d9 --- /dev/null +++ b/tests/qemuxml2argvdata/watchdog-q35-multiple.xml @@ -0,0 +1,25 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 8c52feb83c3c..9faa6f7791b1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1756,6 +1756,7 @@ mymain(void) DO_TEST_CAPS_LATEST("watchdog-device"); DO_TEST_CAPS_LATEST("watchdog-dump"); DO_TEST_CAPS_LATEST("watchdog-injectnmi"); + DO_TEST_CAPS_LATEST("watchdog-q35-multiple"); DO_TEST_CAPS_ARCH_LATEST("watchdog-diag288", "s390x"); DO_TEST_NOCAPS("balloon-device"); DO_TEST("balloon-device-deflate", diff --git a/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.x= ml b/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml new file mode 100644 index 000000000000..e507576085f7 --- /dev/null +++ b/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml @@ -0,0 +1,50 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + +
+ + + + +
+ + + +
+ + + + +
+ + + +