qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 14/18] Disable rlimit under Windows


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 14/18] Disable rlimit under Windows
Date: Mon, 6 Nov 2017 15:24:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 29/09/2017 13:13, Michael Fritscher wrote:
> Signed-off-by: Michael Fritscher <address@hidden>
> ---
>  hw/9pfs/9p.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index 53f812ec06..e0ef1a2a6b 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -3630,6 +3630,7 @@ void v9fs_reset(V9fsState *s)
>  
>  static void __attribute__((__constructor__)) v9fs_set_fd_limit(void)
>  {
> +#ifndef _WIN32
>      struct rlimit rlim;
>      if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
>          error_report("Failed to get the resource limit");
> @@ -3637,4 +3638,5 @@ static void __attribute__((__constructor__)) 
> v9fs_set_fd_limit(void)
>      }
>      open_fd_hw = rlim.rlim_cur - MIN(400, rlim.rlim_cur/3);
>      open_fd_rc = rlim.rlim_cur/2;
> +#endif
>  }
> 

There should be a function in util/oslib-* that returns the rlim_cur value.

9p obviously needs a nonzero value in open_fd_hw and open_fd_rc, so the
last two lines need to be there for Win32 as well.  Perhaps a stub
implementation that just returns a fixed number (could be 1000?) is okay
for Windows.


Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]