From nobody Tue Oct 22 22:21:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1692005887; cv=none; d=zohomail.com; s=zohoarc; b=cp6qTXoXrzG7VhrBoA3kDEBm0BYHojBHQ92FPF0Q+etl6TI1tDsN7F7c1ZN69uuy8tbVPD02Fm8lCTokP1TRbFwm9KYFkqznHypSmLAdwFh1ho/BbCTS+hsp6DtX82rCOokS51mv+kgL8HCpLAGOf1bNcwqVMWjtMcueohrHwCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692005887; 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=vZdC5e+7DXFp4TIPVN0BG12ULQhfxY9sJ40yrGzDM0k=; b=kSL9+jte83YHlIIScqFY9YdXKLDcx3uERbhDfuuFkkXa7Y87D9UMUxH7oEoK8uUVCLQIIEd7A8rHJEZE+AAQOw5SepYajlHbobT2x8y7ssmrUmbl0Dp8dkvBz9CG/J3O2WxuntueSPRhZMtD0j4OXr4XSnhz5ZzInHO1KP9/Y6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 169200588779146.16681904310212; Mon, 14 Aug 2023 02:38:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-660-FqnkPVvnOymNrg87FpTexQ-1; Mon, 14 Aug 2023 05:37:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 35FBB8087B9; Mon, 14 Aug 2023 09:37:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05EE62026FFE; Mon, 14 Aug 2023 09:37:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E17A319451DF; Mon, 14 Aug 2023 09:36:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B92731946594 for ; Mon, 14 Aug 2023 09:36:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7D69240B4CCF; Mon, 14 Aug 2023 09:36:31 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.45.226.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21A2840C207D for ; Mon, 14 Aug 2023 09:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692005886; 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=vZdC5e+7DXFp4TIPVN0BG12ULQhfxY9sJ40yrGzDM0k=; b=ioAhF3ecWicPHNm8zbADK6TL+l+TRoohlGs3Qh3gR0xlnpdeOWsW6AQXRNUQw9g/Z5kWMf wqY9Iep2hNw+Rv0AigD8NPLkW35Orbqx8TGoSp/fFaiw8sGbXKCHGGM/GZJJpHDpJ15v7M Umsa6iqyi2/PNF7O8ZTmwa19XbkLVWc= X-MC-Unique: FqnkPVvnOymNrg87FpTexQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 21/25] qemuDomainGetImageIds: pass domain definition directly Date: Mon, 14 Aug 2023 11:36:13 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692005889174100007 Content-Type: text/plain; charset="utf-8"; x-default="true" We only need the domain definition from domain object. This will allow us to use it from snapshot code where we need to pass different domain definition. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_backup.c | 2 +- src/qemu/qemu_blockjob.c | 2 +- src/qemu/qemu_domain.c | 8 ++++---- src/qemu/qemu_domain.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 3be33193f4..a94869522d 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -586,7 +586,7 @@ qemuBackupJobTerminate(virDomainObj *vm, if (!cfg) cfg =3D virQEMUDriverGetConfig(priv->driver); =20 - qemuDomainGetImageIds(cfg, vm, backupdisk->store, NULL, &uid, = &gid); + qemuDomainGetImageIds(cfg, vm->def, backupdisk->store, NULL, &= uid, &gid); =20 if (virFileRemove(backupdisk->store->path, uid, gid) < 0) VIR_WARN("failed to remove scratch file '%s'", diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 1cac17c5c0..f1d22df59f 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -932,7 +932,7 @@ qemuBlockJobDeleteImages(virQEMUDriver *driver, for (; p !=3D NULL; p =3D p->backingStore) { if (virStorageSourceGetActualType(p) =3D=3D VIR_STORAGE_TYPE_FILE)= { =20 - qemuDomainGetImageIds(cfg, vm, p, disk->src, &uid, &gid); + qemuDomainGetImageIds(cfg, vm->def, p, disk->src, &uid, &gid); =20 if (virFileRemove(p->path, uid, gid) < 0) { VIR_WARN("Unable to remove snapshot image file '%s' (%s)", diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 029238a9d7..0bb1fafdec 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7719,7 +7719,7 @@ qemuDomainCleanupRun(virQEMUDriver *driver, =20 void qemuDomainGetImageIds(virQEMUDriverConfig *cfg, - virDomainObj *vm, + virDomainDef *def, virStorageSource *src, virStorageSource *parentSrc, uid_t *uid, gid_t *gid) @@ -7740,7 +7740,7 @@ qemuDomainGetImageIds(virQEMUDriverConfig *cfg, *gid =3D cfg->group; } =20 - if (vm && (vmlabel =3D virDomainDefGetSecurityLabelDef(vm->def, "dac")= ) && + if ((vmlabel =3D virDomainDefGetSecurityLabelDef(def, "dac")) && vmlabel->label) virParseOwnershipIds(vmlabel->label, uid, gid); =20 @@ -7765,7 +7765,7 @@ qemuDomainStorageFileInit(virQEMUDriver *driver, uid_t uid; gid_t gid; =20 - qemuDomainGetImageIds(cfg, vm, src, parent, &uid, &gid); + qemuDomainGetImageIds(cfg, vm->def, src, parent, &uid, &gid); =20 if (virStorageSourceInitAs(src, uid, gid) < 0) return -1; @@ -7958,7 +7958,7 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver, return 0; } =20 - qemuDomainGetImageIds(cfg, vm, src, disksrc, &uid, &gid); + qemuDomainGetImageIds(cfg, vm->def, src, disksrc, &uid, &gid); =20 if (virStorageSourceGetMetadata(src, uid, gid, QEMU_DOMAIN_STORAGE_SOURCE_CHAIN_MAX_D= EPTH, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 999190e381..7ac1cdd6be 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -738,7 +738,7 @@ bool qemuDomainDiskChangeSupported(virDomainDiskDef *di= sk, virDomainDiskDef *orig_disk); =20 void qemuDomainGetImageIds(virQEMUDriverConfig *cfg, - virDomainObj *vm, + virDomainDef *def, virStorageSource *src, virStorageSource *parentSrc, uid_t *uid, --=20 2.41.0