[PATCH] qemu: Fix the wrong logic of building cmd line for volume type disk

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

 



It builds a "libiscsi" uri if the volume type is "file" and
"disk->auth.username" is specified, but I even see no reason to
build the "libiscsi" uri for a "file" type volume, and the logic
to check whether "disk->auth.username" is specified is also beyond
understanding.

It produces unexpected result like below:

  Disk config (pool is of 'fs' type):

    <disk type='volume' device='disk'>
      <driver name='qemu' type='raw'/>
      <auth username='myuser'>
      </auth>
      <source pool='default' volume='f18.img'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

  % virsh start f18
  error: Failed to start domain f18
  error: internal error: iscsi accepts only one host
---
 src/qemu/qemu_command.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index abb62e9..9b6a27d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3806,13 +3806,7 @@ qemuBuildVolumeString(virConnectPtr conn,
         }
         break;
     case VIR_STORAGE_VOL_FILE:
-        if (disk->auth.username) {
-            if (qemuBuildISCSIString(conn, disk, opt) < 0)
-                goto cleanup;
-            virBufferAddChar(opt, ',');
-        } else {
-            virBufferEscape(opt, ',', ",", "file=%s,", disk->src);
-        }
+        virBufferEscape(opt, ',', ",", "file=%s,", disk->src);
         break;
     case VIR_STORAGE_VOL_NETWORK:
         /* Keep the compiler quite, qemuTranslateDiskSourcePool already
-- 
1.8.1.4

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