From nobody Mon Feb 9 23:12:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1531151331015900.1941699879304; Mon, 9 Jul 2018 08:48:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 436F68110B; Mon, 9 Jul 2018 15:48:49 +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 EBB151001F5E; Mon, 9 Jul 2018 15:48:48 +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 966021800B6A; Mon, 9 Jul 2018 15:48:48 +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 w69Fmd1A014489 for ; Mon, 9 Jul 2018 11:48:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id B0BC91C597; Mon, 9 Jul 2018 15:48:39 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 383431C596; Mon, 9 Jul 2018 15:48:39 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 9 Jul 2018 17:56:24 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 4/4] qemu: command: Format rerror/werror with -device instead of -drive 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 09 Jul 2018 15:48:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the new proper location for the read/write error policy selection. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 +++++- .../disk-drive-error-policy.x86_64-latest.args | 12 ++++++--= ---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3c1e87fad4..7fd2c8b372 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1664,7 +1664,8 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, /* werror/rerror are really frontend attributes, but older * qemu requires them on -drive instead of -device */ - qemuBuildDiskFrontendAttributeErrorPolicy(disk, &opt); + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_WERROR)) + qemuBuildDiskFrontendAttributeErrorPolicy(disk, &opt); /* While this is a frontend attribute, it only makes sense to be used = when @@ -2126,6 +2127,9 @@ qemuBuildDriveDevStr(const virDomainDef *def, qemuBuildDiskFrontendAttributes(disk, &opt); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_WERROR)) + qemuBuildDiskFrontendAttributeErrorPolicy(disk, &opt); + if (virBufferCheckError(&opt) < 0) goto error; diff --git a/tests/qemuxml2argvdata/disk-drive-error-policy.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/disk-drive-error-policy.x86_64-latest.args index 388f78df0f..e8fa9e2452 100644 --- a/tests/qemuxml2argvdata/disk-drive-error-policy.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-drive-error-policy.x86_64-latest.args @@ -25,17 +25,17 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ -werror=3Dstop,rerror=3Dstop,cache=3Dnone \ +cache=3Dnone \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,\ -write-cache=3Don \ +write-cache=3Don,werror=3Dstop,rerror=3Dstop \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-1,\ -werror=3Denospc,cache=3Dnone \ +cache=3Dnone \ -device ide-hd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1,\ -write-cache=3Don \ +write-cache=3Don,werror=3Denospc \ -drive file=3D/dev/HostVG/QEMUGuest3,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-1-0,\ -werror=3Dreport,rerror=3Dignore,cache=3Dnone \ +cache=3Dnone \ -device ide-hd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,\ -write-cache=3Don \ +write-cache=3Don,werror=3Dreport,rerror=3Dignore \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list