[RFC REPOST 3/7] virCgroupSetFCAppid: properly handle when appid is NULL
Michal Prívozník
mprivozn at redhat.com
Fri Sep 10 11:49:22 UTC 2021
On 9/9/21 6:13 PM, Pavel Hrdina wrote:
> With introduction of live changes of appid we should also support
> removal of the appid from VM. This is done by writing empty appid part
> to appid_store file.
>
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
> src/util/vircgroup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
> index ad0ee20862..9470ab061d 100644
> --- a/src/util/vircgroup.c
> +++ b/src/util/vircgroup.c
> @@ -4026,7 +4026,7 @@ virCgroupSetFCAppid(virCgroup *group,
> if (inode < 0)
> return -1;
>
> - vmid = g_strdup_printf("%X:%s", inode, appid);
> + vmid = g_strdup_printf("%X:%s", inode, appid ? appid : "");
Or NULLSTR_EMPTY(appid) instead of ternary operator.
Michal
More information about the libvir-list
mailing list