[libvirt] [PATCH] virsh: doc: Fix supported driver types for attach-disk command

Peter Krempa pkrempa at redhat.com
Mon Sep 19 12:57:07 UTC 2011


Virsh man page lists driver types to be used with attach-device
command, but does not specify that those are usable only with the XEN
Hypervisor.

This patch adds statement, that those options specified are applicable
only on the Xen hypervisor and adds option usable with qemu emulator.

This patch also changes type of error returned by QEMU driver if the
user specifies incompatible driver type from VIR_ERR_INTERNAL_ERROR to
VIR_ERR_NO_SUPPORT.
---
 src/qemu/qemu_command.c |    2 +-
 src/qemu/qemu_driver.c  |    2 +-
 tools/virsh.pod         |    3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e8b1157..9ca8c1b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3657,7 +3657,7 @@ qemuBuildCommandLine(virConnectPtr conn,

         if (disk->driverName != NULL &&
             !STREQ(disk->driverName, "qemu")) {
-            qemuReportError(VIR_ERR_INTERNAL_ERROR,
+            qemuReportError(VIR_ERR_NO_SUPPORT,
                             _("unsupported driver name '%s' for disk '%s'"),
                             disk->driverName, disk->src);
             goto error;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e2f428f..602f3e6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5208,7 +5208,7 @@ qemuDomainAttachDeviceDiskLive(struct qemud_driver *driver,
     int ret = -1;

     if (disk->driverName != NULL && !STREQ(disk->driverName, "qemu")) {
-        qemuReportError(VIR_ERR_INTERNAL_ERROR,
+        qemuReportError(VIR_ERR_NO_SUPPORT,
                         _("unsupported driver name '%s' for disk '%s'"),
                         disk->driverName, disk->src);
         goto end;
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 02726f3..6b6e7f6 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1166,7 +1166,8 @@ the single existing device; consider using B<update-device> for this usage.

 Attach a new disk device to the domain.
 I<source> and I<target> are paths for the files and devices.
-I<driver> can be I<file>, I<tap> or I<phy> depending on the kind of access.
+I<driver> can be I<file>, I<tap> or I<phy> for the Xen hypervisor depending on
+the kind of access or I<qemu> for the QEMU emulator.
 I<type> can indicate I<cdrom> or I<floppy> as alternative to the disk default,
 although this use only replaces the media within the existing virtual cdrom or
 floppy device; consider using B<update-device> for this usage instead.
-- 
1.7.3.4




More information about the libvir-list mailing list