From nobody Mon May 13 00:12:16 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=1698234006; cv=none; d=zohomail.com; s=zohoarc; b=hv3liqG9LXPD0YyGduFxQFb8j3bfpBxKXz2m39zIzhBHdnffXzbcD4g0WTD5l1wSX8wmuRZuki6aCfQAzFgVesWlNKmf8hrSYo8WH/gMoiwUyOcp9WXOOnkvP1elS2UdI7OgUAr+bFRi1YHLDv5XvyEI4d2KDCPZDiNg59o5JZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234006; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=jjdht5V5hJAwu/hATiJ58f77KXqDJlKMsAQVkwF5iRM=; b=RHB8PmqMvaoy6MtGGVO/5w98Zcgb7xNHYHhYOF+Qk5eqekhgZookc759h0ALc5tI5PLfBVhhbpXIXyTS35BRdhkdp0BBqxzvewLvlUH0Fc5HqzHWF/Kfuz0Bm69iNEAEapQitVi4Sf4fJaJYvjprKjAZTOoHMoBDsd7kOtQ8lXs= 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 1698234006234980.898017118237; Wed, 25 Oct 2023 04:40:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-383-3EkYa4TlN2uy8B5GgKIdKg-1; Wed, 25 Oct 2023 07:39:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B738E811E94; Wed, 25 Oct 2023 11:39:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 814C040C6F7D; Wed, 25 Oct 2023 11:39:46 +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 F2F6D19465BA; Wed, 25 Oct 2023 11:39:44 +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 7230E1946586 for ; Wed, 25 Oct 2023 11:39:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 53F74492BFC; Wed, 25 Oct 2023 11:39:44 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1F2C492BFB for ; Wed, 25 Oct 2023 11:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234005; 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=jjdht5V5hJAwu/hATiJ58f77KXqDJlKMsAQVkwF5iRM=; b=LDVVhoZS/gWOtWEMowuW9AK+xPkrgYSi6Y+tZkFH+xVaF9Z4wVcwYUg3y22XGvQiblpmHT 1klx10fNsT06uzHUXT/9WO5PbctyDlMSuLfDs4FZ/w1WwwwSkyx/mn/L8Vlhq4trLLdSQq E60lfWbUe2VceHWsaQRMapiBiUa1b1I= X-MC-Unique: 3EkYa4TlN2uy8B5GgKIdKg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/22] qemuxml2(argv|xml)test: Add network backed disk type='sd' Date: Wed, 25 Oct 2023 13:39:11 +0200 Message-ID: <710e45d154975b1421e6d40a6166da66a647c6a1.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.2 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: 1698234007372100001 Content-Type: text/plain; charset="utf-8" Add a few examples of SD cards backed with network storage to capture the current state as the formatter code is about to be refactored. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- .../disk-arm-virtio-sd.aarch64-latest.args | 2 ++ tests/qemuxml2argvdata/disk-arm-virtio-sd.xml | 16 ++++++++++++++++ .../disk-arm-virtio-sd.aarch64-latest.xml | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args = b/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args index 5d841604fb..00fdd1759e 100644 --- a/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args +++ b/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args @@ -33,6 +33,8 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-armtest= /.config \ -dtb /arm.dtb \ -usb \ -drive file=3D/arm-sd.qcow2,format=3Dqcow2,if=3Dsd,index=3D0 \ +-drive file.driver=3Dnbd,file.server.type=3Dinet,file.server.host=3Dlocalh= ost,file.server.port=3D10809,file.export=3Dexport,format=3Dqcow2,if=3Dsd,in= dex=3D1 \ +-drive file.driver=3Dgluster,file.volume=3DVolume3,file.path=3DImage.qcow2= ,file.server.0.type=3Dinet,file.server.0.host=3Dexample.org,file.server.0.p= ort=3D6000,file.server.1.type=3Dinet,file.server.1.host=3Dexample.org,file.= server.1.port=3D24007,file.server.2.type=3Dunix,file.server.2.path=3D/path/= to/sock,file.debug=3D4,format=3Dqcow2,if=3Dsd,index=3D2 \ -blockdev '{"driver":"file","filename":"/arm-virtio.qcow2","node-name":"li= bvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qco= w2","file":"libvirt-1-storage"}' \ -device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"vi= rtio-disk0"}' \ diff --git a/tests/qemuxml2argvdata/disk-arm-virtio-sd.xml b/tests/qemuxml2= argvdata/disk-arm-virtio-sd.xml index 45a2192d48..9315c12c76 100644 --- a/tests/qemuxml2argvdata/disk-arm-virtio-sd.xml +++ b/tests/qemuxml2argvdata/disk-arm-virtio-sd.xml @@ -26,6 +26,22 @@ + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2xmloutdata/disk-arm-virtio-sd.aarch64-latest.xml= b/tests/qemuxml2xmloutdata/disk-arm-virtio-sd.aarch64-latest.xml index 962dc8f367..b9d412d3fb 100644 --- a/tests/qemuxml2xmloutdata/disk-arm-virtio-sd.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/disk-arm-virtio-sd.aarch64-latest.xml @@ -30,6 +30,22 @@ + + + + + + + + + + + + + + + + --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234001; cv=none; d=zohomail.com; s=zohoarc; b=eQGOB/6UQhX1lxHwz+QzoQuysHTEpS926RYLhKVPJXIpeBpyzHOUDHvWsT322tiNUmfmPgIOCOtEY7kBvn+mxfTboOoQtiuqHYlm0Xo7wDcP8QbRaOXdaVvz8r2iryNCKTJqoTFp+w6jkaIP+pCIfxy97leObhZLkFJLBN9zcsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234001; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=NWOJP+7xgAXU2Z2TDlE6Yv7mMFJSOdlxuSLUw95xxCc=; b=MqUEXrgTBNT6T0R1pnYgthrZKUj9L0C4H6aH5ge2eQ4a9t6LYnHvcdp2aox1qSrWpQueTqD6CDaUcjLWTFlSwaJEJQhsvblMv5D8acGp5G/U794dZEHW79Y8BiY0rYnKjxZQAkXfrE0Q9JRI/dLnli00Vf+vBJSqHQr14M+mJB0= 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 169823400159296.3812214667604; Wed, 25 Oct 2023 04:40:01 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-arKT89C_O5-N9wFh6y-VGQ-1; Wed, 25 Oct 2023 07:39:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 42A493C01DB7; Wed, 25 Oct 2023 11:39:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 288C040C6F79; Wed, 25 Oct 2023 11:39:47 +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 0A7951946595; Wed, 25 Oct 2023 11:39:46 +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 5373019466EE for ; Wed, 25 Oct 2023 11:39:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 340F8492BFC; Wed, 25 Oct 2023 11:39:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAA6C492BFB for ; Wed, 25 Oct 2023 11:39:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234000; 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=NWOJP+7xgAXU2Z2TDlE6Yv7mMFJSOdlxuSLUw95xxCc=; b=WVzZhZfOJhKLVULCU89tq3zWqRQhVEWMmUcoQ/uP+a3wMVNBkolWaarbHiVO5kvbIzaunI W1+lBBm4/O8hs61MWsW44w1Pi+/q2O4GZS2SIs30THYZnQwuBtVlNWvsirnVwjW/KbpKWZ QsVKhCREUDkl5z+y5kNwRB1uZLC5wVM= X-MC-Unique: arKT89C_O5-N9wFh6y-VGQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/22] qemu: migration: No longer avoid 'auto-read-only' option for migration Date: Wed, 25 Oct 2023 13:39:12 +0200 Message-ID: <88721d2a1b3706ff15bfedfd17d6395e23337c09.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.2 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: 1698234003258100005 Content-Type: text/plain; charset="utf-8" The 'auto-read-only' blockdev option is available in all supported qemu versions so we can remove the migration hack which disabled it. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 8 ++------ src/qemu/qemu_block.h | 3 +-- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_migration.c | 5 +---- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0d252552de..e706bb7369 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1513,14 +1513,10 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStora= geSourceAttachData *data) */ qemuBlockStorageSourceAttachData * qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src, - virStorageSource *backingStore, - bool autoreadonly) + virStorageSource *backingStore) { g_autoptr(qemuBlockStorageSourceAttachData) data =3D NULL; - unsigned int backendpropsflags =3D 0; - - if (autoreadonly) - backendpropsflags |=3D QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUT= O_READONLY; + unsigned int backendpropsflags =3D QEMU_BLOCK_STORAGE_SOURCE_BACKEND_P= ROPS_AUTO_READONLY; data =3D g_new0(qemuBlockStorageSourceAttachData, 1); diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 7008a4e7da..7bb83d8d44 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -134,8 +134,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockStorageSourceAtt= achData, qemuBlockStorageSourceAttachData * qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src, - virStorageSource *backingStore, - bool autoreadonly); + virStorageSource *backingStore= ); qemuBlockStorageSourceAttachData * qemuBlockStorageSourceDetachPrepare(virStorageSource *src); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d40d3a4e13..ba21976956 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10937,7 +10937,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdevOne= (qemuBlockStorageSourceChainD { g_autoptr(qemuBlockStorageSourceAttachData) elem =3D NULL; - if (!(elem =3D qemuBlockStorageSourceAttachPrepareBlockdev(src, backin= gStore, true))) + if (!(elem =3D qemuBlockStorageSourceAttachPrepareBlockdev(src, backin= gStore))) return -1; if (qemuBuildStorageSourceAttachPrepareCommon(src, elem) < 0) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 76da981d08..ac58aa1a8c 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1045,11 +1045,8 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virDomainObj = *vm, tl= sAlias, tlsHostname))) return -1; - /* Migration via blockdev-mirror was supported sooner than the auto-re= ad-only - * feature was added to qemu */ if (!(data =3D qemuBlockStorageSourceAttachPrepareBlockdev(copysrc, - copysrc->back= ingStore, - false))) + copysrc->back= ingStore))) return -1; if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_MIGRATION_OUT) < = 0) --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234006; cv=none; d=zohomail.com; s=zohoarc; b=ASGFm9lRGZiFCQaQxvTOze2TJXYPFcoD+xG3sBlOqS3Hs+WMH+kYXjdXoMUU209cmhROIM3GjiGYzLz3wS6me9/nIcrDMGF8+1JktlsahlRwr2cXaPxyNfhwQ6D0mOLLJhEDIw0/qKsArOPZ5Vi4GHHZrLruh4HuVu7AeiBNynA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234006; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=QeOCzcj4B/zkcQxvsrXED0/m1bDMy4rfPltkjxwn1mc=; b=ZwOt0khoDpGYA9eBgVtWM2rCpwy3H3nFEBf9D7P3vJ0QnWwKqio8/9H5d0f57EG91Rr2tOLWSRtcnPvLx+ePFPXqr9mMdYaR2+uZG6ihY9GavbeYnnoX1qx6Fw5Y6dL2xM367aLYQmz1NAOwGW4lzg251qlXjZpXr/hzesf0p+4= 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 1698234006220661.450395579227; Wed, 25 Oct 2023 04:40:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-462-fDeN2y0_Oi6X4u0alZJXzg-1; Wed, 25 Oct 2023 07:39:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D52C2185A70C; Wed, 25 Oct 2023 11:39:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE13F1C060AE; Wed, 25 Oct 2023 11:39:47 +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 369DF194658C; Wed, 25 Oct 2023 11:39:47 +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 21E8319466F2 for ; Wed, 25 Oct 2023 11:39:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F2EBD492BFC; Wed, 25 Oct 2023 11:39:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F45C492BFB for ; Wed, 25 Oct 2023 11:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234005; 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=QeOCzcj4B/zkcQxvsrXED0/m1bDMy4rfPltkjxwn1mc=; b=ZhqOIQw5XbfOPyHmHH7LBN4BIqNJm0S3nLBMKNi92HkTCRhddwvYJLCOjzfrm0eXogqFxE 6LnqaFLAfzEIkox6FC9bbm4eQKyTz3tFMxoUw/PGdm4Ub20t1akTlYWyfTHDlhZ7K88DZK K9Eyug74682qm3/aKtdm09WHkPbdCJQ= X-MC-Unique: fDeN2y0_Oi6X4u0alZJXzg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/22] qemuBuildDriveSourceStr: Absorb only use of qemuDiskSourceGetProps Date: Wed, 25 Oct 2023 13:39:13 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.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: 1698234007372100002 Content-Type: text/plain; charset="utf-8" 'qemuBuildDriveSourceStr' used to build the legacy -drive commandline for SD cards is the only user of qemuDiskSourceGetProps. Move the helper directly inline. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ba21976956..dbef8d0068 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1572,30 +1572,6 @@ qemuDiskBusIsSD(int bus) } -/** - * qemuDiskSourceGetProps: - * @src: disk source struct - * - * Returns the disk source struct wrapped so that it can be used as disk s= ource - * directly by converting it from json. - */ -static virJSONValue * -qemuDiskSourceGetProps(virStorageSource *src) -{ - g_autoptr(virJSONValue) props =3D NULL; - virJSONValue *ret =3D NULL; - - if (!(props =3D qemuBlockStorageSourceGetBackendProps(src, - QEMU_BLOCK_STORAGE= _SOURCE_BACKEND_PROPS_LEGACY))) - return NULL; - - if (virJSONValueObjectAdd(&ret, "a:file", &props, NULL) < 0) - return NULL; - - return ret; -} - - static int qemuBuildDriveSourceStr(virDomainDiskDef *disk, virBuffer *buf) @@ -1603,7 +1579,6 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk, virStorageType actualType =3D virStorageSourceGetActualType(disk->src); qemuDomainStorageSourcePrivate *srcpriv =3D QEMU_DOMAIN_STORAGE_SOURCE= _PRIVATE(disk->src); qemuDomainSecretInfo **encinfo =3D NULL; - g_autoptr(virJSONValue) srcprops =3D NULL; bool rawluks =3D false; if (srcpriv) @@ -1624,14 +1599,22 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk, virQEMUBuildBufferEscapeComma(buf, disk->src->path); break; - case VIR_STORAGE_TYPE_NETWORK: - if (!(srcprops =3D qemuDiskSourceGetProps(disk->src))) + case VIR_STORAGE_TYPE_NETWORK: { + g_autoptr(virJSONValue) props =3D NULL; + g_autoptr(virJSONValue) wrap =3D NULL; + + if (!(props =3D qemuBlockStorageSourceGetBackendProps(disk->src, + QEMU_BLOCK_STO= RAGE_SOURCE_BACKEND_PROPS_LEGACY))) return -1; - if (virQEMUBuildCommandLineJSON(srcprops, buf, NULL, + if (virJSONValueObjectAdd(&wrap, "a:file", &props, NULL) < 0) + return -1; + + if (virQEMUBuildCommandLineJSON(wrap, buf, NULL, virQEMUBuildCommandLineJSONArrayNu= mbered) < 0) return -1; break; + } case VIR_STORAGE_TYPE_VOLUME: case VIR_STORAGE_TYPE_NVME: --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234019; cv=none; d=zohomail.com; s=zohoarc; b=A8bT7VCWTHHxJsJP5a+iut7Rk/OE4eeKCSOviT13LU+SjCk21uy5Rp2aHhoX0+AZUpeu40w1svQKWzf/SZAKnocGSj8x6tF4dCZkKIcatyycOJxbXZAnwYuXsiim4pjgdwB3dDd6a1MGa1KFcoBgpg8sGmQ2P4TKJU81QHy5v8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234019; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=lePfuGePkC6NXoef9LTnCK5CYLjHDik0ibA2hXsp1zc=; b=BaOxT0Z5Dv/IJuMMJV5f/eRvADTTgoFAIs0cX8LFUcMdd6Np93+MuNN6LQXwajhalibr4Sik48oqZM+szpH/sVkccWAqPBo/lFy6Fuk6s+JRhoq4MqpqAobfk3P1hb/p/jxJyN9FT/qUyl6L/cfQ6cAyDXSBYwxsZZl8xsnDPyo= 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 1698234019784742.4277974443955; Wed, 25 Oct 2023 04:40:19 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-639-kqySgdSyNtGtVi3cak2_FQ-1; Wed, 25 Oct 2023 07:40:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ECF6F3C0D1B7; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D68B52026D66; Wed, 25 Oct 2023 11:39:50 +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 A9805194658C; Wed, 25 Oct 2023 11:39:50 +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 E782A194658C for ; Wed, 25 Oct 2023 11:39:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C80A0492BFC; Wed, 25 Oct 2023 11:39:46 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C6DB492BFB for ; Wed, 25 Oct 2023 11:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234018; 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=lePfuGePkC6NXoef9LTnCK5CYLjHDik0ibA2hXsp1zc=; b=Oivd9E/yf12nFJpsu4fyhXj8sK0nyppS9lYCV3QL4j96KJIiiFb7qihK+AGvKPRs1AbXRX qnrD3gGE8empVwNNbIaCHTUxYqcP47aVxeSTIFwsQPXJR1NQKCcyMDSSTaARGY0ceb1BdW 5xE0/OC/yVmTbS32GMeUFrjqF/1H8BI= X-MC-Unique: kqySgdSyNtGtVi3cak2_FQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/22] qemuBlockStorageSourceGetBackendProps: Remove unnecessary indent for non-nbdkit code path Date: Wed, 25 Oct 2023 13:39:14 +0200 Message-ID: <87417c0c4cc0222fb95b534c8ff1cbe029d369ef.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.4 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: 1698234021363100005 Content-Type: text/plain; charset="utf-8" Formatting of the 'nbdkit' driven backend breaks out of the switch statement so we don't need to have an unnecessary block and indentation level for the case when nbdkit is not in use. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 132 +++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index e706bb7369..3be12b47e3 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1028,75 +1028,75 @@ qemuBlockStorageSourceGetBackendProps(virStorageSou= rce *src, return NULL; case VIR_STORAGE_TYPE_NETWORK: - /* prefer using nbdkit for sources that are supported */ + /* prefer using nbdkit if configured for sources that are supporte= d */ if ((fileprops =3D qemuBlockStorageSourceGetNbdkitProps(src))) { driver =3D "nbd"; break; - } else { - switch ((virStorageNetProtocol) src->protocol) { - case VIR_STORAGE_NET_PROTOCOL_GLUSTER: - driver =3D "gluster"; - if (!(fileprops =3D qemuBlockStorageSourceGetGlusterPr= ops(src, onlytarget))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_VXHS: - driver =3D "vxhs"; - if (!(fileprops =3D qemuBlockStorageSourceGetVxHSProps= (src, onlytarget))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_HTTP: - case VIR_STORAGE_NET_PROTOCOL_HTTPS: - case VIR_STORAGE_NET_PROTOCOL_FTP: - case VIR_STORAGE_NET_PROTOCOL_FTPS: - case VIR_STORAGE_NET_PROTOCOL_TFTP: - driver =3D virStorageNetProtocolTypeToString(src->prot= ocol); - if (!(fileprops =3D qemuBlockStorageSourceGetCURLProps= (src, onlytarget))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_ISCSI: - driver =3D "iscsi"; - if (!(fileprops =3D qemuBlockStorageSourceGetISCSIProp= s(src, onlytarget))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_NBD: - driver =3D "nbd"; - if (!(fileprops =3D qemuBlockStorageSourceGetNBDProps(= src, onlytarget))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_RBD: - driver =3D "rbd"; - if (!(fileprops =3D qemuBlockStorageSourceGetRBDProps(= src, onlytarget))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG: - driver =3D "sheepdog"; - if (!(fileprops =3D qemuBlockStorageSourceGetSheepdogP= rops(src))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_SSH: - driver =3D "ssh"; - if (!(fileprops =3D qemuBlockStorageSourceGetSshProps(= src))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_NFS: - driver =3D "nfs"; - if (!(fileprops =3D qemuBlockStorageSourceGetNFSProps(= src))) - return NULL; - break; - - case VIR_STORAGE_NET_PROTOCOL_NONE: - case VIR_STORAGE_NET_PROTOCOL_LAST: - virReportEnumRangeError(virStorageNetProtocol, src->pr= otocol); - return NULL; - } + } + + switch ((virStorageNetProtocol) src->protocol) { + case VIR_STORAGE_NET_PROTOCOL_GLUSTER: + driver =3D "gluster"; + if (!(fileprops =3D qemuBlockStorageSourceGetGlusterProps(src,= onlytarget))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_VXHS: + driver =3D "vxhs"; + if (!(fileprops =3D qemuBlockStorageSourceGetVxHSProps(src, on= lytarget))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_HTTP: + case VIR_STORAGE_NET_PROTOCOL_HTTPS: + case VIR_STORAGE_NET_PROTOCOL_FTP: + case VIR_STORAGE_NET_PROTOCOL_FTPS: + case VIR_STORAGE_NET_PROTOCOL_TFTP: + driver =3D virStorageNetProtocolTypeToString(src->protocol); + if (!(fileprops =3D qemuBlockStorageSourceGetCURLProps(src, on= lytarget))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_ISCSI: + driver =3D "iscsi"; + if (!(fileprops =3D qemuBlockStorageSourceGetISCSIProps(src, o= nlytarget))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_NBD: + driver =3D "nbd"; + if (!(fileprops =3D qemuBlockStorageSourceGetNBDProps(src, onl= ytarget))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_RBD: + driver =3D "rbd"; + if (!(fileprops =3D qemuBlockStorageSourceGetRBDProps(src, onl= ytarget))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG: + driver =3D "sheepdog"; + if (!(fileprops =3D qemuBlockStorageSourceGetSheepdogProps(src= ))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_SSH: + driver =3D "ssh"; + if (!(fileprops =3D qemuBlockStorageSourceGetSshProps(src))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_NFS: + driver =3D "nfs"; + if (!(fileprops =3D qemuBlockStorageSourceGetNFSProps(src))) + return NULL; + break; + + case VIR_STORAGE_NET_PROTOCOL_NONE: + case VIR_STORAGE_NET_PROTOCOL_LAST: + virReportEnumRangeError(virStorageNetProtocol, src->protocol); + return NULL; } break; } --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234000; cv=none; d=zohomail.com; s=zohoarc; b=SwaU0zjUb2v14KWaz0ZOnZkozmki5fqXXED9rpIl4Sd3sopEC6cZiOflTXvaebrb8kCuk47PSN/6hUfxT3En6DVGC4c+sKgzg2OlXJyGVTds/gdj8m2KmUFHzfF+w138TXHWchIeGRdkb6EyvRGsQBxPoB3K6byfX0tqjl99QYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234000; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=3gsCO2nzqR3+4wPfP2vJKUG9K8qh07Nly3ZrEhnItIA=; b=UK3hG6ZuQZkvjG028bLywhnGJImfulBdQjwBn9J+pT6SzxI240yjyfTbtCXcso8UeKphmiCS8GgWbLwo75UFOxASkktj9F7rrFuUkrl0fhesDDRwuU9zDoiOFYbDCB9B/3Euhl/SIPZUYycGpgm9Phhapts4XHWpwkLe1UrXX2U= 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 1698234000166285.1731479229777; Wed, 25 Oct 2023 04:40:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203-QvshuT_iPUaaBHmMmbWJYQ-1; Wed, 25 Oct 2023 07:39:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 98C4B101B04B; Wed, 25 Oct 2023 11:39:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E39B40C6F79; Wed, 25 Oct 2023 11:39:48 +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 461EC194658C; Wed, 25 Oct 2023 11:39:48 +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 AA89C19465BD for ; Wed, 25 Oct 2023 11:39:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9B1F7492BFB; Wed, 25 Oct 2023 11:39:47 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 248CF492BFA for ; Wed, 25 Oct 2023 11:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698233999; 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=3gsCO2nzqR3+4wPfP2vJKUG9K8qh07Nly3ZrEhnItIA=; b=WXtgAcfi2sry9RpC0Wa9keG6mIrGuM1vKu96LuWxnAB2GBNXgUJImnjSNyZDnUT69lLMGT /T3RI33gja7VJd+wnuOtujq/x8DLmuWLP4OzhWywcy+hWzF0mKEDBJtyvQeHWbng96jbUM AklCspeuK/nN7pAJqe/jFcGgZoz9g2A= X-MC-Unique: QvshuT_iPUaaBHmMmbWJYQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/22] conf: Move definition of some disk type enums to a common header Date: Wed, 25 Oct 2023 13:39:15 +0200 Message-ID: <90022a9d93b1d567bca967bd5310ec2927f5f8ac.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.2 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: 1698234001302100002 Content-Type: text/plain; charset="utf-8" Certain disk config fields are mirrored between the disk and storage source definitions. We nee Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.h | 37 ------------------------------------- src/conf/virconftypes.h | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9e6dd930fa..98f99721f0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -413,17 +413,6 @@ typedef enum { VIR_DOMAIN_DISK_BUS_LAST } virDomainDiskBus; -typedef enum { - VIR_DOMAIN_DISK_CACHE_DEFAULT, - VIR_DOMAIN_DISK_CACHE_DISABLE, - VIR_DOMAIN_DISK_CACHE_WRITETHRU, - VIR_DOMAIN_DISK_CACHE_WRITEBACK, - VIR_DOMAIN_DISK_CACHE_DIRECTSYNC, - VIR_DOMAIN_DISK_CACHE_UNSAFE, - - VIR_DOMAIN_DISK_CACHE_LAST -} virDomainDiskCache; - typedef enum { VIR_DOMAIN_DISK_ERROR_POLICY_DEFAULT, VIR_DOMAIN_DISK_ERROR_POLICY_STOP, @@ -451,32 +440,6 @@ typedef enum { VIR_DOMAIN_DISK_TRANS_LAST } virDomainDiskGeometryTrans; -typedef enum { - VIR_DOMAIN_DISK_IO_DEFAULT =3D 0, - VIR_DOMAIN_DISK_IO_NATIVE, - VIR_DOMAIN_DISK_IO_THREADS, - VIR_DOMAIN_DISK_IO_URING, - - VIR_DOMAIN_DISK_IO_LAST -} virDomainDiskIo; - -typedef enum { - VIR_DOMAIN_DISK_DISCARD_DEFAULT =3D 0, - VIR_DOMAIN_DISK_DISCARD_UNMAP, - VIR_DOMAIN_DISK_DISCARD_IGNORE, - - VIR_DOMAIN_DISK_DISCARD_LAST -} virDomainDiskDiscard; - -typedef enum { - VIR_DOMAIN_DISK_DETECT_ZEROES_DEFAULT =3D 0, - VIR_DOMAIN_DISK_DETECT_ZEROES_OFF, - VIR_DOMAIN_DISK_DETECT_ZEROES_ON, - VIR_DOMAIN_DISK_DETECT_ZEROES_UNMAP, - - VIR_DOMAIN_DISK_DETECT_ZEROES_LAST -} virDomainDiskDetectZeroes; - typedef enum { VIR_DOMAIN_DISK_MODEL_DEFAULT =3D 0, VIR_DOMAIN_DISK_MODEL_VIRTIO, diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index e07f967814..26cb966194 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -1,5 +1,5 @@ /* - * virconftypes.h: struct typedefs to avoid circular inclusion + * virconftypes.h: struct and enum type definitions to avoid circular incl= usion * * Copyright (C) 2006-2019 Red Hat, Inc. * Copyright (C) 2006-2008 Daniel P. Berrange @@ -261,3 +261,40 @@ typedef struct _virDomainXMLOption virDomainXMLOption; typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCa= llbacks; typedef struct _virDomainXenbusControllerOpts virDomainXenbusControllerOpt= s; + +typedef enum { + VIR_DOMAIN_DISK_IO_DEFAULT =3D 0, + VIR_DOMAIN_DISK_IO_NATIVE, + VIR_DOMAIN_DISK_IO_THREADS, + VIR_DOMAIN_DISK_IO_URING, + + VIR_DOMAIN_DISK_IO_LAST +} virDomainDiskIo; + +typedef enum { + VIR_DOMAIN_DISK_CACHE_DEFAULT =3D 0, + VIR_DOMAIN_DISK_CACHE_DISABLE, + VIR_DOMAIN_DISK_CACHE_WRITETHRU, + VIR_DOMAIN_DISK_CACHE_WRITEBACK, + VIR_DOMAIN_DISK_CACHE_DIRECTSYNC, + VIR_DOMAIN_DISK_CACHE_UNSAFE, + + VIR_DOMAIN_DISK_CACHE_LAST +} virDomainDiskCache; + +typedef enum { + VIR_DOMAIN_DISK_DISCARD_DEFAULT =3D 0, + VIR_DOMAIN_DISK_DISCARD_UNMAP, + VIR_DOMAIN_DISK_DISCARD_IGNORE, + + VIR_DOMAIN_DISK_DISCARD_LAST +} virDomainDiskDiscard; + +typedef enum { + VIR_DOMAIN_DISK_DETECT_ZEROES_DEFAULT =3D 0, + VIR_DOMAIN_DISK_DETECT_ZEROES_OFF, + VIR_DOMAIN_DISK_DETECT_ZEROES_ON, + VIR_DOMAIN_DISK_DETECT_ZEROES_UNMAP, + + VIR_DOMAIN_DISK_DETECT_ZEROES_LAST +} virDomainDiskDetectZeroes; --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698233999; cv=none; d=zohomail.com; s=zohoarc; b=Rrp6CKD7JaEqBV1VHSjYZXu69YKTYBbjATUL9q2NVHzKJP6yh4gfJB+ImtiSmcKHpABFMsYtiWr3lKnFE2+utp3QLszfxzNaE9wYExSYFK7z1asHxm5z2Vd+ubfj3xkcGKMCEKisP16GJi7jtYRTFou3R8LJ9AiR7qud/JKIhtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233999; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=XeF3YOnAf+6eRCG1zrn7LL/xZ/va2DP2yxXQLGjt4qE=; b=FbVCVj6m0SDeWA7647hHZo1+w1glIyJ+OXYoJ5C2Y1cFfwHNWHzxWo7v34AsZCIS9hM4+zY2gND0aF2WLcan8f+N+1za9S4XLtO40UXecmv87gBNLXLTTQtiWsm25CDs1tKmUsppecOtMCU2Va21TQ4lyzzdOoHPCOBOzUFClsQ= 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 1698233999832163.07055012863452; Wed, 25 Oct 2023 04:39:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-tyPxDUHQNNC-SADbUNf2dQ-1; Wed, 25 Oct 2023 07:39:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CFEF185A78F; Wed, 25 Oct 2023 11:39:49 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7822D8C0A; Wed, 25 Oct 2023 11:39:49 +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 6ED49194658C; Wed, 25 Oct 2023 11:39:49 +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 7658619465B6 for ; Wed, 25 Oct 2023 11:39:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6B7A4492BFC; Wed, 25 Oct 2023 11:39:48 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBC6E492BFA for ; Wed, 25 Oct 2023 11:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698233998; 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=XeF3YOnAf+6eRCG1zrn7LL/xZ/va2DP2yxXQLGjt4qE=; b=JJVmOVrzDGWg7ztHhkO6bWS84n188Gp4+ZsO5BGpo0mwo5AT9VhHVO3iL74zO0kIEKlOey JU7wazN79vL1ImhkbfmThvHYMZDR+BnCscaK1I11R332bdZQG+Zp6yk+cRbXo69He7up3O vmaAfUtx1+ZllnxIcGGX/2GbUhC+j/s= X-MC-Unique: tyPxDUHQNNC-SADbUNf2dQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/22] virStorageSource: Use proper type for shadow copies of iomode/cachemode/discard/detect_zeroes Date: Wed, 25 Oct 2023 13:39:16 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.5 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: 1698234001301100001 Content-Type: text/plain; charset="utf-8" The aforementioned fields in virStorageSource struct are copies of the disk properties, but were not converted to the proper type yet. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/storage_source_conf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index 2db780611e..5e7d127453 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -397,10 +397,10 @@ struct _virStorageSource { /* Libvirt currently stores the following properties in virDomainDiskD= ef. * These instances are currently just copies from the parent definitio= n and * are not mapped back to the XML */ - int iomode; /* enum virDomainDiskIo */ - int cachemode; /* enum virDomainDiskCache */ - int discard; /* enum virDomainDiskDiscard */ - int detect_zeroes; /* enum virDomainDiskDetectZeroes */ + virDomainDiskIo iomode; + virDomainDiskCache cachemode; + virDomainDiskDiscard discard; + virDomainDiskDetectZeroes detect_zeroes; virTristateSwitch discard_no_unref; bool floppyimg; /* set to true if the storage source is going to be us= ed --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234024; cv=none; d=zohomail.com; s=zohoarc; b=PC39lJCzIdRMawsX66MfD7iIFj5eB6gLxNJvA907wbea0UzJvUE+RfRyDh4vgdauyzE5c9iJFgbD3RnTwqWpXu1F69oKfAMBDo1oAPnEC03TIhlIARbwes/C/piR0FTxDTmTnBv/cm4KOx0N6cVlV0uHDC9CkK0euIK9PAYGCzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234024; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=i429SgVDmoNwzGkOnt0fHxhBVKTIzyLMRPEC0qg8y0I=; b=NvPNtnqTd5cAiNZvFv+oXrs/vAJvKW/oJ9EyeNpWArW1tcCajTAssrxXu971sF03+J3DhSdu1S8v7uIgVIsnoDsDK+GHOAi9zvxzgrMaztFDilFXArLmreuqqxi/eKd6KwlBsN0Pi8IFMQDWjexWs0vy2Ta+qii1E5uAihhjfp8= 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 1698234024351459.95372224823154; Wed, 25 Oct 2023 04:40:24 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-108-LegDdRK2MASsZwVGdNjLwQ-1; Wed, 25 Oct 2023 07:40:06 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B37481654A; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00A4220268F8; Wed, 25 Oct 2023 11:39:50 +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 94C7119466E6; Wed, 25 Oct 2023 11:39:49 +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 4DF791946586 for ; Wed, 25 Oct 2023 11:39:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3D8B6492BFB; Wed, 25 Oct 2023 11:39:49 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0A7C492BFA for ; Wed, 25 Oct 2023 11:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234023; 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=i429SgVDmoNwzGkOnt0fHxhBVKTIzyLMRPEC0qg8y0I=; b=BoxWVdUVzgeCblGZyxqmxYth9pGs2Cj4Qew7AOwa7actBP3cujedc4DVdOsQjWr6pGXQGb myjo5QaW/WpHz8JbO8luATUOwRPadLfzNZdSiZWyA0F+bdhIRiN0sCAa3jaNg8aZ7TRUDO FiFBZyiQnvo+ThD4Dj57vgbyEwtBOkU= X-MC-Unique: LegDdRK2MASsZwVGdNjLwQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/22] qemuDomainDiskCachemodeFlags: Simplify usage Date: Wed, 25 Oct 2023 13:39:17 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.4 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: 1698234025444100009 Content-Type: text/plain; charset="utf-8" Return whether a relevant cachemode was presented rather than returning an error, so that callers can be simplified. Use the proper enum type as argument rather than typecasting in the switch statement. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 5 +---- src/qemu/qemu_command.c | 15 ++++++--------- src/qemu/qemu_domain.c | 31 +++++++++++++++++-------------- src/qemu/qemu_domain.h | 4 ++-- 4 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 3be12b47e3..0f47b5b37f 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -919,12 +919,9 @@ qemuBlockStorageSourceGetBlockdevGetCacheProps(virStor= ageSource *src, bool direct =3D false; bool noflush =3D false; - if (src->cachemode =3D=3D VIR_DOMAIN_DISK_CACHE_DEFAULT) + if (!qemuDomainDiskCachemodeFlags(src->cachemode, NULL, &direct, &nofl= ush)) return 0; - if (qemuDomainDiskCachemodeFlags(src->cachemode, NULL, &direct, &noflu= sh) < 0) - return -1; - if (virJSONValueObjectAdd(&cacheobj, "b:direct", direct, "b:no-flush", noflush, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index dbef8d0068..fd0f12f304 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1889,16 +1889,13 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, wwn =3D virJSONValueNewNumberUlong(w); } - if (disk->cachemode !=3D VIR_DOMAIN_DISK_CACHE_DEFAULT) { - /* VIR_DOMAIN_DISK_DEVICE_LUN translates into 'scsi-block' - * where any caching setting makes no sense. */ - if (disk->device !=3D VIR_DOMAIN_DISK_DEVICE_LUN) { - bool wb; - - if (qemuDomainDiskCachemodeFlags(disk->cachemode, &wb, NULL, - NULL) < 0) - return NULL; + /* 'write-cache' component of disk->cachemode is set on device level. + * VIR_DOMAIN_DISK_DEVICE_LUN translates into 'scsi-block' where any + * caching setting makes no sense. */ + if (disk->device !=3D VIR_DOMAIN_DISK_DEVICE_LUN) { + bool wb; + if (qemuDomainDiskCachemodeFlags(disk->cachemode, &wb, NULL, NULL)= ) { writeCache =3D virTristateSwitchFromBool(wb); } } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 995aa3f79c..0b36a49bdf 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11406,13 +11406,18 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hos= tdev, /** * qemuDomainDiskCachemodeFlags: + * @cachemode: aggregated cache mode + * @writeback: populated with 'writeback' component of @cachemode (may be = NULL) + * @direct: populated with 'direct' component of @cachemode (may be NULL) + * @noflush: populated with 'noflush' component of @cachemode (may be NULL) * - * Converts disk cachemode to the cache mode options for qemu. Returns -1 = for - * invalid @cachemode values and fills the flags and returns 0 on success. - * Flags may be NULL. + * Converts disk @cachemode to the cache mode options for qemu according t= o the + * table below. + * + * Returns true if @cachemode is a relevant cache mode setting. */ -int -qemuDomainDiskCachemodeFlags(int cachemode, +bool +qemuDomainDiskCachemodeFlags(virDomainDiskCache cachemode, bool *writeback, bool *direct, bool *noflush) @@ -11442,40 +11447,38 @@ qemuDomainDiskCachemodeFlags(int cachemode, *writeback =3D true; *direct =3D true; *noflush =3D false; - break; + return true; case VIR_DOMAIN_DISK_CACHE_WRITETHRU: *writeback =3D false; *direct =3D false; *noflush =3D false; - break; + return true; case VIR_DOMAIN_DISK_CACHE_WRITEBACK: *writeback =3D true; *direct =3D false; *noflush =3D false; - break; + return true; case VIR_DOMAIN_DISK_CACHE_DIRECTSYNC: *writeback =3D false; *direct =3D true; *noflush =3D false; - break; + return true; case VIR_DOMAIN_DISK_CACHE_UNSAFE: *writeback =3D true; *direct =3D false; *noflush =3D true; - break; + return true; case VIR_DOMAIN_DISK_CACHE_DEFAULT: case VIR_DOMAIN_DISK_CACHE_LAST: - default: - virReportEnumRangeError(virDomainDiskCache, cachemode); - return -1; + return false; } - return 0; + return false; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index a3fc6acaaa..1e56e50672 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1008,8 +1008,8 @@ qemuDomainPrepareDiskSource(virDomainDiskDef *disk, qemuDomainObjPrivate *priv, virQEMUDriverConfig *cfg); -int -qemuDomainDiskCachemodeFlags(int cachemode, +bool +qemuDomainDiskCachemodeFlags(virDomainDiskCache cachemode, bool *writeback, bool *direct, bool *noflush); --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234007; cv=none; d=zohomail.com; s=zohoarc; b=g33rAG19+ifWbqxMtHlP5IPUfJIigSg+54nuwqjoRiikY4PytkpJHPnV1jrJyGCDBnNqrPtM4l9cVJmkrIGlILPtuIYtTp5GWSbP8KsHXZdp3BwBzDg601pHB4Tbrd67YBS8IUjTM8Y+0TM/tfujhiAWFpFVjV+unEV/lxqBEP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234007; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=IW2LZDVaM57e7JFuJTziSXylDBK3UTsCKDxqifuHQ98=; b=e2OqqAV9SDNdoKMGsosueO+WpkYNv1BbPzMEZoxy5u2E9Mo6KWvKXSZoXR6UubVfUOqPsp3U9IbCg+PQR8e91i4wjGQy6GA/zgPZVzCIHgvNDXybDCl9UQrkUaUfg0Pqh2fbVxLDGcMIp/525ltrQxuA2Q04lzfJdI2JI7BvskA= 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 1698234006989897.2064162155561; Wed, 25 Oct 2023 04:40:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-214-OtCkXrxbNiqgMfBKdMilVg-1; Wed, 25 Oct 2023 07:39:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D52738125B7; Wed, 25 Oct 2023 11:39:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 430C240C6F7B; Wed, 25 Oct 2023 11:39:51 +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 E42E619465BB; Wed, 25 Oct 2023 11:39:50 +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 1DCC51946586 for ; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 09CD5492BFB; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A45D492BFA for ; Wed, 25 Oct 2023 11:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234005; 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=IW2LZDVaM57e7JFuJTziSXylDBK3UTsCKDxqifuHQ98=; b=E7BLmQHvkb3psBWifMdR+ivDc858lnEN7u4gkkuEVXGyxTHQoesQIHcrG3eDGjlwGwtTI+ ryduTDw8WCeTqxHk4ZW/OVEplWojvSfQ2xBKBypG53Hbe21T7xba8hYPDaImqSIfGntgFo b3LoZYAqkerfAJRYWcrpKutFNnNN6c0= X-MC-Unique: OtCkXrxbNiqgMfBKdMilVg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 08/22] qemuBlockStorageSourceGetBlockdevGetCacheProps: Return the cache object rather than appending it Date: Wed, 25 Oct 2023 13:39:18 +0200 Message-ID: <672363420262573e0faebd47e5c7f9f5f9a968f1.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.2 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: 1698234007379100004 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 29 ++++++++++++++++------------- src/qemu/qemu_domain.c | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0f47b5b37f..41038fb994 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -913,24 +913,20 @@ qemuBlockStorageSourceGetVhostVdpaProps(virStorageSou= rce *src) static int qemuBlockStorageSourceGetBlockdevGetCacheProps(virStorageSource *src, - virJSONValue *props) + virJSONValue **cache) { - g_autoptr(virJSONValue) cacheobj =3D NULL; bool direct =3D false; bool noflush =3D false; if (!qemuDomainDiskCachemodeFlags(src->cachemode, NULL, &direct, &nofl= ush)) return 0; - if (virJSONValueObjectAdd(&cacheobj, + if (virJSONValueObjectAdd(cache, "b:direct", direct, "b:no-flush", noflush, NULL) < 0) return -1; - if (virJSONValueObjectAppend(props, "cache", &cacheobj) < 0) - return -1; - return 0; } @@ -1109,10 +1105,13 @@ qemuBlockStorageSourceGetBackendProps(virStorageSou= rce *src, return NULL; if (!legacy) { - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, filepr= ops) < 0) + g_autoptr(virJSONValue) cache =3D NULL; + + if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache= ) < 0) return NULL; if (virJSONValueObjectAdd(&fileprops, + "A:cache", &cache, "T:read-only", ro, "T:auto-read-only", aro, NULL) < 0) @@ -1278,10 +1277,14 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(= virStorageSource *src) int detectZeroesMode =3D virDomainDiskGetDetectZeroesMode(src->discard, src->detect_ze= roes); g_autoptr(virJSONValue) props =3D NULL; + g_autoptr(virJSONValue) cache =3D NULL; if (qemuBlockNodeNameValidate(qemuBlockStorageSourceGetFormatNodename(= src)) < 0) return NULL; + if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache) < 0) + return NULL; + if (src->discard) discard =3D virDomainDiskDiscardTypeToString(src->discard); @@ -1297,12 +1300,10 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(= virStorageSource *src) "b:read-only", src->readonly, "S:discard", discard, "S:detect-zeroes", detectZeroes, + "A:cache", &cache, NULL) < 0) return NULL; - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, props) < 0) - return NULL; - return g_steal_pointer(&props); } @@ -1439,10 +1440,14 @@ static virJSONValue * qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src) { g_autoptr(virJSONValue) props =3D NULL; + g_autoptr(virJSONValue) cache =3D NULL; if (qemuBlockNodeNameValidate(src->sliceStorage->nodename) < 0) return NULL; + if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache) < 0) + return NULL; + if (virJSONValueObjectAdd(&props, "s:driver", "raw", "s:node-name", src->sliceStorage->nodename, @@ -1451,12 +1456,10 @@ qemuBlockStorageSourceGetBlockdevStorageSliceProps(= virStorageSource *src) "s:file", qemuBlockStorageSourceGetStorageNo= dename(src), "b:auto-read-only", true, "s:discard", "unmap", + "A:cache", &cache, NULL) < 0) return NULL; - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, props) < 0) - return NULL; - return g_steal_pointer(&props); } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0b36a49bdf..ae19ce884b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11442,7 +11442,7 @@ qemuDomainDiskCachemodeFlags(virDomainDiskCache cac= hemode, * directsync \ufffd\ufffd\ufffd false true fa= lse * unsafe \ufffd\ufffd\ufffd true false tr= ue */ - switch ((virDomainDiskCache) cachemode) { + switch (cachemode) { case VIR_DOMAIN_DISK_CACHE_DISABLE: /* 'none' */ *writeback =3D true; *direct =3D true; --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234069; cv=none; d=zohomail.com; s=zohoarc; b=Ux5P0Utw5MZRJlZ7e0PGdAQGuB5hSZQvaPHQB+78UggMsjjoqmTwiES8X2x/baoKtDJ1MfHIySpMAXMGKFn8td4VLuFFbAAhVwI9QgCqoGo4/iGJNMAGnuiVoY6HgpOqIgZFwc2JllgGHeyELLynwqirBjMX/Bro/qAelJola+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234069; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=CGfTtRp212B594MeVk6Q/Lt7D0MFnD4oPaS2qNCOwGc=; b=ifUaZgvMaIRYhpxxqWGDMGuUaoxC4KxVOckq2gB4EVHUo+8aHYQ8DWiQ9wbzHfqwU+q/N1lhB+gQLxUUAFZkRUIImPts2OF0mOQPOO9ectRAOGAjHYkNPoPYoNysvlHDqNDO6DsvSieqRta5+X0votAWQchZBEC4gNOHrrGp4x4= 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 1698234069620313.4791310441466; Wed, 25 Oct 2023 04:41:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-ljVPjZh3NQy8JIBaFtDmaw-1; Wed, 25 Oct 2023 07:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5596080E993; Wed, 25 Oct 2023 11:39:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D9DB40C6F7D; Wed, 25 Oct 2023 11:39:52 +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 2BC1A194658C; Wed, 25 Oct 2023 11:39:52 +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 F242D19466E7 for ; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D3208492BFC; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F5E4492BFA for ; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234068; 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=CGfTtRp212B594MeVk6Q/Lt7D0MFnD4oPaS2qNCOwGc=; b=U83xriFHvIysm6g/LJnaOA6owZe5ElI8qA4rzgJRYCpnLSWtYqM+5aODakSNvPtqrOICd7 2kWb8mZ+r8oGpgaLTqjagOpafa5bsKycLzKn6Q4AGa5qCNuJG1rmhQspZK//WQQXNcoGiW hzL4GQkOM1d8Ml7Gnb4VjzW0uKFZ9O8= X-MC-Unique: ljVPjZh3NQy8JIBaFtDmaw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/22] qemublocktest: Use "target only" mode in 'testJSONtoJSON' and 'testBackingXMLjsonXML' Date: Wed, 25 Oct 2023 13:39:19 +0200 Message-ID: <261771f7c1664e5050cb5ca4c6dbffcb7d0d14ca.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.2 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: 1698234071538100002 Content-Type: text/plain; charset="utf-8" Both tests pass a disk source definition which didn't go through the preparation steps and thus contains only the target information that were originally present, thus we should be using the QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY flag. For the same reason QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY used in 'testJSONtoJSON' doesn't make sense. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemublocktest.c | 4 ++-- tests/qemublocktestdata/jsontojson/curl-libguestfs-out.json | 5 ++--- .../jsontojson/ssh-passthrough-libguestfs-out.json | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index addd646071..ce76150200 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -59,7 +59,7 @@ testBackingXMLjsonXML(const void *args) g_autoptr(virStorageSource) xmlsrc =3D NULL; g_autoptr(virStorageSource) jsonsrc =3D NULL; g_auto(virBuffer) debug =3D VIR_BUFFER_INITIALIZER; - unsigned int backendpropsflags =3D 0; + unsigned int backendpropsflags =3D QEMU_BLOCK_STORAGE_SOURCE_BACKEND_P= ROPS_TARGET_ONLY; if (data->legacy) backendpropsflags |=3D QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEG= ACY; @@ -157,7 +157,7 @@ testJSONtoJSON(const void *args) } if (!(jsonsrcout =3D qemuBlockStorageSourceGetBackendProps(src, - QEMU_BLOCK_ST= ORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY))) { + QEMU_BLOCK_ST= ORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY))) { fprintf(stderr, "failed to format disk source json\n"); return -1; } diff --git a/tests/qemublocktestdata/jsontojson/curl-libguestfs-out.json b/= tests/qemublocktestdata/jsontojson/curl-libguestfs-out.json index e130c7bd3c..8cfacb5bc8 100644 --- a/tests/qemublocktestdata/jsontojson/curl-libguestfs-out.json +++ b/tests/qemublocktestdata/jsontojson/curl-libguestfs-out.json @@ -2,8 +2,7 @@ "driver": "https", "url": "https://test.host:443/whatever.img", "sslverify": false, + "cookie": "some_cookie=3D\"some_value_or_whatever\"", "timeout": 2000, - "readahead": 65536, - "auto-read-only": true, - "discard": "unmap" + "readahead": 65536 } diff --git a/tests/qemublocktestdata/jsontojson/ssh-passthrough-libguestfs-= out.json b/tests/qemublocktestdata/jsontojson/ssh-passthrough-libguestfs-ou= t.json index 1f6032deb4..7855917e2e 100644 --- a/tests/qemublocktestdata/jsontojson/ssh-passthrough-libguestfs-out.json +++ b/tests/qemublocktestdata/jsontojson/ssh-passthrough-libguestfs-out.json @@ -8,7 +8,5 @@ "user": "testuser", "host-key-check": { "mode": "none" - }, - "auto-read-only": true, - "discard": "unmap" + } } --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234022; cv=none; d=zohomail.com; s=zohoarc; b=hetDXPLoKYEco+phsI6bUwd8mZ68mEVtpKlpI79OCxSTIJzwxzESD8RhXQWBRJJG+DiJO76VOMdSRTmBMm0LyIo1tMoppLZ3T6G7vnPGN2UVZ+tqHEPi0vMHgK+ye7aKYpjwbQql38M7k9gjozH+0D/mVT67VSWAsUSpSV0buKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234022; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=tjQtXPk2fjilkWCI2sgRrNNDDyLL3OS5Ed8M4fynT3Y=; b=W/X81gK1KOwWAwBNRrFKry0kX8vN45HEDe8oKKhr2Hl0J19mUl6HOMJjJ62KBz09Eq2qkvs6I8OHcawavDY96VFaIyOvi9ewAQEHdz7l+zY48f5k2oM+9W/i3FjlSp1E790Y0KoGT0MlLmDOlkjc3ojp6Z9fXL3BBc4nE0Sx/Wc= 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 1698234022782327.57603211485684; Wed, 25 Oct 2023 04:40:22 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-6-167MKix0Ps6qquK794Gkfg-1; Wed, 25 Oct 2023 07:40:03 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2299C84B10C; Wed, 25 Oct 2023 11:39:55 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04D391121320; Wed, 25 Oct 2023 11:39:55 +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 D129019465A4; Wed, 25 Oct 2023 11:39:54 +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 C0C5B1946586 for ; Wed, 25 Oct 2023 11:39:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A2C29492BFB; Wed, 25 Oct 2023 11:39:51 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C771492BFA for ; Wed, 25 Oct 2023 11:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234021; 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=tjQtXPk2fjilkWCI2sgRrNNDDyLL3OS5Ed8M4fynT3Y=; b=RCUxEZZ4ykCXVmNtImxZxiUGrFtQELfikg/2W0cfJbZ+eHlEHW475tzUgZqUYBGTsE57zh md90Jah+9i85bQSDkvMBh7zBu8t5QMIBtNtG8lsBUz1arGV+sJJmypkb7vPn8dFgJw6M09 uXaKe8sTOgnbOeiLiq6IE+D5CAjz14M= X-MC-Unique: 167MKix0Ps6qquK794Gkfg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/22] qemublocktest: Drop 'sheepdog' and 'vxhs' test cases Date: Wed, 25 Oct 2023 13:39:20 +0200 Message-ID: <5065efe58f865458c0c8f5ec4aa1b7f84d30ac3f.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.3 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: 1698234023370100007 Content-Type: text/plain; charset="utf-8" QEMU deprecated and removed support for those protocols, but due to a logic bug in the tests it was not caught. Remove the test cases first. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemublocktest.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index ce76150200..a89dddf002 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1084,12 +1084,6 @@ mymain(void) TEST_JSON_FORMAT_NET("\n" " \n" "\n"); - TEST_JSON_FORMAT_NET("\n" - " \n" - "\n"); - TEST_JSON_FORMAT_NET("\n" - " \n" - "\n"); #define TEST_DISK_TO_JSON_FULL(nme, fl) \ do { \ --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234065; cv=none; d=zohomail.com; s=zohoarc; b=TyxtY6fGRte1JqTzzig5opFqQPj5FhZFxtO2jdXuDiaYEaws9yca/2azGpn3dX3jGZcQNrkYr2D4rRulo8ZEKd4viTFhKMdKuYtglta8w2nXXUNDxmKLua8QiMPUxbOOnRm9fKpyvmYME3XZmzvcH29kQgOiTiBqYgGXAKv3SgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234065; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=s8LISkaxZUFXzCb+6pLDqnObtuqiDk0GZEY4ow3R8/s=; b=C0YUMwgsOHNV4X2ddtjVuPAUKi0/xEW60fxeg1pNVjpnGQtB1pGlApAZxsqUy72jfBGG9IU9Y65ujFfVwGzQZeJPhV1gjRLtd9AHGrT5EVKHsvCj8wgxXBbXXM1RPbLXInFg699uuamOxsxLBEqpL+7Y+uz92Wo9iUZ/O5Vv7EE= 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 1698234065887326.89389614498873; Wed, 25 Oct 2023 04:41:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-wcOJSg2UPTSKXTUBOo449A-1; Wed, 25 Oct 2023 07:40:11 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90470811E92; Wed, 25 Oct 2023 11:39:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CB0940C6F79; Wed, 25 Oct 2023 11:39:54 +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 61484194658D; Wed, 25 Oct 2023 11:39:54 +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 94ED0194658D for ; Wed, 25 Oct 2023 11:39:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 78156492BFB; Wed, 25 Oct 2023 11:39:52 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0418E492BFA for ; Wed, 25 Oct 2023 11:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234064; 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=s8LISkaxZUFXzCb+6pLDqnObtuqiDk0GZEY4ow3R8/s=; b=YAqvxAnPh/wsaTJ44PGwKozYft7VMdAMFkqH4TZmOd8Be5AIDpMpMXxJBL5pTE+J/UDzIb dANHF+ynPIpIDwF47S4xzXmSgwaWJZA6lQm35La3TJxP+SfSdDvcrIN05QAqcFyaYs/Z9h AixW/LdJ14AQ9xI4vCscWWM9w50QATo= X-MC-Unique: wcOJSg2UPTSKXTUBOo449A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/22] qemublocktest: Fix logical bug in TEST_JSON_FORMAT macro Date: Wed, 25 Oct 2023 13:39:21 +0200 Message-ID: <1db25a4a97f67c6b81a2c2df5f21a10e7da18f48.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.2 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: 1698234067548100002 Content-Type: text/plain; charset="utf-8" Condition handling failure of the first virTestRun was lacking the 'ret =3D -1' line thus the subsequent line was taken as it's body rendering the first invocation useless. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemublocktest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index a89dddf002..161fd84871 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1015,6 +1015,7 @@ mymain(void) xmljsonxmldata.legacy =3D true; \ if (virTestRun(virTestCounterNext(), testBackingXMLjsonXML, \ &xmljsonxmldata) < 0) \ + ret =3D -1; \ xmljsonxmldata.legacy =3D false; \ if (virTestRun(virTestCounterNext(), testBackingXMLjsonXML, \ &xmljsonxmldata) < 0) \ --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234070; cv=none; d=zohomail.com; s=zohoarc; b=dgwaxRFwSEeD7XDhLUhDTsHfm/USMQp2E9DROOzhtt2F7BzKQnL/llhXKLr9nXDi2kSaLmn3FysEzxDk+fYzeTK0a2RulT+l5rX3jn18fKPxhA3QHp5jHwzzbH9Tm2lYI0aFlBp/vgsUaT8CkvS6XaUpCkr0gBoq8KZlTpK7pC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234070; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=nfVdSSDrAxi24nws2n5CkqyvhIesQZqlR0i9CpjYdbU=; b=DnkV8UxdE8UthX7qmTCPM3yU+1qzvGrdqvh/Ve8oaqpvC2YBOHEAfJI6oGMmz90FavWtcaEFXr7B3O1rSW+IkDuuBp5/ZXbicBzEUrwLlMujgJh0HP7V0H/0peocjuNaNPiW9HO4uROKxma6LcD8MIr4WiwHJAlCmpYhHkjer2w= 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 1698234070266498.1526242545625; Wed, 25 Oct 2023 04:41:10 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-X4bPhDz8MgGyMLq7gVJLTg-1; Wed, 25 Oct 2023 07:40:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5270A84B117; Wed, 25 Oct 2023 11:39:55 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39E362026D6E; Wed, 25 Oct 2023 11:39:55 +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 1B3B91946595; Wed, 25 Oct 2023 11:39:55 +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 839D31946586 for ; Wed, 25 Oct 2023 11:39:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6534F492BFC; Wed, 25 Oct 2023 11:39:53 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4A89492BFA for ; Wed, 25 Oct 2023 11:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234069; 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=nfVdSSDrAxi24nws2n5CkqyvhIesQZqlR0i9CpjYdbU=; b=ivpyI3VcayuG/nzUPzDwu+iflGZijCFVTfvWs2dBRm5F0fxTpuBrK6jiMeVC5Gqmp1mxA6 wQoscSUg4BVBDKgF+EelI3XGWgwQG+Eigex5Ko+3bCQy2lkQSxYSTaVp5DHLN5InZPqSTF qIOYYMzjFGi5aYK/txhDPdzLwqiC0Ec= X-MC-Unique: X4bPhDz8MgGyMLq7gVJLTg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/22] qemublocktest: testBackingXMLjsonXML: Drop 'legacy' mode Date: Wed, 25 Oct 2023 13:39:22 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.4 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: 1698234071532100001 Content-Type: text/plain; charset="utf-8" Legacy mode used to be needed for use with -drive, which was almost completely deleted. We now have qemuxml2argvtest test cases checking a few cases and the rest uses the modern mode only. Thus we don't need to test the legacy mode any more. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemublocktest.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 161fd84871..b8db1a2570 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -61,8 +61,6 @@ testBackingXMLjsonXML(const void *args) g_auto(virBuffer) debug =3D VIR_BUFFER_INITIALIZER; unsigned int backendpropsflags =3D QEMU_BLOCK_STORAGE_SOURCE_BACKEND_P= ROPS_TARGET_ONLY; - if (data->legacy) - backendpropsflags |=3D QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEG= ACY; xmlsrc =3D virStorageSourceNew(); xmlsrc->type =3D data->type; @@ -81,17 +79,15 @@ testBackingXMLjsonXML(const void *args) return -1; } - if (!data->legacy) { - if (testQEMUSchemaValidate(backendprops, data->schemaroot, - data->schema, false, &debug) < 0) { - g_autofree char *debugmsg =3D virBufferContentAndReset(&debug); - g_autofree char *debugprops =3D virJSONValueToString(backendpr= ops, true); + if (testQEMUSchemaValidate(backendprops, data->schemaroot, + data->schema, false, &debug) < 0) { + g_autofree char *debugmsg =3D virBufferContentAndReset(&debug); + g_autofree char *debugprops =3D virJSONValueToString(backendprops,= true); - VIR_TEST_VERBOSE("json does not conform to QAPI schema"); - VIR_TEST_DEBUG("json:\n%s\ndoes not match schema. Debug output= :\n %s", - debugprops, NULLSTR(debugmsg)); - return -1; - } + VIR_TEST_VERBOSE("json does not conform to QAPI schema"); + VIR_TEST_DEBUG("json:\n%s\ndoes not match schema. Debug output:\n = %s", + debugprops, NULLSTR(debugmsg)); + return -1; } if (virJSONValueObjectAdd(&wrapper, "a:file", &backendprops, NULL) < 0) @@ -1012,11 +1008,6 @@ mymain(void) do { \ xmljsonxmldata.type =3D tpe; \ xmljsonxmldata.xml =3D xmlstr; \ - xmljsonxmldata.legacy =3D true; \ - if (virTestRun(virTestCounterNext(), testBackingXMLjsonXML, \ - &xmljsonxmldata) < 0) \ - ret =3D -1; \ - xmljsonxmldata.legacy =3D false; \ if (virTestRun(virTestCounterNext(), testBackingXMLjsonXML, \ &xmljsonxmldata) < 0) \ ret =3D -1; \ --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234015; cv=none; d=zohomail.com; s=zohoarc; b=hbng9v/vfoXllCW6zTsAMb6EbyoK13k16lzlP2oV6IkQk+T/JiTcNNU3Ufgryn84V0ufvK30EWztI4YQdIoPKJfaGe1c71KLe7W2xOsn3LL0dKcStBUcOoGlg7jVc8Qvv8DIF+1zJc2BQQtlsGdjl3twss0TFlU7Fb6dFbP0OOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234015; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Ck0+IBYXRReuL3fkMcoZ5YL9zht6Sak4Tk9ut0cNjWc=; b=Ve1XNxvBHgLFd+QPCK9XV4KNkebItb2E7Muj/BKcqEZ9ai8kWbTEMYTgwPu2kLbOlFVD3AKXhGTqlcic/VUGG8d1Y7Dm7MgVifWYxc5THXHYBW6SxFam/DsTvRpkUaEzzvjDyid1fdJX7TESDpyb+UrZSnliYITIzWzO6mJ0LK4= 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 1698234015034331.72201952717455; Wed, 25 Oct 2023 04:40:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-83-SNXDlavFNhCjtF2OhnU7ZQ-1; Wed, 25 Oct 2023 07:40:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 91D961C02CB0; Wed, 25 Oct 2023 11:39:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79BF98C0B; Wed, 25 Oct 2023 11:39:56 +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 6A0C61946586; Wed, 25 Oct 2023 11:39:56 +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 55FA21946586 for ; Wed, 25 Oct 2023 11:39:54 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 38626492BFB; Wed, 25 Oct 2023 11:39:54 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0E10492BFA for ; Wed, 25 Oct 2023 11:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234014; 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=Ck0+IBYXRReuL3fkMcoZ5YL9zht6Sak4Tk9ut0cNjWc=; b=HugjQdn29X/gpqahlA/MvsDOaumnr9iYV9dPjf8k3DX093HhNf4LQXFjuRVLXp77jE4luL dmkhqjdWy9fswSpnZCzJoweKQASz4f14fP6hUZ++m2aa7ZrZIcvToAGCI1BqCUTY+wfWmh Xmy4jiSngsACerTTlXeoMJEP71HFd6Y= X-MC-Unique: SNXDlavFNhCjtF2OhnU7ZQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 13/22] qemuBlockStorageSourceGetBackendProps: Unify cases for '!onlytarget' and '!legacy' Date: Wed, 25 Oct 2023 13:39:23 +0200 Message-ID: <26a10b2f7b18a655adbd0210456552e664784479.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.5 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: 1698234015346100005 Content-Type: text/plain; charset="utf-8" At this point only a single code path (for formatting -drive for legacy SD cards) uses the 'legacy' output and that code path doesn't populate the node name. Thus we can unify the code block and simplify the JSON formatters. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 41038fb994..ca68b9ab66 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1097,32 +1097,28 @@ qemuBlockStorageSourceGetBackendProps(virStorageSou= rce *src, if (driver && virJSONValueObjectPrependString(fileprops, "driver", dri= ver) < 0) return NULL; - if (!onlytarget) { - if (qemuBlockNodeNameValidate(qemuBlockStorageSourceGetStorageNode= name(src)) < 0 || - virJSONValueObjectAdd(&fileprops, - "S:node-name", qemuBlockStorageSourceGet= StorageNodename(src), - NULL) < 0) - return NULL; + if (!onlytarget && !legacy) { + g_autoptr(virJSONValue) cache =3D NULL; + const char *discardstr =3D "unmap"; + const char *nodename =3D qemuBlockStorageSourceGetStorageNodename(= src); - if (!legacy) { - g_autoptr(virJSONValue) cache =3D NULL; + if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP) + discardstr =3D NULL; - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache= ) < 0) - return NULL; + if (qemuBlockNodeNameValidate(nodename) < 0) + return NULL; - if (virJSONValueObjectAdd(&fileprops, - "A:cache", &cache, - "T:read-only", ro, - "T:auto-read-only", aro, - NULL) < 0) - return NULL; + if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache) < = 0) + return NULL; - if (!(flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNM= AP) && - virJSONValueObjectAdd(&fileprops, - "s:discard", "unmap", - NULL) < 0) - return NULL; - } + if (virJSONValueObjectAdd(&fileprops, + "s:node-name", nodename, + "A:cache", &cache, + "T:read-only", ro, + "T:auto-read-only", aro, + "S:discard", discardstr, + NULL) < 0) + return NULL; } return g_steal_pointer(&fileprops); --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234012; cv=none; d=zohomail.com; s=zohoarc; b=G7LyAVR5reCcONgE8T8iOmh+VceBza6g7FT08ObsYzQcMW0yrin9gVQNh/BN0G3wzpkUzGYwcpy6jQrzKNH0Xc3tYe/cc2UIUM9w6hRHSqq3NoTU0VDxoKotkjXQvQccSv3JkAcAWp391GZ7KZG7/XOOT9EPBRGpMACDz7H9GZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234012; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=cnCsTDOylwbmemF32OpKG5k8adKmFsNJJBdx9FsIFGs=; b=O/Kjo7yOvpGS4Kofhuk24QeIuRwCAV/Seyz7WfBg7/Clp2mrye1jTot7iF3o3xPa7D/OJ3qAgKDfTf1wbkISwfF8xLZVygRO98hSxrdwyTjl/Fn7uKeE0I91vv+s26Xlegw+pxMOC6z9Prm4+aY04ZkcSzvAjI3nHF4GOXOU18o= 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 1698234012975347.1822387956113; Wed, 25 Oct 2023 04:40:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-J3AiK0K6MJi4KvTZ8PD6Fg-1; Wed, 25 Oct 2023 07:40:07 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3CCD80D629; Wed, 25 Oct 2023 11:39:55 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA3BE1C060BA; Wed, 25 Oct 2023 11:39:55 +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 9F4751946595; Wed, 25 Oct 2023 11:39:55 +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 0E835194658D for ; Wed, 25 Oct 2023 11:39:55 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 022C4492BFB; Wed, 25 Oct 2023 11:39:55 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 851CE492BFC for ; Wed, 25 Oct 2023 11:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234012; 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=cnCsTDOylwbmemF32OpKG5k8adKmFsNJJBdx9FsIFGs=; b=do2Hem1a+aOEvq/Kntdi4ENN3JkymIk9wQrf3JpO3XGiT9dlpDg3LvOlGDY7b05LUupn4o Xrp79fQ9iPJL5+klG/TIlRHjzvjorvVOKz7eC3xA/itzeaiS+m9j3voru6AcK8aa2PDWEz em+Ltxq9k/dPmc08ZZ7QgJsR5CsW2z4= X-MC-Unique: J3AiK0K6MJi4KvTZ8PD6Fg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/22] virDomainDiskGetDetectZeroesMode: Return proper type Date: Wed, 25 Oct 2023 13:39:24 +0200 Message-ID: <0c0b5b0e83850901448c0b7d788e874c49171b24.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.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: 1698234013299100001 Content-Type: text/plain; charset="utf-8" Change the return value type to 'virDomainDiskGetDetectZeroes'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 2 +- src/qemu/qemu_block.c | 4 ++-- src/qemu/qemu_command.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 80f467ae7a..fa97def9f7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -30592,7 +30592,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDef *= def) * don't change it in the XML for easier adjustments. This behaviour is * documented. */ -int +virDomainDiskDetectZeroes virDomainDiskGetDetectZeroesMode(virDomainDiskDiscard discard, virDomainDiskDetectZeroes detect_zeroes) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 98f99721f0..7c0e017038 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -4406,7 +4406,7 @@ virDomainNetResolveActualType(virDomainNetDef *iface) int virDomainDiskTranslateSourcePool(virDomainDiskDef *def); -int +virDomainDiskDetectZeroes virDomainDiskGetDetectZeroesMode(virDomainDiskDiscard discard, virDomainDiskDetectZeroes detect_zeroes); diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index ca68b9ab66..1fa9627444 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1270,8 +1270,8 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(vi= rStorageSource *src) { const char *detectZeroes =3D NULL; const char *discard =3D NULL; - int detectZeroesMode =3D virDomainDiskGetDetectZeroesMode(src->discard, - src->detect_ze= roes); + virDomainDiskDetectZeroes detectZeroesMode =3D virDomainDiskGetDetectZ= eroesMode(src->discard, + = src->detect_zeroes); g_autoptr(virJSONValue) props =3D NULL; g_autoptr(virJSONValue) cache =3D NULL; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fd0f12f304..98e7fa3d80 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1680,8 +1680,8 @@ static char * qemuBuildDriveStr(virDomainDiskDef *disk) { g_auto(virBuffer) opt =3D VIR_BUFFER_INITIALIZER; - int detect_zeroes =3D virDomainDiskGetDetectZeroesMode(disk->discard, - disk->detect_zero= es); + virDomainDiskDetectZeroes detect_zeroes =3D virDomainDiskGetDetectZero= esMode(disk->discard, + = disk->detect_zeroes); if (qemuBuildDriveSourceStr(disk, &opt) < 0) return NULL; --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234014; cv=none; d=zohomail.com; s=zohoarc; b=aKtgAZ36oM4m8JMGjMTGkxU3EY8UnhKTK0Tyi9j+D9Yk7gKr1dioyf87O7gkzK8nCSBSPvacgnEMqZDXW4orPiVfbnzlaoJdxpnfGCBPgc/SDxSegmQqwFraZv6swn55AH8OqlFx4+kSqUBJ/G4PWuzBapV0W90krU9C6DnbxJw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234014; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=6algHQnNSMnY1uvSYq8Z9GbQAcC5V8fPw2/WmakifDk=; b=N8KyG124N2yqSuPvmqkI/yYwv2DliGjHXWW1IHUOta4UZCe03gCb1wPgJvaKKDM6gs1i7+x44Dm6jVyiWaLqV9HFzpH1EkJGyZVfiPQ/hNGvGwTCDEGRVsbaZySr3kN8Y43DpsxrGL2qzIIAp3YMhwRhmoGwh01ZKhAHaDqdBFo= 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 1698234014527315.25534507338944; Wed, 25 Oct 2023 04:40:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-HpHmsA9pMiyATsZyxm1lyg-1; Wed, 25 Oct 2023 07:40:09 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D2F7A29AB435; Wed, 25 Oct 2023 11:39:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF6201121319; Wed, 25 Oct 2023 11:39:57 +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 A0203194658C; Wed, 25 Oct 2023 11:39:57 +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 3A9911946586 for ; Wed, 25 Oct 2023 11:39:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2BC28492BFB; Wed, 25 Oct 2023 11:39:56 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EBBA492BFA for ; Wed, 25 Oct 2023 11:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234013; 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=6algHQnNSMnY1uvSYq8Z9GbQAcC5V8fPw2/WmakifDk=; b=WEW66nwRivW6P5BwZCdepniv/BvAyggI7FnW3dPdjnCAXsuelsLdbwRzfJ49pgH+I2Ijtd NisLP9dKdIyhDFfiZrvaoLqG3d/0GdK0HmNDv5FZ1coWGT6ENoNl6cYo59BwPcgNeGwozp pXFsOCvjb4Q867qgqBxb8qoNRVb058o= X-MC-Unique: HpHmsA9pMiyATsZyxm1lyg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 15/22] qemuBlockStorageSourceGetBackendProps: Unify ordering of fields Date: Wed, 25 Oct 2023 13:39:25 +0200 Message-ID: <65fd2ae3c51eadf01c0c38e5c8bc3beefc74068c.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.3 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: 1698234015422100007 Content-Type: text/plain; charset="utf-8" Use the same ordering of the relevant fields as we do for the format layer -blockdev so that later they can be refactored without test fallout. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 2 +- .../xml2json/dir-fat-cache.json | 6 ++--- .../file-backing_basic-cache-directsync.json | 24 +++++++++---------- .../file-backing_basic-cache-none.json | 24 +++++++++---------- .../file-backing_basic-cache-unsafe.json | 24 +++++++++---------- .../file-backing_basic-cache-writeback.json | 24 +++++++++---------- ...file-backing_basic-cache-writethrough.json | 24 +++++++++---------- .../xml2json/file-raw-aio_native.json | 6 ++--- ...work-qcow2-backing-chain-cache-unsafe.json | 12 +++++----- .../blkdeviotune-group-num.x86_64-latest.args | 4 ++-- ...blkdeviotune-max-length.x86_64-latest.args | 4 ++-- .../blkdeviotune-max.x86_64-latest.args | 4 ++-- .../blkdeviotune.x86_64-latest.args | 4 ++-- .../controller-order.x86_64-latest.args | 2 +- .../disk-aio.x86_64-latest.args | 2 +- .../disk-cache.x86_64-latest.args | 10 ++++---- .../disk-error-policy-s390x.s390x-latest.args | 6 ++--- .../disk-error-policy.x86_64-latest.args | 6 ++--- .../disk-metadata-cache.x86_64-latest.args | 6 ++--- .../disk-network-nfs.x86_64-latest.args | 2 +- ...rk-tlsx509-nbd-hostname.x86_64-latest.args | 2 +- ...disk-network-tlsx509-nbd.x86_64-5.2.0.args | 2 +- ...isk-network-tlsx509-nbd.x86_64-latest.args | 2 +- ...isk-network-tlsx509-vxhs.x86_64-5.0.0.args | 6 ++--- .../disk-nvme.x86_64-latest.args | 2 +- .../disk-shared.x86_64-latest.args | 6 ++--- .../disk-slices.x86_64-latest.args | 2 +- .../disk-snapshot.x86_64-latest.args | 4 ++-- .../disk-transient.x86_64-latest.args | 2 +- .../disk-vhostvdpa.x86_64-latest.args | 2 +- .../name-escape.x86_64-latest.args | 2 +- .../user-aliases.x86_64-latest.args | 4 ++-- ...eo-bochs-display-device.x86_64-latest.args | 2 +- ...-device-pciaddr-default.x86_64-latest.args | 2 +- ...video-qxl-device-vgamem.x86_64-latest.args | 2 +- .../video-qxl-device.x86_64-latest.args | 2 +- ...o-qxl-sec-device-vgamem.x86_64-latest.args | 2 +- .../video-qxl-sec-device.x86_64-latest.args | 2 +- ...eo-ramfb-display-device.x86_64-latest.args | 2 +- ...video-vga-device-vgamem.x86_64-latest.args | 2 +- .../video-vga-device.x86_64-latest.args | 2 +- .../video-virtio-blob-off.x86_64-latest.args | 2 +- .../video-virtio-blob-on.x86_64-latest.args | 2 +- ...video-virtio-gpu-device.x86_64-latest.args | 2 +- ...video-virtio-gpu-sdl-gl.x86_64-latest.args | 2 +- ...deo-virtio-gpu-spice-gl.x86_64-latest.args | 2 +- .../video-virtio-gpu-virgl.x86_64-latest.args | 2 +- .../video-virtio-vga.x86_64-latest.args | 2 +- 48 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 1fa9627444..689eb535cb 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1113,10 +1113,10 @@ qemuBlockStorageSourceGetBackendProps(virStorageSou= rce *src, if (virJSONValueObjectAdd(&fileprops, "s:node-name", nodename, - "A:cache", &cache, "T:read-only", ro, "T:auto-read-only", aro, "S:discard", discardstr, + "A:cache", &cache, NULL) < 0) return NULL; } diff --git a/tests/qemublocktestdata/xml2json/dir-fat-cache.json b/tests/qe= mublocktestdata/xml2json/dir-fat-cache.json index 2a24175ef4..320dc77de1 100644 --- a/tests/qemublocktestdata/xml2json/dir-fat-cache.json +++ b/tests/qemublocktestdata/xml2json/dir-fat-cache.json @@ -14,10 +14,10 @@ "floppy": false, "rw": false, "node-name": "node-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-dire= ctsync.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-dir= ectsync.json index 1d5ae09813..7a8d0686f6 100644 --- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.= json +++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.= json @@ -13,12 +13,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/a", "node-name": "node-a-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-b-f", @@ -35,12 +35,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/b", "node-name": "node-b-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-c-f", @@ -65,12 +65,12 @@ } ], "node-name": "node-c-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-d-f", @@ -86,10 +86,10 @@ "driver": "file", "filename": "/var/lib/libvirt/images/d", "node-name": "node-d-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none= .json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json index 1d5ae09813..7a8d0686f6 100644 --- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json +++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json @@ -13,12 +13,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/a", "node-name": "node-a-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-b-f", @@ -35,12 +35,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/b", "node-name": "node-b-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-c-f", @@ -65,12 +65,12 @@ } ], "node-name": "node-c-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-d-f", @@ -86,10 +86,10 @@ "driver": "file", "filename": "/var/lib/libvirt/images/d", "node-name": "node-d-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsa= fe.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.= json index 4afd7366cf..15c8293f63 100644 --- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json +++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json @@ -13,12 +13,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/a", "node-name": "node-a-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": true - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-b-f", @@ -35,12 +35,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/b", "node-name": "node-b-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": true - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-c-f", @@ -65,12 +65,12 @@ } ], "node-name": "node-c-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": true - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-d-f", @@ -86,10 +86,10 @@ "driver": "file", "filename": "/var/lib/libvirt/images/d", "node-name": "node-d-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": true - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writ= eback.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writ= eback.json index 9ed806eb04..5918eed73f 100644 --- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.j= son +++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.j= son @@ -13,12 +13,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/a", "node-name": "node-a-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-b-f", @@ -35,12 +35,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/b", "node-name": "node-b-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-c-f", @@ -65,12 +65,12 @@ } ], "node-name": "node-c-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-d-f", @@ -86,10 +86,10 @@ "driver": "file", "filename": "/var/lib/libvirt/images/d", "node-name": "node-d-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writ= ethrough.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-w= ritethrough.json index 9ed806eb04..5918eed73f 100644 --- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethroug= h.json +++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethroug= h.json @@ -13,12 +13,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/a", "node-name": "node-a-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-b-f", @@ -35,12 +35,12 @@ "driver": "file", "filename": "/var/lib/libvirt/images/b", "node-name": "node-b-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-c-f", @@ -65,12 +65,12 @@ } ], "node-name": "node-c-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-d-f", @@ -86,10 +86,10 @@ "driver": "file", "filename": "/var/lib/libvirt/images/d", "node-name": "node-d-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemublocktestdata/xml2json/file-raw-aio_native.json b/te= sts/qemublocktestdata/xml2json/file-raw-aio_native.json index 1ae76895cd..1359c98986 100644 --- a/tests/qemublocktestdata/xml2json/file-raw-aio_native.json +++ b/tests/qemublocktestdata/xml2json/file-raw-aio_native.json @@ -13,10 +13,10 @@ "filename": "/path/to/i.img", "aio": "native", "node-name": "test2", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": true, "no-flush": false - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-c= ache-unsafe.json b/tests/qemublocktestdata/xml2json/network-qcow2-backing-c= hain-cache-unsafe.json index 9ee18dba51..d270f15f68 100644 --- a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-un= safe.json +++ b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-un= safe.json @@ -30,12 +30,12 @@ ], "key-secret": "node-a-s-secalias", "node-name": "node-a-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": true - }, - "auto-read-only": true, - "discard": "unmap" + } } { "node-name": "node-b-f", @@ -55,10 +55,10 @@ "lun": 1, "transport": "tcp", "node-name": "node-b-s", + "auto-read-only": true, + "discard": "unmap", "cache": { "direct": false, "no-flush": true - }, - "auto-read-only": true, - "discard": "unmap" + } } diff --git a/tests/qemuxml2argvdata/blkdeviotune-group-num.x86_64-latest.ar= gs b/tests/qemuxml2argvdata/blkdeviotune-group-num.x86_64-latest.args index 925c393d4b..38d38734f5 100644 --- a/tests/qemuxml2argvdata/blkdeviotune-group-num.x86_64-latest.args +++ b/tests/qemuxml2argvdata/blkdeviotune-group-num.x86_64-latest.args @@ -27,10 +27,10 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-2-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":1,"drive":"libvirt-1-form= at","id":"ide0-0-1","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/blkdeviotune-max-length.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/blkdeviotune-max-length.x86_64-latest.args index 925c393d4b..38d38734f5 100644 --- a/tests/qemuxml2argvdata/blkdeviotune-max-length.x86_64-latest.args +++ b/tests/qemuxml2argvdata/blkdeviotune-max-length.x86_64-latest.args @@ -27,10 +27,10 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-2-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":1,"drive":"libvirt-1-form= at","id":"ide0-0-1","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/blkdeviotune-max.x86_64-latest.args b/t= ests/qemuxml2argvdata/blkdeviotune-max.x86_64-latest.args index 925c393d4b..38d38734f5 100644 --- a/tests/qemuxml2argvdata/blkdeviotune-max.x86_64-latest.args +++ b/tests/qemuxml2argvdata/blkdeviotune-max.x86_64-latest.args @@ -27,10 +27,10 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-2-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":1,"drive":"libvirt-1-form= at","id":"ide0-0-1","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/blkdeviotune.x86_64-latest.args b/tests= /qemuxml2argvdata/blkdeviotune.x86_64-latest.args index 1300201889..7a2f740309 100644 --- a/tests/qemuxml2argvdata/blkdeviotune.x86_64-latest.args +++ b/tests/qemuxml2argvdata/blkdeviotune.x86_64-latest.args @@ -27,10 +27,10 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-2-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":1,"drive":"libvirt-1-form= at","id":"ide0-0-1","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/controller-order.x86_64-latest.args b/t= ests/qemuxml2argvdata/controller-order.x86_64-latest.args index 884e651b8e..d01831aaa6 100644 --- a/tests/qemuxml2argvdata/controller-order.x86_64-latest.args +++ b/tests/qemuxml2argvdata/controller-order.x86_64-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-fdr/.co= nfig \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0"= ,"addr":"0x7"}' \ -device '{"driver":"usb-hub","id":"hub0","bus":"usb.0","port":"1"}' \ -device '{"driver":"usb-ccid","id":"ccid0","bus":"usb.0","port":"1.1"}' \ --blockdev '{"driver":"file","filename":"/tmp/fdr.img","aio":"native","node= -name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-r= ead-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/tmp/fdr.img","aio":"native","node= -name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache":= {"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x5","share-rw":= true,"drive":"libvirt-2-format","id":"virtio-disk0","bootindex":1,"write-ca= che":"on"}' \ -blockdev '{"driver":"file","filename":"/tmp/Fedora-17-x86_64-Live-Desktop= .iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unma= p"}' \ diff --git a/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args b/tests/qem= uxml2argvdata/disk-aio.x86_64-latest.args index 6e40786047..caf6f6eac6 100644 --- a/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","ai= o":"native","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flus= h":false},"auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","ai= o":"native","node-name":"libvirt-2-storage","auto-read-only":true,"discard"= :"unmap","cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-2-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","ai= o":"threads","node-name":"libvirt-1-storage","auto-read-only":true,"discard= ":"unmap"}' \ diff --git a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args b/tests/q= emuxml2argvdata/disk-cache.x86_64-latest.args index f094c6c7fb..27be644177 100644 --- a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args @@ -28,19 +28,19 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -device '{"driver":"lsi","id":"scsi0","bus":"pci.0","addr":"0x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-5-storage","cache":{"direct":false,"no-flush":false},"aut= o-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-5-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":false,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-5-format","read-only":false,"cache":{"dir= ect":false,"no-flush":false},"driver":"qcow2","file":"libvirt-5-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-5-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-4-storage","cache":{"direct":false,"no-flush":true},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":false,"no-flush":true}}' \ -blockdev '{"node-name":"libvirt-4-format","read-only":false,"cache":{"dir= ect":false,"no-flush":true},"driver":"qcow2","file":"libvirt-4-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":1,"drive":"libvirt-4-form= at","id":"ide0-0-1","write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-3-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-3-storage"}' \ -device '{"driver":"scsi-hd","bus":"scsi0.0","scsi-id":0,"device_id":"driv= e-scsi0-0-0","drive":"libvirt-3-format","id":"scsi0-0-0","write-cache":"on"= }' \ --blockdev '{"driver":"host_device","filename":"/dev/disk/by-path/ip-192.16= 8.44.1:3260-iscsi-iqn.2011-02.lan.hdserver:hydrar-desktop.win7vm-lun-0","no= de-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":false},"aut= o-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/disk/by-path/ip-192.16= 8.44.1:3260-iscsi-iqn.2011-02.lan.hdserver:hydrar-desktop.win7vm-lun-0","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":false,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":false,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"li= bvirt-2-format","id":"virtio-disk0","write-cache":"off"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt= -1-format","id":"usb-disk1","removable":false,"write-cache":"off"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.ar= gs b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args index c023ff8903..4ca56d2265 100644 --- a/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args +++ b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args @@ -26,13 +26,13 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-guest= /.config \ -rtc base=3Dutc \ -no-shutdown \ -boot strict=3Don \ --blockdev '{"driver":"file","filename":"/var/images/image1","node-name":"l= ibvirt-3-storage","cache":{"direct":true,"no-flush":false},"auto-read-only"= :true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/images/image1","node-name":"l= ibvirt-3-storage","auto-read-only":true,"discard":"unmap","cache":{"direct"= :true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-3-storage"}' \ -device '{"driver":"virtio-blk-ccw","devno":"fe.0.0000","drive":"libvirt-3= -format","id":"virtio-disk0","bootindex":1,"write-cache":"on","werror":"sto= p","rerror":"stop"}' \ --blockdev '{"driver":"file","filename":"/var/images/image2","node-name":"l= ibvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only"= :true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/images/image2","node-name":"l= ibvirt-2-storage","auto-read-only":true,"discard":"unmap","cache":{"direct"= :true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"virtio-blk-ccw","devno":"fe.0.0001","drive":"libvirt-2= -format","id":"virtio-disk1","write-cache":"on","werror":"enospc"}' \ --blockdev '{"driver":"file","filename":"/var/images/image3","node-name":"l= ibvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only"= :true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/images/image3","node-name":"l= ibvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"direct"= :true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"virtio-blk-ccw","devno":"fe.0.0002","drive":"libvirt-1= -format","id":"virtio-disk2","write-cache":"on","werror":"report","rerror":= "ignore"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args b/= tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args index 4599ddbae1..e1018fb2d6 100644 --- a/tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args @@ -27,13 +27,13 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-3-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-3-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-3-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on","werror":"stop","rerro= r":"stop"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":1,"drive":"libvirt-2-form= at","id":"ide0-0-1","write-cache":"on","werror":"enospc"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest3","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest3","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.1","unit":0,"drive":"libvirt-1-form= at","id":"ide0-1-0","write-cache":"on","werror":"report","rerror":"ignore"}= ' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-metadata-cache.x86_64-latest.args = b/tests/qemuxml2argvdata/disk-metadata-cache.x86_64-latest.args index acac58ca1c..9bb47e59ed 100644 --- a/tests/qemuxml2argvdata/disk-metadata-cache.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-metadata-cache.x86_64-latest.args @@ -27,12 +27,12 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/tmp/QEMUGuest1.img","node-name":"= libvirt-3-storage","cache":{"direct":true,"no-flush":false},"auto-read-only= ":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/tmp/QEMUGuest1.img","node-name":"= libvirt-3-storage","auto-read-only":true,"discard":"unmap","cache":{"direct= ":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","cache-size":12345,"file":"lib= virt-3-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-3-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ --blockdev '{"driver":"file","filename":"/tmp/backing-store.qcow","node-nam= e":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-= only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/tmp/backing-store.qcow","node-nam= e":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache":{"di= rect":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":true,"cache":{"dire= ct":true,"no-flush":false},"driver":"qcow2","cache-size":1048576,"file":"li= bvirt-2-storage","backing":null}' \ --blockdev '{"driver":"file","filename":"/tmp/QEMUGuest2.img","node-name":"= libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only= ":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/tmp/QEMUGuest2.img","node-name":"= libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"direct= ":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","ba= cking":"libvirt-2-format"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":1,"drive":"libvirt-1-form= at","id":"ide0-0-1","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-network-nfs.x86_64-latest.args b/t= ests/qemuxml2argvdata/disk-network-nfs.x86_64-latest.args index b4fbfcee8f..1db2f5d30a 100644 --- a/tests/qemuxml2argvdata/disk-network-nfs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-nfs.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"nfs","server":{"host":"example.com","type":"inet"},"= path":"/foo/bar/baz","user":6234,"group":12354,"node-name":"libvirt-3-stora= ge","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard= ":"unmap"}' \ +-blockdev '{"driver":"nfs","server":{"host":"example.com","type":"inet"},"= path":"/foo/bar/baz","user":6234,"group":12354,"node-name":"libvirt-3-stora= ge","auto-read-only":true,"discard":"unmap","cache":{"direct":true,"no-flus= h":false}}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-3-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x4","drive":"li= bvirt-3-format","id":"virtio-disk0","bootindex":1,"write-cache":"on","seria= l":"eb90327c-8302-4725-9e1b-4e85ed4dc251"}' \ -blockdev '{"driver":"nfs","server":{"host":"example.org","type":"inet"},"= path":"/backing/store/nfs","user":1234,"group":5678,"node-name":"libvirt-2-= storage","auto-read-only":true,"discard":"unmap"}' \ diff --git a/tests/qemuxml2argvdata/disk-network-tlsx509-nbd-hostname.x86_6= 4-latest.args b/tests/qemuxml2argvdata/disk-network-tlsx509-nbd-hostname.x8= 6_64-latest.args index 5f5c412e22..5030e76a75 100644 --- a/tests/qemuxml2argvdata/disk-network-tlsx509-nbd-hostname.x86_64-lates= t.args +++ b/tests/qemuxml2argvdata/disk-network-tlsx509-nbd-hostname.x86_64-lates= t.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -object '{"qom-type":"secret","id":"objlibvirt-1-storage_tls0-secret0","da= ta":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","key= id":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw=3D=3D","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objlibvirt-1-storage_tls0","di= r":"/etc/pki/libvirt-nbd","endpoint":"client","verify-peer":true,"passwordi= d":"objlibvirt-1-storage_tls0-secret0"}' \ --blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com","p= ort":"1234"},"tls-creds":"objlibvirt-1-storage_tls0","tls-hostname":"test-h= ostname","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":= false},"auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com","p= ort":"1234"},"tls-creds":"objlibvirt-1-storage_tls0","tls-hostname":"test-h= ostname","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"u= nmap","cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"li= bvirt-1-format","id":"virtio-disk3","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-5.2.0.a= rgs b/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-5.2.0.args index 2863f78a4c..676c021dab 100644 --- a/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-5.2.0.args +++ b/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-5.2.0.args @@ -30,7 +30,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -object secret,id=3Dobjlibvirt-1-storage_tls0-secret0,data=3D9eao5F8qtkGt+= seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv= =3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -object tls-creds-x509,id=3Dobjlibvirt-1-storage_tls0,dir=3D/etc/pki/libvi= rt-nbd,endpoint=3Dclient,verify-peer=3Don,passwordid=3Dobjlibvirt-1-storage= _tls0-secret0 \ --blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com","p= ort":"1234"},"tls-creds":"objlibvirt-1-storage_tls0","node-name":"libvirt-1= -storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"d= iscard":"unmap"}' \ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com","p= ort":"1234"},"tls-creds":"objlibvirt-1-storage_tls0","node-name":"libvirt-1= -storage","auto-read-only":true,"discard":"unmap","cache":{"direct":true,"n= o-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x7,drive=3Dlibvirt-1-format,id= =3Dvirtio-disk3,bootindex=3D1,write-cache=3Don \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-latest.= args b/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-latest.args index f499dac90f..905d8c2451 100644 --- a/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -object '{"qom-type":"secret","id":"objlibvirt-1-storage_tls0-secret0","da= ta":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","key= id":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw=3D=3D","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objlibvirt-1-storage_tls0","di= r":"/etc/pki/libvirt-nbd","endpoint":"client","verify-peer":true,"passwordi= d":"objlibvirt-1-storage_tls0-secret0"}' \ --blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com","p= ort":"1234"},"tls-creds":"objlibvirt-1-storage_tls0","node-name":"libvirt-1= -storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"d= iscard":"unmap"}' \ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com","p= ort":"1234"},"tls-creds":"objlibvirt-1-storage_tls0","node-name":"libvirt-1= -storage","auto-read-only":true,"discard":"unmap","cache":{"direct":true,"n= o-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"li= bvirt-1-format","id":"virtio-disk3","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-network-tlsx509-vxhs.x86_64-5.0.0.= args b/tests/qemuxml2argvdata/disk-network-tlsx509-vxhs.x86_64-5.0.0.args index c96d105362..b401400999 100644 --- a/tests/qemuxml2argvdata/disk-network-tlsx509-vxhs.x86_64-5.0.0.args +++ b/tests/qemuxml2argvdata/disk-network-tlsx509-vxhs.x86_64-5.0.0.args @@ -29,15 +29,15 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -object secret,id=3Dobjlibvirt-3-storage_tls0-secret0,data=3D9eao5F8qtkGt+= seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv= =3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -object tls-creds-x509,id=3Dobjlibvirt-3-storage_tls0,dir=3D/etc/pki/libvi= rt-vxhs,endpoint=3Dclient,verify-peer=3Don,passwordid=3Dobjlibvirt-3-storag= e_tls0-secret0 \ --blockdev '{"driver":"vxhs","tls-creds":"objlibvirt-3-storage_tls0","vdisk= -id":"eb90327c-8302-4725-9e1b-4e85ed4dc251","server":{"host":"192.168.0.1",= "port":"9999"},"node-name":"libvirt-3-storage","cache":{"direct":true,"no-f= lush":false},"auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"vxhs","tls-creds":"objlibvirt-3-storage_tls0","vdisk= -id":"eb90327c-8302-4725-9e1b-4e85ed4dc251","server":{"host":"192.168.0.1",= "port":"9999"},"node-name":"libvirt-3-storage","auto-read-only":true,"disca= rd":"unmap","cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-3-storage"}' \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-3-format,id= =3Dvirtio-disk0,bootindex=3D1,write-cache=3Don,serial=3Deb90327c-8302-4725-= 9e1b-4e85ed4dc251 \ -object secret,id=3Dobjlibvirt-2-storage_tls0-secret0,data=3D9eao5F8qtkGt+= seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv= =3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -object tls-creds-x509,id=3Dobjlibvirt-2-storage_tls0,dir=3D/etc/pki/libvi= rt-vxhs,endpoint=3Dclient,verify-peer=3Don,passwordid=3Dobjlibvirt-2-storag= e_tls0-secret0 \ --blockdev '{"driver":"vxhs","tls-creds":"objlibvirt-2-storage_tls0","vdisk= -id":"eb90327c-8302-4725-9e1b-4e85ed4dc252","server":{"host":"192.168.0.2",= "port":"9999"},"node-name":"libvirt-2-storage","cache":{"direct":true,"no-f= lush":false},"auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"vxhs","tls-creds":"objlibvirt-2-storage_tls0","vdisk= -id":"eb90327c-8302-4725-9e1b-4e85ed4dc252","server":{"host":"192.168.0.2",= "port":"9999"},"node-name":"libvirt-2-storage","auto-read-only":true,"disca= rd":"unmap","cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,drive=3Dlibvirt-2-format,id= =3Dvirtio-disk1,write-cache=3Don,serial=3Deb90327c-8302-4725-9e1b-4e85ed4dc= 252 \ --blockdev '{"driver":"vxhs","vdisk-id":"eb90327c-8302-4725-9e1b-4e85ed4dc2= 53","server":{"host":"192.168.0.3","port":"9999"},"node-name":"libvirt-1-st= orage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"disc= ard":"unmap"}' \ +-blockdev '{"driver":"vxhs","vdisk-id":"eb90327c-8302-4725-9e1b-4e85ed4dc2= 53","server":{"host":"192.168.0.3","port":"9999"},"node-name":"libvirt-1-st= orage","auto-read-only":true,"discard":"unmap","cache":{"direct":true,"no-f= lush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x6,drive=3Dlibvirt-1-format,id= =3Dvirtio-disk2,write-cache=3Don,serial=3Deb90327c-8302-4725-9e1b-4e85ed4dc= 252 \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-nvme.x86_64-latest.args b/tests/qe= muxml2argvdata/disk-nvme.x86_64-latest.args index 8dccaebf11..b4b8a62447 100644 --- a/tests/qemuxml2argvdata/disk-nvme.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-nvme.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ","file":"libvirt-2-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x6","drive":"li= bvirt-2-format","id":"virtio-disk2"}' \ -object '{"qom-type":"secret","id":"libvirt-1-format-encryption-secret0","= data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","k= eyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw=3D=3D","format":"base64"}' \ --blockdev '{"driver":"nvme","device":"0001:02:00.0","namespace":2,"node-na= me":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read= -only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"nvme","device":"0001:02:00.0","namespace":2,"node-na= me":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"d= irect":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","encrypt":{"format":"luks","ke= y-secret":"libvirt-1-format-encryption-secret0"},"file":"libvirt-1-storage"= }' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"li= bvirt-1-format","id":"virtio-disk3","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args b/tests/= qemuxml2argvdata/disk-shared.x86_64-latest.args index 9059d3c369..9ef920d1e9 100644 --- a/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args @@ -28,16 +28,16 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x= 2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-4-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-4-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-4-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"share-rw":true,"drive"= :"libvirt-4-format","id":"ide0-0-0","bootindex":1,"write-cache":"on","seria= l":"XYZXYZXYZYXXYZYZYXYZY"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw"= ,"file":"libvirt-3-storage"}' \ -device '{"driver":"ide-cd","bus":"ide.1","unit":0,"drive":"libvirt-3-form= at","id":"ide0-1-0"}' \ --blockdev '{"driver":"host_device","filename":"/dev/scsi","node-name":"lib= virt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":t= rue,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/scsi","node-name":"lib= virt-2-storage","auto-read-only":true,"discard":"unmap","cache":{"direct":t= rue,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' \ -device '{"driver":"scsi-hd","bus":"scsi0.0","channel":0,"scsi-id":0,"lun"= :0,"device_id":"drive-scsi0-0-0-0","share-rw":true,"drive":"libvirt-2-forma= t","id":"scsi0-0-0-0","write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/virtio","node-name":"l= ibvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only"= :true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/virtio","node-name":"l= ibvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"direct"= :true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","share-rw":= true,"drive":"libvirt-1-format","id":"virtio-disk0","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args b/tests/= qemuxml2argvdata/disk-slices.x86_64-latest.args index 25ee975619..deaa094379 100644 --- a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ","offset":1234,"size":321,"file":"libvirt-2-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x6","drive":"li= bvirt-2-format","id":"virtio-disk3"}' \ -object '{"qom-type":"secret","id":"libvirt-1-format-encryption-secret0","= data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","k= eyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw=3D=3D","format":"base64"}' \ --blockdev '{"driver":"nvme","device":"0001:02:00.0","namespace":2,"node-na= me":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read= -only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"nvme","device":"0001:02:00.0","namespace":2,"node-na= me":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"d= irect":true,"no-flush":false}}' \ -blockdev '{"driver":"raw","node-name":"libvirt-1-slice-sto","offset":1234= ,"size":321,"file":"libvirt-1-storage","auto-read-only":true,"discard":"unm= ap","cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","encrypt":{"format":"luks","ke= y-secret":"libvirt-1-format-encryption-secret0"},"file":"libvirt-1-slice-st= o"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"li= bvirt-1-format","id":"virtio-disk4","write-cache":"on"}' \ diff --git a/tests/qemuxml2argvdata/disk-snapshot.x86_64-latest.args b/test= s/qemuxml2argvdata/disk-snapshot.x86_64-latest.args index f8830e3ae4..67584ad565 100644 --- a/tests/qemuxml2argvdata/disk-snapshot.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-snapshot.x86_64-latest.args @@ -27,10 +27,10 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-3-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-3-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-3-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest3","no= de-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest3","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.2","unit":0,"drive":"libvirt-2-form= at","id":"ide0-2-0","write-cache":"on"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ diff --git a/tests/qemuxml2argvdata/disk-transient.x86_64-latest.args b/tes= ts/qemuxml2argvdata/disk-transient.x86_64-latest.args index d586cdafd9..101435a991 100644 --- a/tests/qemuxml2argvdata/disk-transient.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-transient.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/tmp/QEMUGuest1.img","node-name":"= libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only= ":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/tmp/QEMUGuest1.img","node-name":"= libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"direct= ":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args b/tes= ts/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args index b987455ee4..872858ddf4 100644 --- a/tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args @@ -28,7 +28,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -add-fd set=3D0,fd=3D801,opaque=3Dlibvirt-1-storage-vdpa \ --blockdev '{"driver":"virtio-blk-vhost-vdpa","path":"/dev/fdset/0","node-n= ame":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-rea= d-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"virtio-blk-vhost-vdpa","path":"/dev/fdset/0","node-n= ame":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"= direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"li= bvirt-1-format","id":"virtio-disk0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/= qemuxml2argvdata/name-escape.x86_64-latest.args index 7ccea7d740..096a774caa 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -28,7 +28,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-foo=3D1= ,bar=3D2/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x= 3"}' \ -device '{"driver":"usb-ccid","id":"ccid0","bus":"usb.0","port":"1"}' \ --blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -device '{"driver":"ccid-card-emulated","backend":"certificates","cert1":"= cert1,foo","cert2":"cert2","cert3":"cert3","db":"/etc/pki/nssdb,foo","id":"= smartcard0","bus":"ccid0.0"}' \ diff --git a/tests/qemuxml2argvdata/user-aliases.x86_64-latest.args b/tests= /qemuxml2argvdata/user-aliases.x86_64-latest.args index defc2c95ce..df0005f8dc 100644 --- a/tests/qemuxml2argvdata/user-aliases.x86_64-latest.args +++ b/tests/qemuxml2argvdata/user-aliases.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-gentoo/= .config \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0"= ,"addr":"0x8"}' \ -device '{"driver":"usb-ccid","id":"ua-myCCID","bus":"ua-SomeWeirdControll= er.0","port":"1"}' \ -device '{"driver":"usb-ccid","id":"ua-myCCID2","bus":"ua-SomeWeirdControl= ler.0","port":"2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/fd.img","n= ode-name":"libvirt-4-storage","cache":{"direct":true,"no-flush":false},"aut= o-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/fd.img","n= ode-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap","cach= e":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-4-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-4-storage"}' \ -device '{"driver":"floppy","unit":0,"drive":"libvirt-4-format","id":"ua-m= yDisk1","write-cache":"on"}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/gentoo.qco= w2","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"= }' \ @@ -48,7 +48,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-gentoo/= .config \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/OtherDemo.= img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap= "}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"qco= w2","encrypt":{"format":"luks","key-secret":"libvirt-2-format-encryption-se= cret0"},"file":"libvirt-2-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"li= bvirt-2-format","id":"ua-myEncryptedDisk1"}' \ --blockdev '{"driver":"file","filename":"/home/zippy/tmp/install-amd64-mini= mal-20140619.iso","node-name":"libvirt-1-storage","cache":{"direct":true,"n= o-flush":false},"auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/home/zippy/tmp/install-amd64-mini= mal-20140619.iso","node-name":"libvirt-1-storage","auto-read-only":true,"di= scard":"unmap","cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":true,"cache":{"dire= ct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-cd","bus":"ide.1","unit":0,"share-rw":true,"drive"= :"libvirt-1-format","id":"ua-WhatAnAwesomeCDROM","bootindex":2,"write-cache= ":"on"}' \ -netdev '{"type":"tap","fd":"3","vhost":true,"vhostfd":"44","id":"hostua-C= heckoutThisNIC"}' \ diff --git a/tests/qemuxml2argvdata/video-bochs-display-device.x86_64-lates= t.args b/tests/qemuxml2argvdata/video-bochs-display-device.x86_64-latest.ar= gs index f1d22cd422..893d1448db 100644 --- a/tests/qemuxml2argvdata/video-bochs-display-device.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-bochs-display-device.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-device-pciaddr-default.x86_64-lat= est.args b/tests/qemuxml2argvdata/video-device-pciaddr-default.x86_64-lates= t.args index b6fd9f4efa..09583d06f2 100644 --- a/tests/qemuxml2argvdata/video-device-pciaddr-default.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-device-pciaddr-default.x86_64-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-qxl-device-vgamem.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/video-qxl-device-vgamem.x86_64-latest.args index d9c66dc396..84b9f4f73e 100644 --- a/tests/qemuxml2argvdata/video-qxl-device-vgamem.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-qxl-device-vgamem.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-qxl-device.x86_64-latest.args b/t= ests/qemuxml2argvdata/video-qxl-device.x86_64-latest.args index d9c66dc396..84b9f4f73e 100644 --- a/tests/qemuxml2argvdata/video-qxl-device.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-qxl-device.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-qxl-sec-device-vgamem.x86_64-late= st.args b/tests/qemuxml2argvdata/video-qxl-sec-device-vgamem.x86_64-latest.= args index 045c124005..8040756044 100644 --- a/tests/qemuxml2argvdata/video-qxl-sec-device-vgamem.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-qxl-sec-device-vgamem.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-qxl-sec-device.x86_64-latest.args= b/tests/qemuxml2argvdata/video-qxl-sec-device.x86_64-latest.args index 045c124005..8040756044 100644 --- a/tests/qemuxml2argvdata/video-qxl-sec-device.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-qxl-sec-device.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-ramfb-display-device.x86_64-lates= t.args b/tests/qemuxml2argvdata/video-ramfb-display-device.x86_64-latest.ar= gs index d2f5cea74a..0a52f9dc08 100644 --- a/tests/qemuxml2argvdata/video-ramfb-display-device.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-ramfb-display-device.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-vga-device-vgamem.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/video-vga-device-vgamem.x86_64-latest.args index 0f2b1ec023..f5bc6a1dcf 100644 --- a/tests/qemuxml2argvdata/video-vga-device-vgamem.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-vga-device-vgamem.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-vga-device.x86_64-latest.args b/t= ests/qemuxml2argvdata/video-vga-device.x86_64-latest.args index 0f2b1ec023..f5bc6a1dcf 100644 --- a/tests/qemuxml2argvdata/video-vga-device.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-vga-device.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-virtio-blob-off.x86_64-latest.arg= s b/tests/qemuxml2argvdata/video-virtio-blob-off.x86_64-latest.args index f46fb2986d..837d5055c1 100644 --- a/tests/qemuxml2argvdata/video-virtio-blob-off.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-virtio-blob-off.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-virtio-blob-on.x86_64-latest.args= b/tests/qemuxml2argvdata/video-virtio-blob-on.x86_64-latest.args index 577422426b..172bd372e1 100644 --- a/tests/qemuxml2argvdata/video-virtio-blob-on.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-virtio-blob-on.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-virtio-gpu-device.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/video-virtio-gpu-device.x86_64-latest.args index c7e867cfcd..fec2b04ca9 100644 --- a/tests/qemuxml2argvdata/video-virtio-gpu-device.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-virtio-gpu-device.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-virtio-gpu-sdl-gl.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/video-virtio-gpu-sdl-gl.x86_64-latest.args index 84215bb370..9ab281a94d 100644 --- a/tests/qemuxml2argvdata/video-virtio-gpu-sdl-gl.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-virtio-gpu-sdl-gl.x86_64-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -display sdl,gl=3Don \ diff --git a/tests/qemuxml2argvdata/video-virtio-gpu-spice-gl.x86_64-latest= .args b/tests/qemuxml2argvdata/video-virtio-gpu-spice-gl.x86_64-latest.args index a7c40489ec..7a2a85f863 100644 --- a/tests/qemuxml2argvdata/video-virtio-gpu-spice-gl.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-virtio-gpu-spice-gl.x86_64-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"spice"}' \ diff --git a/tests/qemuxml2argvdata/video-virtio-gpu-virgl.x86_64-latest.ar= gs b/tests/qemuxml2argvdata/video-virtio-gpu-virgl.x86_64-latest.args index 3b6bcceb8d..5cd1b7998b 100644 --- a/tests/qemuxml2argvdata/video-virtio-gpu-virgl.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-virtio-gpu-virgl.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/video-virtio-vga.x86_64-latest.args b/t= ests/qemuxml2argvdata/video-virtio-vga.x86_64-latest.args index c7e867cfcd..fec2b04ca9 100644 --- a/tests/qemuxml2argvdata/video-virtio-vga.x86_64-latest.args +++ b/tests/qemuxml2argvdata/video-virtio-vga.x86_64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},= "auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1= ","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","= cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234065; cv=none; d=zohomail.com; s=zohoarc; b=P3djQguQFHU7ZIyGAv3T/Yh5KO06hqW1gd8Lh+a7/XN8B9OxLVpnOPHPV7IZh5CkhBriK/iZUpgGA2ogtTo3LlM4NgMX8ElpiZ4oPK4+OXoBT/m/vH9W8CNpN5GiCZKi62uMrbQ3/wrKCteTaj9mBNZdgvfWY+J62AdyzBbk/1g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234065; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=3e12CsC7LePkPpcNyJPb2vsLplIdI+WYRqPY8EdnEWk=; b=VUuvzBSEp7s3Esb9r74Y/hb75zaPD5LvnaNTo7J4WxTjGovzKSCaRkfkum0w9e1B2iRWVvLwX77Qjyf9KuYmRyXx27W7eeIsVy9X9Dce4CIYJ6K+0vXdkZU4O9b3ke9fuLVAM2/USDfelszwmTOKb/zpLxk7CFg4mrIDfo67gno= 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 1698234065474966.6286930718451; Wed, 25 Oct 2023 04:41:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-JMiDqiErMOuCNK0ZQtFs4g-1; Wed, 25 Oct 2023 07:40:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B22B538143B3; Wed, 25 Oct 2023 11:39:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 339691121319; Wed, 25 Oct 2023 11:39:58 +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 DA82219465B8; Wed, 25 Oct 2023 11:39:57 +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 0FFAC1946586 for ; Wed, 25 Oct 2023 11:39:57 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 01CAF492BFD; Wed, 25 Oct 2023 11:39:57 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81FCE492BFA for ; Wed, 25 Oct 2023 11:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234064; 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=3e12CsC7LePkPpcNyJPb2vsLplIdI+WYRqPY8EdnEWk=; b=E+bllxCwHAz9Ibsgy+kE+245yW+YEv/E7G50igwyJBV0jyKLV09cLMcuAzhGZBbllYUi46 HCXmOZEQl+0Vzf7VEm/1qVkPuqVFqqJi2mFFZ1QzadvBY+DinRrnXexwuOhNTq5N4r9DHi jS56M085ETotVPxvPeXQc+Rw9i5h+Zs= X-MC-Unique: JMiDqiErMOuCNK0ZQtFs4g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 16/22] qemu: block: Add helper to add common properties for -blockdev configuration Date: Wed, 25 Oct 2023 13:39:26 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.3 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: 1698234067569100003 Content-Type: text/plain; charset="utf-8" The new helper replaces qemuBlockStorageSourceGetBlockdevFormatCommonProps and the two inline instances generating the common properties for a blockdev layer. The new helper is to be used for both the format layer and the storage backing layer, thus a new parameter 'effective' switches between the modes. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 128 +++++++++++++++++++++++++++++------------- 1 file changed, 88 insertions(+), 40 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 689eb535cb..aeb05a7f00 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -931,6 +931,90 @@ qemuBlockStorageSourceGetBlockdevGetCacheProps(virStor= ageSource *src, } +/** + * qemuBlockStorageSourceAddBlockdevCommonProps: + * @props: JSON object to append the props to + * @src: storage source + * @nodename: nodename to use for @src + * @effective: Whether props for the effective(topmost) layer are to be fo= rmatted + * + * Add the common props (node name, read-only state, cache configuration, = discard) + * to a JSON object for a -blockdev definition. If @effective is true, + * the props are configured for the topmost layer used to access the data, + * otherwise the props are configured for the storage protocol backing a f= ormat + * layer. + */ +static int +qemuBlockStorageSourceAddBlockdevCommonProps(virJSONValue **props, + virStorageSource *src, + const char *nodename, + bool effective) +{ + virStorageType actualType =3D virStorageSourceGetActualType(src); + g_autoptr(virJSONValue) cache =3D NULL; + const char *detectZeroes =3D NULL; + const char *discard =3D NULL; + virTristateBool autoReadOnly =3D VIR_TRISTATE_BOOL_ABSENT; + virTristateBool readOnly =3D VIR_TRISTATE_BOOL_ABSENT; + + if (qemuBlockNodeNameValidate(nodename) < 0) + return -1; + + if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache) < 0) + return -1; + + if (effective) { + virDomainDiskDetectZeroes dz =3D virDomainDiskGetDetectZeroesMode(= src->discard, + sr= c->detect_zeroes); + + if (src->discard !=3D VIR_DOMAIN_DISK_DISCARD_DEFAULT) + discard =3D virDomainDiskDiscardTypeToString(src->discard); + + if (dz !=3D VIR_DOMAIN_DISK_DETECT_ZEROES_DEFAULT) + detectZeroes =3D virDomainDiskDetectZeroesTypeToString(dz); + + autoReadOnly =3D VIR_TRISTATE_BOOL_ABSENT; + readOnly =3D virTristateBoolFromBool(src->readonly); + } else { + /* when passing a FD to qemu via the /dev/fdset mechanism qemu + * fetches the appropriate FD from the fdset by checking that it h= as + * the correct accessmode. Now with 'auto-read-only' in effect qemu + * wants to use a read-only FD first. If the user didn't pass mult= iple + * FDs the feature will not work regardless, so we'll not enable i= t. */ + if ((actualType =3D=3D VIR_STORAGE_TYPE_FILE || actualType =3D=3D = VIR_STORAGE_TYPE_BLOCK) && + src->fdtuple && src->fdtuple->nfds =3D=3D 1) { + autoReadOnly =3D VIR_TRISTATE_BOOL_ABSENT; + + /* now we setup the normal readonly flag. If user requested wr= ite access honour it */ + if (src->fdtuple->writable) + readOnly =3D VIR_TRISTATE_BOOL_NO; + else + readOnly =3D virTristateBoolFromBool(src->readonly); + } else { + autoReadOnly =3D VIR_TRISTATE_BOOL_YES; + } + + discard =3D "unmap"; + } + + /* currently unhandled global properties: + * '*force-share': 'bool' + */ + + if (virJSONValueObjectAdd(props, + "s:node-name", nodename, + "T:read-only", readOnly, + "T:auto-read-only", autoReadOnly, + "S:discard", discard, + "S:detect-zeroes", detectZeroes, + "A:cache", &cache, + NULL) < 0) + return -1; + + return 0; +} + + /** * qemuBlockStorageSourceGetBackendProps: * @src: disk source @@ -1265,52 +1349,16 @@ qemuBlockStorageSourceGetFormatQcow2Props(virStorag= eSource *src, } -static virJSONValue * -qemuBlockStorageSourceGetBlockdevFormatCommonProps(virStorageSource *src) -{ - const char *detectZeroes =3D NULL; - const char *discard =3D NULL; - virDomainDiskDetectZeroes detectZeroesMode =3D virDomainDiskGetDetectZ= eroesMode(src->discard, - = src->detect_zeroes); - g_autoptr(virJSONValue) props =3D NULL; - g_autoptr(virJSONValue) cache =3D NULL; - - if (qemuBlockNodeNameValidate(qemuBlockStorageSourceGetFormatNodename(= src)) < 0) - return NULL; - - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache) < 0) - return NULL; - - if (src->discard) - discard =3D virDomainDiskDiscardTypeToString(src->discard); - - if (detectZeroesMode) - detectZeroes =3D virDomainDiskDetectZeroesTypeToString(detectZeroe= sMode); - - /* currently unhandled global properties: - * '*force-share': 'bool' - */ - - if (virJSONValueObjectAdd(&props, - "s:node-name", qemuBlockStorageSourceGetForm= atNodename(src), - "b:read-only", src->readonly, - "S:discard", discard, - "S:detect-zeroes", detectZeroes, - "A:cache", &cache, - NULL) < 0) - return NULL; - - return g_steal_pointer(&props); -} - - static virJSONValue * qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSource *src) { const char *driver =3D NULL; g_autoptr(virJSONValue) props =3D NULL; - if (!(props =3D qemuBlockStorageSourceGetBlockdevFormatCommonProps(src= ))) + if (qemuBlockStorageSourceAddBlockdevCommonProps(&props, + src, + qemuBlockStorageSourc= eGetFormatNodename(src), + true) < 0) return NULL; switch ((virStorageFileFormat) src->format) { --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234012; cv=none; d=zohomail.com; s=zohoarc; b=UIZQGcvKnYpu633096Ll04sFeVDityOJOjwEKr1guocg340INRpVErvSjKlA2iMxlxYjc2cSyK+d6OIS0bruHVvelDwEoa27QzDycrmy+BpQI9Gv+FNU0EhYX5h6EOUp5F703xtlmXgcMHXjsSfK+fzod5gZ47XLj+72v833SvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234012; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=mnYnZjmMRn6SbabNPOnlNsbL/Nd4NmARqZyEOPaV7tA=; b=DBDh2kvz1jbf3LrrJgpkvp+S69IvBZ3eZB6SDW2OzJbFkSgDgTC5QsUG1KaQZu9RWV5A0uBwqCdBYqLC/S3XaWekNbCtH7j5KJqSowS01sElXzySTUmadq34zykwjki7eRf0+phg50fQPmv649KcMUw90VTkHvdmKEy4+UbZPOk= 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 1698234012688883.8948586379156; Wed, 25 Oct 2023 04:40:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-9E0E6juMM3OCLrTwEx4tmQ-1; Wed, 25 Oct 2023 07:40:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21E2D918566; Wed, 25 Oct 2023 11:39:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D42A8C0A; Wed, 25 Oct 2023 11:39:59 +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 F0D06194658C; Wed, 25 Oct 2023 11:39:58 +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 1900519466EC for ; Wed, 25 Oct 2023 11:39:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0C7E7492BFB; Wed, 25 Oct 2023 11:39:58 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F19B492BFA for ; Wed, 25 Oct 2023 11:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234011; 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=mnYnZjmMRn6SbabNPOnlNsbL/Nd4NmARqZyEOPaV7tA=; b=AR35vhs4GRzAv6ZDJfE0+v04Jmn7ibjV7VQWWe0L+vuBKAcq+dVsCHdNrapolfgMDScvuo LcICqLxZf3KNtYg94zZjp/tm3BBeTUN1zUMjjq1L8f3ORG2n8b5GwO7mUgu4riBv6i3c58 ytuC86sR7oNN25Bzpnq7lo9APZVjPwg= X-MC-Unique: 9E0E6juMM3OCLrTwEx4tmQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/22] qemu: block: Use qemuBlockStorageSourceAddBlockdevCommonProps for storage slice Date: Wed, 25 Oct 2023 13:39:27 +0200 Message-ID: <008036e98b14a2235409b5cd0f247200301848a1.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.5 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: 1698234013311100002 Content-Type: text/plain; charset="utf-8" Use the new helper in qemuBlockStorageSourceGetBlockdevStorageSliceProps to format the common bits. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 17 ++++++----------- .../disk-slices.x86_64-latest.args | 6 +++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index aeb05a7f00..dc6f34530b 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1484,26 +1484,21 @@ static virJSONValue * qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src) { g_autoptr(virJSONValue) props =3D NULL; - g_autoptr(virJSONValue) cache =3D NULL; - - if (qemuBlockNodeNameValidate(src->sliceStorage->nodename) < 0) - return NULL; - - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache) < 0) - return NULL; if (virJSONValueObjectAdd(&props, "s:driver", "raw", - "s:node-name", src->sliceStorage->nodename, "U:offset", src->sliceStorage->offset, "U:size", src->sliceStorage->size, "s:file", qemuBlockStorageSourceGetStorageNo= dename(src), - "b:auto-read-only", true, - "s:discard", "unmap", - "A:cache", &cache, NULL) < 0) return NULL; + if (qemuBlockStorageSourceAddBlockdevCommonProps(&props, + src, + src->sliceStorage->no= dename, + false) < 0) + return NULL; + return g_steal_pointer(&props); } diff --git a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args b/tests/= qemuxml2argvdata/disk-slices.x86_64-latest.args index deaa094379..363f0c0361 100644 --- a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args @@ -31,14 +31,14 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -blockdev '{"node-name":"libvirt-6-format","read-only":false,"driver":"raw= ","offset":0,"size":321,"file":"libvirt-6-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"li= bvirt-6-format","id":"virtio-disk0","bootindex":1}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/raw.img","= node-name":"libvirt-5-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"driver":"raw","node-name":"libvirt-5-slice-sto","offset":9876= ,"size":123456789,"file":"libvirt-5-storage","auto-read-only":true,"discard= ":"unmap"}' \ +-blockdev '{"driver":"raw","offset":9876,"size":123456789,"file":"libvirt-= 5-storage","node-name":"libvirt-5-slice-sto","auto-read-only":true,"discard= ":"unmap"}' \ -blockdev '{"node-name":"libvirt-5-format","read-only":true,"driver":"qcow= 2","file":"libvirt-5-slice-sto","backing":null}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/overlay.qc= ow2","node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap= "}' \ -blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"qco= w2","file":"libvirt-4-storage","backing":"libvirt-5-format"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"li= bvirt-4-format","id":"virtio-disk1"}' \ -object '{"qom-type":"secret","id":"libvirt-3-format-encryption-secret0","= data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","k= eyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw=3D=3D","format":"base64"}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/luks.img",= "node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"driver":"raw","node-name":"libvirt-3-slice-sto","offset":1234= ,"size":321,"file":"libvirt-3-storage","auto-read-only":true,"discard":"unm= ap"}' \ +-blockdev '{"driver":"raw","offset":1234,"size":321,"file":"libvirt-3-stor= age","node-name":"libvirt-3-slice-sto","auto-read-only":true,"discard":"unm= ap"}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"luk= s","key-secret":"libvirt-3-format-encryption-secret0","file":"libvirt-3-sli= ce-sto"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x4","drive":"li= bvirt-3-format","id":"virtio-disk2"}' \ -blockdev '{"driver":"nvme","device":"0000:02:00.0","namespace":1,"node-na= me":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \ @@ -46,7 +46,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x6","drive":"li= bvirt-2-format","id":"virtio-disk3"}' \ -object '{"qom-type":"secret","id":"libvirt-1-format-encryption-secret0","= data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","k= eyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw=3D=3D","format":"base64"}' \ -blockdev '{"driver":"nvme","device":"0001:02:00.0","namespace":2,"node-na= me":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"d= irect":true,"no-flush":false}}' \ --blockdev '{"driver":"raw","node-name":"libvirt-1-slice-sto","offset":1234= ,"size":321,"file":"libvirt-1-storage","auto-read-only":true,"discard":"unm= ap","cache":{"direct":true,"no-flush":false}}' \ +-blockdev '{"driver":"raw","offset":1234,"size":321,"file":"libvirt-1-stor= age","node-name":"libvirt-1-slice-sto","auto-read-only":true,"discard":"unm= ap","cache":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","encrypt":{"format":"luks","ke= y-secret":"libvirt-1-format-encryption-secret0"},"file":"libvirt-1-slice-st= o"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"li= bvirt-1-format","id":"virtio-disk4","write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234018; cv=none; d=zohomail.com; s=zohoarc; b=gHVGYqwbPR0dsEZjAYOjfLQyz5lfoqR2Ngjd9sUXcvn7XYxj5+8bdutXKJU090HOWs/ZrYyOp/SV/pxiUPbhF1vS229t2wmUPhJGvWFCrclOfxd8J7cG3vRCU0BBtWcSMvdmyxty0YmR3j3sqdT6fEGzjaP5iW3ZXG8XZSoeAi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234018; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=IGmI25UIUjTqBZZBifRxDvpoZleSiEZDc7cFhJTeJxE=; b=SNpK+Mrbet3vI9090ypKPSO3jCD7SkS8WTBq7X7fZtZAVrrHe3ixJSMkS3pJqhj17gZRj5AZwvDlSAo7Pji99mgy9Y8q62Z2yKjAA6zIWtlgRnFB+rY6oSCHczEf/yuEqUoXACRBasMwqW+8sRYqkyjXkG2zAinJDRbeMMqfL44= 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 1698234018214876.4122606033937; Wed, 25 Oct 2023 04:40:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554-ZV5HFZ6jMrm1ZyWIzyTruA-1; Wed, 25 Oct 2023 07:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6382B1C09A4C; Wed, 25 Oct 2023 11:40:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F94140C6F7B; Wed, 25 Oct 2023 11:40:00 +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 3EB4B194658C; Wed, 25 Oct 2023 11:40:00 +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 DB2D51946586 for ; Wed, 25 Oct 2023 11:39:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CACC7492BFD; Wed, 25 Oct 2023 11:39:58 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 590BE492BFB for ; Wed, 25 Oct 2023 11:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234017; 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=IGmI25UIUjTqBZZBifRxDvpoZleSiEZDc7cFhJTeJxE=; b=WtObErDOAQyjrBv2bPhsUpiYZMDbQckQCk19SZoWA0pQj1wZKCqnN5PmeEimDT/i93/9eX VbGwZilHQ/2rgx/Oh/nVt83x6JuM+0nAYKRS8p7DQZdB1LMapwh3wvBSwFP+HnTlpBYtRD L7u9IopTuqRI1s0+r6wjDO9593+xIFU= X-MC-Unique: ZV5HFZ6jMrm1ZyWIzyTruA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 18/22] qemuBlockStorageSourceGetBackendProps: Introduce QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE Date: Wed, 25 Oct 2023 13:39:28 +0200 Message-ID: <9ac9a1c2f90a2e0b79ffd1bc05c3401ab969a413.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.2 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: 1698234019435100002 Content-Type: text/plain; charset="utf-8" Introduce a mode where the protocol layer -blockdev will be formatted so that it can be used as the effective node (used to access data from the device). For this new mode we'll use qemuBlockStorageSourceAddBlockdevCommonProps. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 40 ++++++++++++++++++++++++---------------- src/qemu/qemu_block.h | 1 + 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index dc6f34530b..7902ef31b3 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1030,6 +1030,8 @@ qemuBlockStorageSourceAddBlockdevCommonProps(virJSONV= alue **props, * QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP: * don't enable 'discard:unmap' option for passing through discards * (note that this is disabled also for _LEGACY and _TARGET_ONLY opti= ons) + * QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE: + * the 'protocol' node is used as the effective/top node of a virStor= ageSource * * Creates a JSON object describing the underlying storage or protocol of a * storage source. Returns NULL on error and reports an appropriate error = message. @@ -1182,27 +1184,33 @@ qemuBlockStorageSourceGetBackendProps(virStorageSou= rce *src, return NULL; if (!onlytarget && !legacy) { - g_autoptr(virJSONValue) cache =3D NULL; - const char *discardstr =3D "unmap"; const char *nodename =3D qemuBlockStorageSourceGetStorageNodename(= src); - if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP) - discardstr =3D NULL; + if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE= ) { + if (qemuBlockStorageSourceAddBlockdevCommonProps(&fileprops, s= rc, nodename, true) < 0) + return NULL; + } else { + g_autoptr(virJSONValue) cache =3D NULL; + const char *discardstr =3D "unmap"; - if (qemuBlockNodeNameValidate(nodename) < 0) - return NULL; + if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP) + discardstr =3D NULL; - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache) < = 0) - return NULL; + if (qemuBlockNodeNameValidate(nodename) < 0) + return NULL; - if (virJSONValueObjectAdd(&fileprops, - "s:node-name", nodename, - "T:read-only", ro, - "T:auto-read-only", aro, - "S:discard", discardstr, - "A:cache", &cache, - NULL) < 0) - return NULL; + if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache= ) < 0) + return NULL; + + if (virJSONValueObjectAdd(&fileprops, + "s:node-name", nodename, + "T:read-only", ro, + "T:auto-read-only", aro, + "S:discard", discardstr, + "A:cache", &cache, + NULL) < 0) + return NULL; + } } return g_steal_pointer(&fileprops); diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 7bb83d8d44..9757108501 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -68,6 +68,7 @@ typedef enum { QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY =3D 1 << 1, QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY =3D 1 << 2, QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP =3D 1 << 3, + QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE =3D 1 << 4, } qemuBlockStorageSourceBackendPropsFlags; virJSONValue * --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234065; cv=none; d=zohomail.com; s=zohoarc; b=O+j6SpcxB4VUUlVqH99Yw59AYUbUDNuUeFVc/F2P9nBC1dwAJxiM/ZzJqjqWS2a5wf0TB8qTIkQ0AsnwbwiQqQEpJP1NsJh0Tmlq47Q7S8VIjLeTWbxwvChDHdRs8rc2NdMcqNI8OPPvgt+EqPRs9EY+b8pArLpuKoPliogWHE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234065; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=f/GNBRq5IrIVrROkQ9KGlGnGM/M6z3ftKPKag5GsK8o=; b=TJktw7qClOBSlRkpzDiPvT6A7Xpx2ynN94S/hqvTEX16CW5HG5mxSlC69XFFJ7WsCRlzPMS4OHPts+jgcLzefK3sXDLOh4v5v/Pr+wKf6e5gJ3K7/1HHvxu+On1Iqj68yttK4vYL7nnYKGyHEySBp5uxfjMjIU+9y613KynEEyg= 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 1698234065415915.998016114041; Wed, 25 Oct 2023 04:41:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-494-EpeXvK1SOT2kHVbOWw3XaQ-1; Wed, 25 Oct 2023 07:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A85CC80D185; Wed, 25 Oct 2023 11:40:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E713492BD9; Wed, 25 Oct 2023 11:40:02 +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 74CF019465A0; Wed, 25 Oct 2023 11:40: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 BF819194658C for ; Wed, 25 Oct 2023 11:39:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9A43E492BFC; Wed, 25 Oct 2023 11:39:59 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2398E492BFA for ; Wed, 25 Oct 2023 11:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234064; 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=f/GNBRq5IrIVrROkQ9KGlGnGM/M6z3ftKPKag5GsK8o=; b=LoaMTa5VQtK8EKX1/tSzKZ2c1ev+Pm93TJQM9LpUN+8yzOk329+fNLA/iWRmHo4rShVC0n Vgmvon2IsZA8HIrFstfC3ZgssNQgIgBlRbd4dBgYMydAb5nfVzSLHZezJ/eXxvjVp9jqGc 2sGmA0wL3dy5Rztxe2cz3oBIIW3XdRk= X-MC-Unique: EpeXvK1SOT2kHVbOWw3XaQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/22] qemuBuildHostdevSCSIAttachPrepare: Use "effective node" mode for getting blockdev props Date: Wed, 25 Oct 2023 13:39:29 +0200 Message-ID: <21b147e321fccd2ae5c705d00c9ecf6628dee9d8.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.9 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: 1698234067545100001 Content-Type: text/plain; charset="utf-8" The resulting properties are identical, as the hostdev backend code doesn't set any of the extra properties. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 98e7fa3d80..2674dd6959 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5066,8 +5066,7 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef= *hostdev, ret->storageNodeName =3D qemuBlockStorageSourceGetStorageNodename(src); *backendAlias =3D qemuBlockStorageSourceGetStorageNodename(src); - if (!(ret->storageProps =3D qemuBlockStorageSourceGetBackendProps(src, - QEMU_B= LOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP))) + if (!(ret->storageProps =3D qemuBlockStorageSourceGetBackendProps(src,= QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE))) return NULL; if (qemuBuildStorageSourceAttachPrepareCommon(src, ret) < 0) --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234077; cv=none; d=zohomail.com; s=zohoarc; b=ViRAQpqLhtCTtAJzFpP3ZN6veysTuoPCs7DvQ9TT+HRqajS/6tqkxr9npGRtNQCYdX5nOh3O0XSwZOBFZNgER2+xoje2lgwo20riRX3Jo/utg+ITqinoRbFvUQPt3I8PvuVvmyDQNNWAye2mgFKxlZY6ndhLqtqhKKjk3y9MD3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234077; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=0yhLErluNNrLQZ15jl9vkwDKI2kqehdI8ls7irxE4Yg=; b=dkeUWdnSh2MBsfTTUz/tMzeNUNZR58+i58xdLjIBYiiAv8+0umDY3nIRpXf4YKHsAcr9O/AVtDctg7bXdBGOcXk0IT7QSDt/1XasEVyhCPnz2TioDvyVIi1GGup+h6RTMbzN18nMqlLjuPuFNMtbvuOmMPwsBK2Hv84KDuM7Fy0= 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 1698234077376797.5928200098006; Wed, 25 Oct 2023 04:41:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-0nmr1Z7sMEKybAhGD02vzw-1; Wed, 25 Oct 2023 07:40:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E62E856F66; Wed, 25 Oct 2023 11:40:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4855D2166B26; Wed, 25 Oct 2023 11:40:01 +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 378E9194658C; Wed, 25 Oct 2023 11:40:01 +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 8606619465B6 for ; Wed, 25 Oct 2023 11:40:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 767CE492BFC; Wed, 25 Oct 2023 11:40:00 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEB55492BFA for ; Wed, 25 Oct 2023 11:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234076; 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=0yhLErluNNrLQZ15jl9vkwDKI2kqehdI8ls7irxE4Yg=; b=YiPf6gX9gtTwURpOir11468c+Z+4S4xdEy5hIjqMzxts+Ho0z+61w2HvLiRhx01/F0MO6Y ffJLFU6Lpsy98w3Gp+/XoDXs+s5ee5R/sMmbrY2NI6hPlA6q4xUOCsjdW0uF94M8oQT9tn IQdyaEWIB7IwwzI3YFoS7en2iNfT+VE= X-MC-Unique: 0nmr1Z7sMEKybAhGD02vzw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/22] qemuBlockStorageSourceGetBackendProps: Use qemuBlockStorageSourceAddBlockdevCommonProps Date: Wed, 25 Oct 2023 13:39:30 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.6 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: 1698234079553100001 Content-Type: text/plain; charset="utf-8" Use the qemuBlockStorageSourceAddBlockdevCommonProps helper when formatting protocol layer both when it's used as backing for a format node and when it's used as the effective node. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 7902ef31b3..5c8d107257 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1184,33 +1184,10 @@ qemuBlockStorageSourceGetBackendProps(virStorageSou= rce *src, return NULL; if (!onlytarget && !legacy) { - const char *nodename =3D qemuBlockStorageSourceGetStorageNodename(= src); - - if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE= ) { - if (qemuBlockStorageSourceAddBlockdevCommonProps(&fileprops, s= rc, nodename, true) < 0) - return NULL; - } else { - g_autoptr(virJSONValue) cache =3D NULL; - const char *discardstr =3D "unmap"; - - if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP) - discardstr =3D NULL; - - if (qemuBlockNodeNameValidate(nodename) < 0) + if (qemuBlockStorageSourceAddBlockdevCommonProps(&fileprops, src, + qemuBlockStorageS= ourceGetStorageNodename(src), + !!(flags & QEMU_B= LOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE)) < 0) return NULL; - - if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, &cache= ) < 0) - return NULL; - - if (virJSONValueObjectAdd(&fileprops, - "s:node-name", nodename, - "T:read-only", ro, - "T:auto-read-only", aro, - "S:discard", discardstr, - "A:cache", &cache, - NULL) < 0) - return NULL; - } } return g_steal_pointer(&fileprops); --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234017; cv=none; d=zohomail.com; s=zohoarc; b=Dj8zpNh/vxMpJwOkdWf0NicYlMvH/aUBt8JlHEP0XV8+32D43Tev0eq1wM6epIWDYIs7FTjccoriR2+g+uOCNdMFg8JU21H/r2yJmy1NMd6zjt+waQmQxntQvLY5CZoodvD3TlTdEvdXQpqR45Yu4B7s+YkknqjdHGv4BRHrb3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234017; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=4AVnyGTjos8qXZZFeQqPnL8MmCFg2wGFXCYfHSNv9ys=; b=JRpHErmxLPFitf/EJnp1D/sxaCG2QIoyLUUkF8v9kSquVbnZVS1Ef2oIZCZU+fIlPwdYcM1qm05MovT5lmUh64ReCx5RAH+c4dQ+92cX/XbZ6eHPrcx4+u1U+lK2Xa6+RvXknKNbqFSBL5Y/kfzLFXh+gVc9wIswJkGuhSomp/E= 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 1698234017340624.5130905044085; Wed, 25 Oct 2023 04:40:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-177-YPzyuypQMdqJTU50Ccc5Zg-1; Wed, 25 Oct 2023 07:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3462811E93; Wed, 25 Oct 2023 11:40:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E4CF8C0A; Wed, 25 Oct 2023 11:40:02 +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 70C6B1946595; Wed, 25 Oct 2023 11:40: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 6B2EE19465B6 for ; Wed, 25 Oct 2023 11:40:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4C23A492BFA; Wed, 25 Oct 2023 11:40:01 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2663492BFB for ; Wed, 25 Oct 2023 11:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234016; 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=4AVnyGTjos8qXZZFeQqPnL8MmCFg2wGFXCYfHSNv9ys=; b=JY/ZlzeOeQmURfCG6lAgSOb9uEnBMUNbaxFKtQkGzrVzcrK1/aAVCtYRJ/bXNDkIvoWlgC vNfXlF+rD4BTFqFk60UnzUCDguYj1qdOi1W6d7Cfmblpv1KWm8DzWrGxBQPVRy1quTpryM kRmUD1EFxXlRMM39OKkgm5CyfqrMAsg= X-MC-Unique: YPzyuypQMdqJTU50Ccc5Zg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 21/22] qemuBlockStorageSourceGetBackendProps: Remove unused logic for (auto-)read-only flags Date: Wed, 25 Oct 2023 13:39:31 +0200 Message-ID: <858b5dcb61b45664c32e1efb08454f84e04a7b17.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.5 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: 1698234019432100001 Content-Type: text/plain; charset="utf-8" The code was refactored to format the 'read-only' and 'auto-read-only' flags via the common helper, so the logic determining their values can be removed. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 5c8d107257..a625e72a5d 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -806,9 +806,7 @@ qemuBlockStorageSourceGetSshProps(virStorageSource *src) static virJSONValue * qemuBlockStorageSourceGetFileProps(virStorageSource *src, - bool onlytarget, - virTristateBool *autoReadOnly, - virTristateBool *readOnly) + bool onlytarget) { const char *path =3D src->path; const char *iomode =3D NULL; @@ -824,25 +822,8 @@ qemuBlockStorageSourceGetFileProps(virStorageSource *s= rc, if (src->iomode !=3D VIR_DOMAIN_DISK_IO_DEFAULT) iomode =3D virDomainDiskIoTypeToString(src->iomode); - if (srcpriv && srcpriv->fdpass) { + if (srcpriv && srcpriv->fdpass) path =3D qemuFDPassGetPath(srcpriv->fdpass); - - /* when passing a FD to qemu via the /dev/fdset mechanism qemu - * fetches the appropriate FD from the fdset by checking that = it has - * the correct accessmode. Now with 'auto-read-only' in effect= qemu - * wants to use a read-only FD first. If the user didn't pass = multiple - * FDs the feature will not work regardless, so we'll disable = it. */ - if (src->fdtuple->nfds =3D=3D 1) { - *autoReadOnly =3D VIR_TRISTATE_BOOL_ABSENT; - - /* now we setup the normal readonly flag. If user requeste= d write - * access honour it */ - if (src->fdtuple->writable) - *readOnly =3D VIR_TRISTATE_BOOL_NO; - else - *readOnly =3D virTristateBoolFromBool(src->readonly); - } - } } ignore_value(virJSONValueObjectAdd(&ret, @@ -1043,20 +1024,9 @@ qemuBlockStorageSourceGetBackendProps(virStorageSour= ce *src, virStorageType actualType =3D virStorageSourceGetActualType(src); g_autoptr(virJSONValue) fileprops =3D NULL; const char *driver =3D NULL; - virTristateBool aro =3D VIR_TRISTATE_BOOL_ABSENT; - virTristateBool ro =3D VIR_TRISTATE_BOOL_ABSENT; bool onlytarget =3D flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TA= RGET_ONLY; bool legacy =3D flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY; - if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY) { - aro =3D VIR_TRISTATE_BOOL_YES; - } else { - if (src->readonly) - ro =3D VIR_TRISTATE_BOOL_YES; - else - ro =3D VIR_TRISTATE_BOOL_NO; - } - switch (actualType) { case VIR_STORAGE_TYPE_BLOCK: case VIR_STORAGE_TYPE_FILE: @@ -1069,7 +1039,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourc= e *src, driver =3D "file"; } - if (!(fileprops =3D qemuBlockStorageSourceGetFileProps(src, onlyta= rget, &aro, &ro))) + if (!(fileprops =3D qemuBlockStorageSourceGetFileProps(src, onlyta= rget))) return NULL; break; --=20 2.41.0 From nobody Mon May 13 00:12:16 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=1698234123; cv=none; d=zohomail.com; s=zohoarc; b=jsUXFvg2kYv/A6/WTHmxcZfBdUAp7ns2ENj1jH7J8v8o7gkC/95ZgdmmY6GQglSNMNcfnMhnY+KFucqg8zZs1MvPUj6xIWaPBf6LtWJ2sXlN7v+62vEEyeIlxCkX1cg1+myQ0JWcK1lIPuaYi8qPtXbcmVNePRgXrgSIXiZVlzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234123; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=cwj7JJZ+HeGUCeVXl+OUZ9CCMUzrB4B1CTxhwgx7mdA=; b=JwRaQ/6TyYKAbHf8XYpnDdYkXAkxByu7tXFuItLIA8ffjNM5PRjeiej18JYH3JiETqpJPO2OP9fw2dtw1w3D6Tk7M7MrMoM53BIiGQyjQUOqURwNNozKicDCBeDF5BSAYG3kTKtwtNKCxo/R3G7bbO4RcMnQPDbOJMkAinUND8M= 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 1698234123903139.08350663599958; Wed, 25 Oct 2023 04:42:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-bonkDBs5OiKlccnbdkklFw-1; Wed, 25 Oct 2023 07:40:17 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73D13853088; Wed, 25 Oct 2023 11:40:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 590EC112BC; Wed, 25 Oct 2023 11:40: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 C9E0319466ED; Wed, 25 Oct 2023 11:40: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 445CC1946586 for ; Wed, 25 Oct 2023 11:40:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1EC86492BFB; Wed, 25 Oct 2023 11:40:02 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 982BA492BFA for ; Wed, 25 Oct 2023 11:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234122; 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=cwj7JJZ+HeGUCeVXl+OUZ9CCMUzrB4B1CTxhwgx7mdA=; b=AHiQOjvVEbtuMtJ0kA4ngGib8yFqsHJilE2YM3UULD+7JfcM8gTks3mVsY+NPq8/QlWUxa N7ErVXJ3Lfrxcs+pCIftgIgb7XTMlO7lwW7yuCN1G/Wn7EbvjT8JqNwDRyHzOzNZD+z8XA 93T91N14ZznNS/tnoqQw8gME6eAoprk= X-MC-Unique: bonkDBs5OiKlccnbdkklFw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 22/22] qemu: block: Remove unused flags QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_ flags Date: Wed, 25 Oct 2023 13:39:32 +0200 Message-ID: <108d74bee5dd869fb980f146c702b025c8021231.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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.4.1 on 10.11.54.5 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: 1698234125843100001 Content-Type: text/plain; charset="utf-8" QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP is no longer referenced inside the code. QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY is passed from various code paths to the qemuBlockStorageSourceGetBackendProps helper, but it's no longer used. Both thus can be removed. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 7 +------ src/qemu/qemu_block.h | 4 +--- tests/qemublocktest.c | 7 ++----- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a625e72a5d..382015f293 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1006,11 +1006,6 @@ qemuBlockStorageSourceAddBlockdevCommonProps(virJSON= Value **props, * use legacy formatting of attributes (for -drive / old qemus) * QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY: * omit any data which does not identify the image itself - * QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY: - * use the auto-read-only feature of qemu - * QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP: - * don't enable 'discard:unmap' option for passing through discards - * (note that this is disabled also for _LEGACY and _TARGET_ONLY opti= ons) * QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE: * the 'protocol' node is used as the effective/top node of a virStor= ageSource * @@ -1510,7 +1505,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorag= eSource *src, virStorageSource *backingStore) { g_autoptr(qemuBlockStorageSourceAttachData) data =3D NULL; - unsigned int backendpropsflags =3D QEMU_BLOCK_STORAGE_SOURCE_BACKEND_P= ROPS_AUTO_READONLY; + unsigned int backendpropsflags =3D 0; data =3D g_new0(qemuBlockStorageSourceAttachData, 1); diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 9757108501..5c784a4386 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -66,9 +66,7 @@ qemuBlockStorageSourceSupportsConcurrentAccess(virStorage= Source *src); typedef enum { QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY =3D 1 << 0, QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY =3D 1 << 1, - QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY =3D 1 << 2, - QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP =3D 1 << 3, - QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE =3D 1 << 4, + QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE =3D 1 << 2, } qemuBlockStorageSourceBackendPropsFlags; virJSONValue * diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index b8db1a2570..c581bd1748 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -285,9 +285,6 @@ testQemuDiskXMLToProps(const void *opaque) for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backingSt= ore) { g_autofree char *backingstore =3D NULL; - unsigned int backendpropsflagsnormal =3D QEMU_BLOCK_STORAGE_SOURCE= _BACKEND_PROPS_AUTO_READONLY; - unsigned int backendpropsflagstarget =3D QEMU_BLOCK_STORAGE_SOURCE= _BACKEND_PROPS_AUTO_READONLY | - QEMU_BLOCK_STORAGE_SOURCE_B= ACKEND_PROPS_TARGET_ONLY; if (testQemuDiskXMLToJSONFakeSecrets(n) < 0) return -1; @@ -298,8 +295,8 @@ testQemuDiskXMLToProps(const void *opaque) qemuDomainPrepareDiskSourceData(disk, n); if (!(formatProps =3D qemuBlockStorageSourceGetFormatProps(n, n->b= ackingStore)) || - !(storageSrcOnlyProps =3D qemuBlockStorageSourceGetBackendProp= s(n, backendpropsflagstarget)) || - !(storageProps =3D qemuBlockStorageSourceGetBackendProps(n, ba= ckendpropsflagsnormal)) || + !(storageSrcOnlyProps =3D qemuBlockStorageSourceGetBackendProp= s(n, QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY)) || + !(storageProps =3D qemuBlockStorageSourceGetBackendProps(n, 0)= ) || !(backingstore =3D qemuBlockGetBackingStoreString(n, true))) { if (!data->fail) { VIR_TEST_VERBOSE("failed to generate qemu blockdev props"); --=20 2.41.0