[PATCH 02/12] qemu: command: Format frontend props with -device rather than -drive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Historically we've formatted a lot of the attributes of a disk (disk
geometry, etc) with -drive. Since we use -device now, they should be
formatted there.
---
 src/qemu/qemu_command.c                                | 5 ++++-
 tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9dac68981a..8c7bb245ed 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1689,7 +1689,8 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
     if (disk->src->readonly)
         virBufferAddLit(&opt, ",readonly=on");

-    qemuBuildDiskFrontendAttributes(disk, &opt);
+    if (!emitDeviceSyntax)
+        qemuBuildDiskFrontendAttributes(disk, &opt);

     if (disk->serial &&
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL)) {
@@ -2124,6 +2125,8 @@ qemuBuildDriveDevStr(const virDomainDef *def,
                               disk->blockio.physical_block_size);
     }

+    qemuBuildDiskFrontendAttributes(disk, &opt);
+
     if (disk->wwn) {
         if (STRPREFIX(disk->wwn, "0x"))
             virBufferAsprintf(&opt, ",wwn=%s", disk->wwn);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args
index 3badaae28c..2b92dde39f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args
@@ -19,7 +19,7 @@ server,nowait \
 -no-acpi \
 -boot c \
 -usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0,\
-cyls=16383,heads=16,secs=63,trans=lba \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-drive file=/dev/HostVG/QEMUGuest1,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,cyls=16383,\
+heads=16,secs=63,trans=lba \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
-- 
2.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux