From nobody Wed Apr 24 20:18:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153934290482388.99192232012035; Fri, 12 Oct 2018 04:15:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01B5A88E4F; Fri, 12 Oct 2018 11:15:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2A6F912A7; Fri, 12 Oct 2018 11:15:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 75D794BB79; Fri, 12 Oct 2018 11:14:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9CBEua7025758 for ; Fri, 12 Oct 2018 07:14:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4758D6047F; Fri, 12 Oct 2018 11:14:56 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id C340E60476 for ; Fri, 12 Oct 2018 11:14:53 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 12 Oct 2018 13:14:51 +0200 Message-Id: <27d2fab3e79edc82b180a1ba679f784d08f818d3.1539342883.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: Put format=raw onto cmd line for SCSI passthrough X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 12 Oct 2018 11:15:03 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1632833 When doing a SCSI passthrough we don't put format=3D onto the command line. This causes qemu to probe the format automatically which ends up in a warning in the domain log and possible qemu disabling writes to the first block (according to the warning message). Based-on-work-of: Paolo Bonzini Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 2 +- tests/qemuxml2argvdata/hostdev-scsi-lsi.args | 2 +- tests/qemuxml2argvdata/hostdev-scsi-readonly.args | 2 +- tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 269276f2f9..1ff593c657 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4841,7 +4841,7 @@ qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev, } else { if (!(source =3D qemuBuildSCSIHostHostdevDrvStr(dev))) goto error; - virBufferAsprintf(&buf, "file=3D/dev/%s,if=3Dnone", source); + virBufferAsprintf(&buf, "file=3D/dev/%s,if=3Dnone,format=3Draw", s= ource); } VIR_FREE(source); =20 diff --git a/tests/qemuxml2argvdata/hostdev-scsi-lsi.args b/tests/qemuxml2a= rgvdata/hostdev-scsi-lsi.args index d05e2a8bf8..f2048fe920 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-lsi.args +++ b/tests/qemuxml2argvdata/hostdev-scsi-lsi.args @@ -25,6 +25,6 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ bootindex=3D1 \ --drive file=3D/dev/sg0,if=3Dnone,id=3Ddrive-hostdev0 \ +-drive file=3D/dev/sg0,if=3Dnone,format=3Draw,id=3Ddrive-hostdev0 \ -device scsi-generic,bus=3Dscsi0.0,scsi-id=3D7,drive=3Ddrive-hostdev0,id= =3Dhostdev0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/hostdev-scsi-readonly.args b/tests/qemu= xml2argvdata/hostdev-scsi-readonly.args index c6336ca441..0d5a0d327d 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-readonly.args +++ b/tests/qemuxml2argvdata/hostdev-scsi-readonly.args @@ -25,7 +25,7 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ bootindex=3D1 \ --drive file=3D/dev/sg0,if=3Dnone,id=3Ddrive-hostdev0,readonly=3Don \ +-drive file=3D/dev/sg0,if=3Dnone,format=3Draw,id=3Ddrive-hostdev0,readonly= =3Don \ -device scsi-generic,bus=3Dscsi0.0,channel=3D0,scsi-id=3D4,lun=3D8,\ drive=3Ddrive-hostdev0,id=3Dhostdev0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args b/tests/q= emuxml2argvdata/hostdev-scsi-virtio-scsi.args index 4bf4ce7f82..13a1e9fe95 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args +++ b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args @@ -25,7 +25,7 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ bootindex=3D1 \ --drive file=3D/dev/sg0,if=3Dnone,id=3Ddrive-hostdev0 \ +-drive file=3D/dev/sg0,if=3Dnone,format=3Draw,id=3Ddrive-hostdev0 \ -device scsi-generic,bus=3Dscsi0.0,channel=3D0,scsi-id=3D4,lun=3D8,\ drive=3Ddrive-hostdev0,id=3Dhostdev0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list