]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: nodedev: ability to filter CCW capabilities
authorBjoern Walk <bwalk@linux.vnet.ibm.com>
Mon, 22 May 2017 06:38:23 +0000 (08:38 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 26 May 2017 14:44:05 +0000 (10:44 -0400)
Now that the node_device driver is aware of CCW devices, let's hook up
virsh so that we can filter them properly.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
docs/formatnode.html.in
include/libvirt/libvirt-nodedev.h
src/conf/node_device_conf.h
src/conf/virnodedeviceobj.c
src/libvirt-nodedev.c
tools/virsh-nodedev.c
tools/virsh.pod

index a368ffc07dadbd4d22b4fbf93c9147a3c52230b4..32451d5575ffddd2928483d34408d76c322de159 100644 (file)
               <code>render</code>.</dd>
             </dl>
           </dd>
+          <dt><code>ccw</code></dt>
+          <dd>Describes a Command Channel Word (CCW) device commonly found on
+          the S390 architecture. Sub-elements include:
+            <dl>
+              <dt><code>cssid</code></dt>
+              <dd>The channel subsystem identifier.</dd>
+              <dt><code>ssid</code></dt>
+              <dd>The subchannel-set identifier.</dd>
+              <dt><code>devno</code></dt>
+              <dd>The device number.</dd>
+            </dl>
+          </dd>
         </dl>
       </dd>
     </dl>
index 1e304378776c8b302f23476d152823709313c9fd..cd3f2372b02eb2a4374c4c64ad0732668e90cb8f 100644 (file)
@@ -81,6 +81,7 @@ typedef enum {
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM           = 1 << 12, /* DRM device */
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES    = 1 << 13, /* Capable of mediated devices */
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV          = 1 << 14, /* Mediated device */
+    VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV       = 1 << 15, /* CCW device */
 } virConnectListAllNodeDeviceFlags;
 
 int                     virConnectListAllNodeDevices (virConnectPtr conn,
index bf9d5fce56eda9f7406dee42916bebd26731b20e..285841edc0c3b16d7fd222278c114363e7e2dc65 100644 (file)
@@ -388,7 +388,8 @@ virNodeDevCapMdevTypeFree(virNodeDevCapMdevTypePtr type);
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC  | \
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM           | \
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES    | \
-                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV)
+                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV          | \
+                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV)
 
 char *
 virNodeDeviceGetParentName(virConnectPtr conn,
index 02ac5443762bf1f1e4889d1b4323fa1c6326b3e8..d460f26ec4abd48bfe277fb8e74f4dd2aa11c113 100644 (file)
@@ -568,7 +568,8 @@ virNodeDeviceMatch(virNodeDeviceObjPtr devobj,
               MATCH(SCSI_GENERIC)  ||
               MATCH(DRM)           ||
               MATCH(MDEV_TYPES)    ||
-              MATCH(MDEV)))
+              MATCH(MDEV)          ||
+              MATCH(CCW_DEV)))
             return false;
     }
 
index 44e2b4efda966216a802b5c3f2e82ea12a6ca7c0..f85c16bbc27dcb7279cc22543d71e524c4ee484d 100644 (file)
@@ -100,6 +100,7 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags)
  *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM
  *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES
  *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV
+ *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV
  *
  * Returns the number of node devices found or -1 and sets @devices to NULL in
  * case of error.  On success, the array stored into @devices is guaranteed to
index 1822d3dce3954d1cde21ace580e6091ab6e27955..c7ef6bfde5aa1285e33fa70658bef3661591c5fd 100644 (file)
@@ -461,7 +461,8 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
             flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV;
             break;
         case VIR_NODE_DEV_CAP_CCW_DEV:
-            /* enable next patch */
+            flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV;
+            break;
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }
index e7c513b98ad92b992b808b270c692cf7b6b9b636..aee964689578f2a2f572ecd13b2c2b6b990d8089 100644 (file)
@@ -3181,7 +3181,7 @@ I<cap> is used to filter the list by capability types, the types must be
 separated by comma, e.g. --cap pci,scsi. Valid capability types include
 'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target',
 'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev',
-'mdev_types'.
+'mdev_types', 'ccw'.
 If I<--tree> is used, the output is formatted in a tree representing parents of each
 node.  I<cap> and I<--tree> are mutually exclusive.