Re: [RFC REPOST 3/7] virCgroupSetFCAppid: properly handle when appid is NULL

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

 



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@xxxxxxxxxx>
> ---
>  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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux