Re: [PATCHv5 2/2] qemu: Disk Geometry Override Support

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

 



On 08/20/2012 02:06 PM, Daniel P. Berrange wrote:
On Mon, Aug 20, 2012 at 01:58:25PM +0200, Viktor Mihajlovski wrote:
From: J.B. Joret <jb@xxxxxxxxxxxxxxxxxx>

Qemu command line generation for geometry override and testcases.

V2 Changes: squashed qemu code and testcases.

V3 Changes: use virReportError.

V4 Changes: rebase

V5 Changes: Fixed test invocation for geometry.

Signed-off-by: J.B. Joret <jb@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Viktor Mihajlovski <mihajlov@xxxxxxxxxxxxxxxxxx>

Signed-off-by: Viktor Mihajlovski <mihajlov@xxxxxxxxxxxxxxxxxx>
---
  src/qemu/qemu_command.c                            |   59 ++++++++++++++++++++
  .../qemuxml2argv-disk-geometry.args                |    4 +
  .../qemuxml2argv-disk-geometry.xml                 |   26 +++++++++
  tests/qemuxml2argvtest.c                           |    2 +
  4 files changed, 91 insertions(+), 0 deletions(-)
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.xml

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9383530..cc44015 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2073,6 +2073,8 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED,
  {
      virBuffer opt = VIR_BUFFER_INITIALIZER;
      const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
+    const char *trans =
+        virDomainDiskGeometryTransTypeToString(disk->geometry.trans);
      int idx = virDiskNameToIndex(disk->dst);
      int busid = -1, unitid = -1;

@@ -2275,6 +2277,24 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED,
          disk->type != VIR_DOMAIN_DISK_TYPE_DIR &&
          qemuCapsGet(qemuCaps, QEMU_CAPS_DRIVE_FORMAT))
          virBufferAsprintf(&opt, ",format=%s", disk->driverType);
+
+    /* generate geometry command string*/
+    if (disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK ||
+        disk->type == VIR_DOMAIN_DISK_TYPE_FILE) {

The cylinders/heads/sectors  data is part of the guest side device
model.  The disk->type == block|file|network is part of the host
side device model. IIUC, there should be no dependency between host
and guest side data for this property, so IMHO this if() should be
removed.



good catch. As the same suppression happens in domain_conf.c, I will resend the series.

--

Mit freundlichen Grüßen/Kind Regards
   Viktor Mihajlovski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

--
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]