[libvirt PATCH v4 5/5] qemu: implement support for Fibre Channel VMID

Martin Kletzander mkletzan at redhat.com
Tue Aug 17 11:21:55 UTC 2021


On Tue, Aug 17, 2021 at 12:38:10PM +0200, Pavel Hrdina wrote:
>Based on kernel commit messages the interface is
>
>    /sys/class/fc/fc_udev_device/appid_store
>
>where we need to write the following string "$INODE:$APPID".
>
>$INODE is the VM root cgroup inode in hexadecimal and $APPID is user
>provided string that will be attached to each FC frame for the VM
>within the cgroup identified by inode and has limit 128 bytes.
>
>Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
>Reviewed-by: Martin Kletzander <mkletzan at redhat.com>
>---
> src/qemu/qemu_cgroup.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
>diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
>index f2d99abcfa..2269a8655f 100644
>--- a/src/qemu/qemu_cgroup.c
>+++ b/src/qemu/qemu_cgroup.c
>@@ -904,6 +904,33 @@ qemuSetupCpuCgroup(virDomainObj *vm)
> }
>
>
>+static int
>+qemuSetupCgroupAppid(virDomainObj *vm)
>+{
>+    qemuDomainObjPrivate *priv = vm->privateData;
>+    int inode = virCgroupGetInode(priv->cgroup);

If this fails, ...

>+    const char *path = "/sys/class/fc/fc_udev_device/appid_store";
>+    g_autofree char *appid = NULL;
>+    virDomainResourceDef *resource = vm->def->resource;
>+
>+    if (!resource || !resource->appid)
>+        return 0;

..., but you return 0 here, then you still have an error in the logs.

If you initialize it to -1 and only get the inode ID here, then

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210817/fb82348d/attachment-0001.sig>


More information about the libvir-list mailing list