From nobody Sat Feb 7 08:45:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1616778982; cv=none; d=zohomail.com; s=zohoarc; b=jjlRZK3uY/jthdrFgg2Gm2jGpZ9FQUW0iBgn+ldggiywlR6B4kpmrwrJc9cekYJ50IZ3SJgawY8CXFopuzYTi4IPn+HriIdQTwITx7597gBozU2P4Fs/XVGSIZvROlxCnnHWLzWRdKVAFxWN/0DasqDhhRQ3Ykon+soXIYX8xBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616778982; h=Content-Type:Content-Transfer-Encoding:Cc: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=Sl9Hk+eWUm2pWeHrm3+Hp3QmhvpY0rlmlYMwCoGl8+k=; b=VKO605fa+Uu6pUAbMihUgbpgTLG12+3uRdGvJ5yjLDgZq+URFFkHASHaSG8ubCWEHJ6ONjSBUl2sFlHqs2BaWp2uS8VlVks1hsROBgdAM5vnmPIWH5L+zgv4Pv/rxId6RRC0kgN5YC0H3gSehQolkzCbnV6yAzrbCKyVYLGcFPY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1616778982720734.3849373806323; Fri, 26 Mar 2021 10:16:22 -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-59-XXrVKGbAOF-PVTStMKgR7w-1; Fri, 26 Mar 2021 13:16:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8AEB61853022; Fri, 26 Mar 2021 17:16:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6294C2B9FA; Fri, 26 Mar 2021 17:16:12 +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 205654A700; Fri, 26 Mar 2021 17:16:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12QHFxCR007928 for ; Fri, 26 Mar 2021 13:15:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1999F226EE; Fri, 26 Mar 2021 17:15:59 +0000 (UTC) Received: from worklaptop.home (ovpn-117-183.rdu2.redhat.com [10.10.117.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id A69F8646DC; Fri, 26 Mar 2021 17:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616778981; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=Sl9Hk+eWUm2pWeHrm3+Hp3QmhvpY0rlmlYMwCoGl8+k=; b=fpqegaN7uLLGB152W8dBpuAlCKKdiasv4s6S73W724I5iUZK/dDuVMhN0G2zlAuDNnsx5Y 1jU+cBKi4i4n8MW8VeS1xIbcg4M0ijm6w0I9ao2wSJZzScMou7yHA+OKJ9zyCq+xr4QAnE EywaRO4UD12ae10FgQ9TZMw2WPIDiWI= X-MC-Unique: XXrVKGbAOF-PVTStMKgR7w-1 From: Cole Robinson To: libvir-list@redhat.com Subject: [PATCH v2 2/2] qemu: virtiofs: support Date: Fri, 26 Mar 2021 13:15:43 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Cole Robinson 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.11 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) Content-Type: text/plain; charset="utf-8" This maps to `virtiofsd -o sandbox=3Dchroot|namespace`, which was added in qemu 5.2.0: https://git.qemu.org/?p=3Dqemu.git;a=3Dcommit;h=3D06844584b62a43384642f7243= b0fc01c9fff0fc7 Signed-off-by: Cole Robinson --- src/qemu/qemu_validate.c | 7 +++++++ src/qemu/qemu_virtiofs.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 6043f974ce..b272ab0087 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4081,6 +4081,13 @@ qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs, } } =20 + if (fs->fsdriver !=3D VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS && + fs->sandbox !=3D VIR_DOMAIN_FS_SANDBOX_MODE_DEFAULT) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("sandbox can only be used with driver=3Dvirtiofs"= )); + return -1; + } + switch ((virDomainFSDriverType) fs->fsdriver) { case VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT: case VIR_DOMAIN_FS_DRIVER_TYPE_PATH: diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c index 2e239cad66..988b757d6f 100644 --- a/src/qemu/qemu_virtiofs.c +++ b/src/qemu/qemu_virtiofs.c @@ -131,6 +131,8 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfigPtr cfg, virQEMUBuildBufferEscapeComma(&opts, fs->src->path); if (fs->cache) virBufferAsprintf(&opts, ",cache=3D%s", virDomainFSCacheModeTypeTo= String(fs->cache)); + if (fs->sandbox) + virBufferAsprintf(&opts, ",sandbox=3D%s", virDomainFSSandboxModeTy= peToString(fs->sandbox)); =20 if (fs->xattr =3D=3D VIR_TRISTATE_SWITCH_ON) virBufferAddLit(&opts, ",xattr"); --=20 2.30.2