From nobody Tue Dec 19 10:27:02 2023 X-Original-To: freebsd-xen@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvXth6fmXz5516H for ; Tue, 19 Dec 2023 10:27:08 +0000 (UTC) (envelope-from roger.pau@cloud.com) Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvXtf5N2Rz4ZcG for ; Tue, 19 Dec 2023 10:27:06 +0000 (UTC) (envelope-from roger.pau@cloud.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40d12ade25dso29709595e9.2 for ; Tue, 19 Dec 2023 02:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1702981624; x=1703586424; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PFfTU7QvKyA3tqLlhcoSW51Z002f3ff7icLdLujRqpA=; b=lxYwhbx4ZzxDMmdi3pV13ZwzM/ud5l85M+nH8FTSR4DEc4qAd1IL12Oq7AK6Vs/q8Q NCTnzvNUb44vUEooJYBF6mNveWXMgExKwJBi/YvgwidheZn6WBZUWhtFC3peVeTRxVss c0MUQQZnZaNnvyR0KFt1GJyi5QFWmTc1NnuEM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702981624; x=1703586424; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PFfTU7QvKyA3tqLlhcoSW51Z002f3ff7icLdLujRqpA=; b=QSqQNS6KvkdcWW6o0HluwuXueQKyoMlLFZgBwpXkvmRe5+Fip3/km+lnvJxfqA0umc WLq29wHsSLW/+Iw2oiqthfBa7dsjbE3JDPCM6ssRCVDxGmdWqkvmUSbdxbeKLEIIwOoZ YIC25832qc8TDGfrjnvz+3Zpd3lqRixUtfwJ1POInldWAPbTu0gXnl5uEtqCkwRJvX9n zjKGmp9FrpvrJzgiWuAi1tXbUWBGMnCCiq1fq8r2WoofiwoQbtOd+TmxoD8mYJsc8zqu f84EB9tPJBIbQSPkCcgP0n8E6I1uocWB6PN0oxMEvFEYjv3hotsDe/q7YRVyJAiyaUUY 6eug== X-Gm-Message-State: AOJu0YxGlNduHSVxvBE2Wseey7+rhhsyJ3tfd+Plx2yPyjzGMwPNu639 wO8nPlbU5vEbYNUGXT9svz8ivw== X-Google-Smtp-Source: AGHT+IFtv/xeYBL/j8bYKtYn8MTW+af+VGse1mA1Lk78RNuK5V08U1U/9ZAUydUxx+t2t+G+BtR59g== X-Received: by 2002:a05:600c:c3:b0:40c:32e9:ef15 with SMTP id u3-20020a05600c00c300b0040c32e9ef15mr10029160wmm.106.1702981624247; Tue, 19 Dec 2023 02:27:04 -0800 (PST) Received: from localhost ([213.195.127.70]) by smtp.gmail.com with ESMTPSA id v4-20020a05600c470400b0040b37f107c4sm2166862wmo.16.2023.12.19.02.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 02:27:03 -0800 (PST) Date: Tue, 19 Dec 2023 11:27:02 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Zhenlei Huang Cc: ASOU Masato , freebsd-xen@freebsd.org Subject: Re: getting domain info list: Cannot allocate memory Message-ID: References: List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-xen List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-xen@freebsd.org X-BeenThere: freebsd-xen@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SvXtf5N2Rz4ZcG On Tue, Dec 19, 2023 at 09:48:32AM +0800, Zhenlei Huang wrote: > > > > On Dec 19, 2023, at 9:15 AM, ASOU Masato wrote: > > > > I was solved this problem by my self. > > > > asou@intel-fbsd:~ $ sudo xl list > > Password: > > libxl: error: libxl_domain.c:335:libxl_list_domain: getting domain > > info list: Cannot allocate memory > > libxl_list_domain failed. > > asou@intel-fbsd:~ $ su > > Password: > > root@intel-fbsd:/home/asou # xl list > > Name ID Mem VCPUs State Time(s) > > Domain-0 0 4095 4 r----- 14.8 > > root@intel-fbsd:/home/asou # > > > > If I was used sudo command, I got `Cannot allocate memory'. However, I used > > su command and execute xl list command, then I got correct result. > > That is an interesting bug / feature ;) This is the result of user limits, see: $ sudo limits -l Resource limits (current): memorylocked 64 kB vs # limits -l Resource limits (current): memorylocked infinity kB Seems like user limits are inherited into root context when using sudo. You might want to edit /etc/login.conf and set memorylocked to a more suitable value (unlimited?) for the user you plan to execute xl from. You might also need to modify the vm.max_user_wired sysctl to set it to -1 in order to allow unlimited wired memory for users. Note this is likely only safe for systems where the (non-root) user you plan to run xl from is fully trusted, and doesn't run any other tasks. Regards, Roger.