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

Re: [libvirt] [PATCH]: ignore empty type attribute, was Re: empty type parameter in driver tag for disk in machine xml file



On Tue, Apr 20, 2010 at 08:20:35AM -0600, Eric Blake wrote:
> On 04/19/2010 10:16 AM, Guido Günther wrote:
[..snip..] 
> since the former is O(1) while the latter is nominally O(n) in the
Good point. New patch attached.
 -- Guido
>From 6dc897319fd6ff6863895ffac01e5a38ba911abd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx sigxcpu org>
Date: Mon, 19 Apr 2010 18:08:19 +0200
Subject: [PATCH] Ignore empty type attribute in driver element of virtual disks

Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578347
---
 src/qemu/qemu_conf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 0cbedf2..355fdb9 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -2479,7 +2479,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
     if (disk->readonly &&
         qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)
         virBufferAddLit(&opt, ",readonly=on");
-    if (disk->driverType &&
+    if (disk->driverType && *disk->driverType != '\0' &&
         disk->type != VIR_DOMAIN_DISK_TYPE_DIR &&
         qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE_FORMAT)
         virBufferVSprintf(&opt, ",format=%s", disk->driverType);
-- 
1.7.0.4


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