]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Put format=raw onto cmd line for SCSI passthrough
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Oct 2018 09:09:56 +0000 (11:09 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 17 Oct 2018 07:16:20 +0000 (09:16 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=1632833

When doing a SCSI passthrough we don't put format= 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 <pbonzini@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/hostdev-scsi-lsi.args
tests/qemuxml2argvdata/hostdev-scsi-readonly.args
tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args

index 269276f2f969a8a8cc7616ddbc6659fcbee6688b..1ff593c657f03d5d0cd4e6aa7f9ef2aae1a6bbcf 100644 (file)
@@ -4841,7 +4841,7 @@ qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
     } else {
         if (!(source = qemuBuildSCSIHostHostdevDrvStr(dev)))
             goto error;
-        virBufferAsprintf(&buf, "file=/dev/%s,if=none", source);
+        virBufferAsprintf(&buf, "file=/dev/%s,if=none,format=raw", source);
     }
     VIR_FREE(source);
 
index d05e2a8bf89521f7fe1adb9a42e0644188af40c6..f2048fe920c999fd5aa6d2488e2436f25b049d58 100644 (file)
@@ -25,6 +25,6 @@ server,nowait \
 -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\
 bootindex=1 \
--drive file=/dev/sg0,if=none,id=drive-hostdev0 \
+-drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0 \
 -device scsi-generic,bus=scsi0.0,scsi-id=7,drive=drive-hostdev0,id=hostdev0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
index c6336ca4412b52a83fa812a76d54fafc9cd6dce0..0d5a0d327d7821d5992c4fe0b8a3f99fe5841bfd 100644 (file)
@@ -25,7 +25,7 @@ server,nowait \
 -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\
 bootindex=1 \
--drive file=/dev/sg0,if=none,id=drive-hostdev0,readonly=on \
+-drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0,readonly=on \
 -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=8,\
 drive=drive-hostdev0,id=hostdev0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
index 4bf4ce7f82d8f89545ee0e9a84f495ee7bf044ae..13a1e9fe951bae53289eb61024baeb97d4e140f9 100644 (file)
@@ -25,7 +25,7 @@ server,nowait \
 -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\
 bootindex=1 \
--drive file=/dev/sg0,if=none,id=drive-hostdev0 \
+-drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0 \
 -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=8,\
 drive=drive-hostdev0,id=hostdev0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4