From nobody Sun Feb 8 15:53:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631204627; cv=none; d=zohomail.com; s=zohoarc; b=RNnMVg/WVEOMivxBM1DMm9yFuPyod6SqCR/wpw3H1RBWDmVF5jxdJz5a9OvEAz2qPZSmHeNlRur0sSuUgnIStmkt+bjd/8Zh2JDCEhDtx1mtXx95GCtWdIpKEK/4YqdlyEp1b1zrttVW1751gFE2NGXXPOhc3eB0aKBCOnolqMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631204627; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wLbRlf3Ibe/AEwytGqzB7Y/GbcfVfla04uAm3ftsYTg=; b=NTUHLwTBxQzyDnnx8iJWMqWOq/qeBa0lW9TaKcwSutNPuthvgFQA64bUey5Mr//9vLcIh2bMfHtGxVuJSLAtiaIr9aDt4IT0FqF3tpwpYUIM7Rih5iYGkZ1RzCKSoDHmfnUNmkJoXGfeVfd3J8JivAJm3d7K4EPh7JsYmjwnG48= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631204627142561.2136656283625; Thu, 9 Sep 2021 09:23:47 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-480-hUb7kbSyOAGNrOhxiW58VA-1; Thu, 09 Sep 2021 12:23:44 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D887310919C4; Thu, 9 Sep 2021 16:22:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9DA660C04; Thu, 9 Sep 2021 16:22:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8B4F21800FE4; Thu, 9 Sep 2021 16:22:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 189GDXSs010036 for ; Thu, 9 Sep 2021 12:13:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8109E1981F; Thu, 9 Sep 2021 16:13:33 +0000 (UTC) Received: from antique-work.lan (unknown [10.40.192.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 011F84180 for ; Thu, 9 Sep 2021 16:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631204626; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wLbRlf3Ibe/AEwytGqzB7Y/GbcfVfla04uAm3ftsYTg=; b=XVVj3g3DbAudrdOjtcTOCAC0L1dnQ8BUKjQFldpLbaUqUuBiKs79XQ6/B5rRS/5f3FxlNY ZKGe5+92FLkmyfs2XE/zz2B+vnyM9273w4UIAOBQbXz47NScrUzLXCpKcrdzQS70uAtuya h+I8BjEGsj7grPI4bsEM0hVs1LpMvXI= X-MC-Unique: hUb7kbSyOAGNrOhxiW58VA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [RFC REPOST 7/7] tools: introduce virsh setappid command Date: Thu, 9 Sep 2021 18:13:23 +0200 Message-Id: <02d427f968e71f876fd16afd52637b7e9fc52dc5.1631203909.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631204628619100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- docs/manpages/virsh.rst | 14 +++++++++ tools/virsh-domain.c | 65 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 9561b3f59d..36fc94808d 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -4515,6 +4515,20 @@ Output the IP address and port number for the VNC di= splay. If the information is not available the processes will provide an exit code of 1. =20 =20 +setappid +-------- + +**Syntax:** + +:: + + setappid domain appid + +Set the Fibre Channel appid string for domain that is used to create VMID = to +tag the traffic. Accepts only printable characters and maximal length is 1= 28 +characters. To remove the appid from VM don't pass any appid. + + DEVICE COMMANDS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e5bd1fdd75..07d9c7f954 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -14070,6 +14070,65 @@ cmdDomDirtyRateCalc(vshControl *ctl, const vshCmd = *cmd) } =20 =20 +/* + * "setappid" command + */ +static const vshCmdInfo info_setappid[] =3D { + {.name =3D "help", + .data =3D N_("Set domain Fibre Channel appid") + }, + {.name =3D "desc", + .data =3D N_("Set the Fibre Channel appid string for domain that is " + "used to create VMID to tag the traffic. Accepts only " + "printable characters and maximal length is 128 characters= . " + "To remove the appid from VM don't pass any appid.") + }, + {.name =3D NULL} +}; + +static const vshCmdOptDef opts_setappid[] =3D { + VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_CONFIG, + VIRSH_COMMON_OPT_DOMAIN_LIVE, + VIRSH_COMMON_OPT_DOMAIN_CURRENT, + {.name =3D "appid", + .type =3D VSH_OT_STRING, + .help =3D N_("User provided appid string"), + }, + {.name =3D NULL} +}; + +static bool +cmdSetAppid(vshControl *ctl, const vshCmd *cmd) +{ + g_autoptr(virshDomain) dom =3D NULL; + bool config =3D vshCommandOptBool(cmd, "config"); + bool live =3D vshCommandOptBool(cmd, "live"); + bool current =3D vshCommandOptBool(cmd, "current"); + const char *appid =3D NULL; + unsigned int flags =3D VIR_DOMAIN_AFFECT_CURRENT; + + VSH_EXCLUSIVE_OPTIONS_VAR(current, live); + VSH_EXCLUSIVE_OPTIONS_VAR(current, config); + + if (config) + flags |=3D VIR_DOMAIN_AFFECT_CONFIG; + if (live) + flags |=3D VIR_DOMAIN_AFFECT_LIVE; + + if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) + return false; + + if (vshCommandOptStringReq(ctl, cmd, "appid", &appid) < 0) + return false; + + if (virDomainSetFibreChannelAppid(dom, (char *)appid, flags) < 0) + return false; + + return true; +} + + const vshCmdDef domManagementCmds[] =3D { {.name =3D "attach-device", .handler =3D cmdAttachDevice, @@ -14715,5 +14774,11 @@ const vshCmdDef domManagementCmds[] =3D { .info =3D info_domdirtyrate_calc, .flags =3D 0 }, + {.name =3D "setappid", + .handler =3D cmdSetAppid, + .opts =3D opts_setappid, + .info =3D info_setappid, + .flags =3D 0 + }, {.name =3D NULL} }; --=20 2.31.1