[virt-manager] [PATCH] fsdetails: Fix an error with source.socket of virtiofs

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


Using the source.socket of virtiofs needs a virtiofsd daemon launched
outside of libvirtd, So the filesystem UI doesn't support it yet. If
users need it they can set it manually in the XML editor.
But if we view the filesystem info of such a VM on the details page,
It fails with this error message:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details/details.py", line 1713, in _refresh_page
  File "/usr/share/virt-manager/virtManager/details/details.py", line 2241, in _refresh_filesystem_page
  File "/usr/share/virt-manager/virtManager/device/fsdetails.py", line 193, in set_dev
TypeError: Argument 1 does not allow None as a value

This patch fixes above issue by leaving the 'source path' info blank in
case of source.socket.
In this case, Considering that showing 'target path' info without source
info is kind of meaningless, So this patch leaves the 'target path' info
blank as well.

Signed-off-by: Lin Ma <lma@xxxxxxxx>
 virtManager/device/fsdetails.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/virtManager/device/fsdetails.py b/virtManager/device/fsdetails.py
index 40868d1c..67716eab 100644
--- a/virtManager/device/fsdetails.py
+++ b/virtManager/device/fsdetails.py
@@ -190,10 +190,10 @@ class vmmFSDetails(vmmGObjectUI):
                 self.widget("fs-format-combo"), dev.driver_format)
         if dev.type != DeviceFilesystem.TYPE_RAM:
-            self.widget("fs-source").set_text(dev.source)
+            self.widget("fs-source").set_text(dev.source or "")
             self.widget("fs-ram-source-spin").set_value(int(dev.source) // 1024)
-        self.widget("fs-target").set_text(dev.target or "")
+        self.widget("fs-target").set_text(dev.target and dev.source or "")
         self._active_edits = []

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux