From nobody Sun Feb 8 17:46:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1585671912; cv=none; d=zohomail.com; s=zohoarc; b=FygBK0/IctUG+u0Q6gZJBjj+UPUBPQLa4PmjvaQ8Mwy4ByKyATfcvDlcSk5qmiZayFz2Qt/EE6fHYDrKk8Ej2nthL7rGWgnjhCYvkANOYPCBu5NFAbR9HDrvOPkSw6oPAka23i9J0AePeaN/NHvyDk/SHUwnmzPUSyReSh6yCi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585671912; h=Content-Type:Content-Transfer-Encoding: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=RYaK4ppQiyuAp04lQjoktxD7ySJl5irFKhLKw+QIiZk=; b=YsRIWYu2G5PPi9t6opQmmpG3iNlJ3o1XXy7jfNv/vhY+MpUpg0v2o4oZBd97oedmSxRjqCe/H0sLwzSjEgz+F8VGqIYmebHtcLnup3ubF/DofeGjWo5VnUzGmrksgffvUS51HeX9L1h/ggnBojkQFSEQWG7CVNZU/gXqp573mYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 158567191222156.90216326320581; Tue, 31 Mar 2020 09:25:12 -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-485-LJFA2M4JMmqo4gUnWMJVww-1; Tue, 31 Mar 2020 12:25:09 -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 16284107ACC9; Tue, 31 Mar 2020 16:25:03 +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 CC4E9DA0E2; Tue, 31 Mar 2020 16:25:02 +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 5772A86BE5; Tue, 31 Mar 2020 16:25:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02VGOgwi023097 for ; Tue, 31 Mar 2020 12:24:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id D70795D9E2; Tue, 31 Mar 2020 16:24:42 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 543D75D9C5 for ; Tue, 31 Mar 2020 16:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585671911; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=RYaK4ppQiyuAp04lQjoktxD7ySJl5irFKhLKw+QIiZk=; b=Hz4fPwVnn0RTnbNMTyvhAp4qTwQz0DEwz4mAA5lE+HljMOyFCCxohCMOjN4t+UzhCGzOjg a77EasmFWGhNyzkFbF72qajOnzxtW9UJyLCWIKXF+Z/uBjX8L1ngpG/KzzxfjGksC17Bdg ze8iYGJ+2CJFluurTDXWynbZlYe5sB0= X-MC-Unique: LJFA2M4JMmqo4gUnWMJVww-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 07/10] Revert "qemu_conf: Track embed root dir" Date: Tue, 31 Mar 2020 18:24:19 +0200 Message-Id: <7f79e05709bf0066bca6ac5f9bcb042d4da732c6.1585671623.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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 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 reverts commit 06a19921b6a522cd7b4d352c9320909752947de3. What I haven't realized when writing this ^^ commit is that the virQEMUDriver structure already stores the root directory path. And since the pointer is immutable it can be accessed right from the structure and thus there is no need to duplicate it in the driver config. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani Reviewed-by: Daniel Henrique Barboza Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_conf.c | 2 -- src/qemu/qemu_conf.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 5339c5fc04..da2abb6188 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -115,7 +115,6 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged, =20 if (root) { cfg->uri =3D g_strdup_printf("qemu:///embed?root=3D%s", root); - cfg->root =3D g_strdup(root); } else { cfg->uri =3D g_strdup(privileged ? "qemu:///system" : "qemu:///ses= sion"); } @@ -302,7 +301,6 @@ static void virQEMUDriverConfigDispose(void *obj) =20 virStringListFree(cfg->cgroupDeviceACL); VIR_FREE(cfg->uri); - VIR_FREE(cfg->root); =20 VIR_FREE(cfg->configBaseDir); VIR_FREE(cfg->configDir); diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 89332eeb73..8a0d220ce7 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -76,8 +76,6 @@ struct _virQEMUDriverConfig { virObject parent; =20 char *uri; - char *root; /* The root directory for embed driver, - NULL for system/session connections */ =20 uid_t user; gid_t group; --=20 2.24.1