From nobody Mon Feb 9 01:34:33 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=1635778084; cv=none; d=zohomail.com; s=zohoarc; b=iqNcXFZ4+nj9OOOx/EkjZP253v3sbiVd4oHg9VU9ARK/9o6dBXM5VP2RHZfVmq4kSFyC+iJEyjxpkscIWPfRdxPwpHiA5pf8fuYmMbQel74Hv5swFrC6Wswl8UYHhAhMW6ij15ES1wLksTm6VNr79mjVBt8AG/tf1R9tzA4n2/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635778084; 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=Ek3MYRHZI/GeI9GCPG5vEgZRmlRYRCaZZWT8q0WHnvE=; b=TQG6rlTQW+Qvyv19+LpkVBABFALS5WWmIPgBcjRX4lXslqP6010myk+ES27JTjN4tJupcSQdgNNTSxIs8YCGQ+p9Z7Cmn0M8Op2RGbKPbVwtj37rj9S9VtOnMX8L0q+mtatXLNX2CsCYS0LVpUGIKkZpwD8j5wA2EhcWUeHc750= 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) 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 1635778084650392.1789190487367; Mon, 1 Nov 2021 07:48:04 -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-389-KFW0cx1HPYOSRjXeXEzFnA-1; Mon, 01 Nov 2021 10:48:02 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F9101006AA2; Mon, 1 Nov 2021 14:47:57 +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 310FA60C17; Mon, 1 Nov 2021 14:47:57 +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 005024EA37; Mon, 1 Nov 2021 14:47:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A1ElpMY026259 for ; Mon, 1 Nov 2021 10:47:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id F1C6A60C17; Mon, 1 Nov 2021 14:47:51 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C66060C0F for ; Mon, 1 Nov 2021 14:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635778083; 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=Ek3MYRHZI/GeI9GCPG5vEgZRmlRYRCaZZWT8q0WHnvE=; b=bOI2C1B8dZtg6J0ElQ1pj7errQRhTg0OPaNAy/J8wuUbBx8BArIP8E6WmGfOMI58nccCIQ DyB/V5D5RwzN8cYRFO41Jov5BVoVDszTK/zLyF4UsrZJkDIFnQvISflh7rDsLVterds2jA I6z+CWa4mHRBfmT5HRAphcjBYk3y/bc= X-MC-Unique: KFW0cx1HPYOSRjXeXEzFnA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/4] virDomainBackupDefFormat: Propagate private data callbacks Date: Mon, 1 Nov 2021 15:47:45 +0100 Message-Id: <644712d647d8ccaf6f2777e6f3077d6ed8491b18.1635777907.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.12 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) X-ZM-MESSAGEID: 1635778085389100001 Content-Type: text/plain; charset="utf-8" The formatter for the backup job data didn't pass the virDomainXMLOption struct to the disk formatter which meant that the private data of the disk source were not formatted. This didn't pose a problem for now as the blockjob list remembered the nodenames for the jobs, but the backup source lost them. Signed-off-by: Peter Krempa --- src/conf/backup_conf.c | 10 ++++++---- src/conf/backup_conf.h | 3 ++- src/qemu/qemu_backup.c | 4 +++- src/qemu/qemu_domain.c | 2 +- tests/genericxml2xmltest.c | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index 694553a544..2a7fa95e0c 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -318,7 +318,8 @@ static int virDomainBackupDiskDefFormat(virBuffer *buf, virDomainBackupDiskDef *disk, bool push, - bool internal) + bool internal, + virDomainXMLOption *xmlopt) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); @@ -358,7 +359,7 @@ virDomainBackupDiskDefFormat(virBuffer *buf, if (virDomainDiskSourceFormat(&childBuf, disk->store, sourcename, 0, false, storageSourceFormatFlags, - false, false, NULL) < 0) + false, false, xmlopt) < 0) return -1; } @@ -390,7 +391,8 @@ virDomainBackupDefFormatPrivate(virBuffer *buf, int virDomainBackupDefFormat(virBuffer *buf, virDomainBackupDef *def, - bool internal) + bool internal, + virDomainXMLOption *xmlopt) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); @@ -418,7 +420,7 @@ virDomainBackupDefFormat(virBuffer *buf, for (i =3D 0; i < def->ndisks; i++) { if (virDomainBackupDiskDefFormat(&disksChildBuf, &def->disks[i], def->type =3D=3D VIR_DOMAIN_BACKU= P_TYPE_PUSH, - internal) < 0) + internal, xmlopt) < 0) return -1; } diff --git a/src/conf/backup_conf.h b/src/conf/backup_conf.h index b682da1c95..dc66b75892 100644 --- a/src/conf/backup_conf.h +++ b/src/conf/backup_conf.h @@ -123,7 +123,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainBackupDef, virDo= mainBackupDefFree); int virDomainBackupDefFormat(virBuffer *buf, virDomainBackupDef *def, - bool internal); + bool internal, + virDomainXMLOption *xmlopt); int virDomainBackupAlignDisks(virDomainBackupDef *backup, virDomainDef *dom, diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index abbfcf3682..9fa8d2f02e 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -954,6 +954,8 @@ char * qemuBackupGetXMLDesc(virDomainObj *vm, unsigned int flags) { + qemuDomainObjPrivate *priv =3D vm->privateData; + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; virDomainBackupDef *backup; @@ -962,7 +964,7 @@ qemuBackupGetXMLDesc(virDomainObj *vm, if (!(backup =3D qemuDomainGetBackup(vm))) return NULL; - if (virDomainBackupDefFormat(&buf, backup, false) < 0) + if (virDomainBackupDefFormat(&buf, backup, false, priv->driver->xmlopt= ) < 0) return NULL; return virBufferContentAndReset(&buf); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 209337404a..fb203bc830 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2152,7 +2152,7 @@ qemuDomainObjPrivateXMLFormatBackups(virBuffer *buf, g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (priv->backup && - virDomainBackupDefFormat(&childBuf, priv->backup, true) < 0) + virDomainBackupDefFormat(&childBuf, priv->backup, true, priv->driv= er->xmlopt) < 0) return -1; virXMLFormatElement(buf, "backups", &attrBuf, &childBuf); diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index a6f974e758..34ccaff615 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -114,7 +114,7 @@ testCompareBackupXML(const void *opaque) return -1; } - if (virDomainBackupDefFormat(&buf, backup, data->internal) < 0) { + if (virDomainBackupDefFormat(&buf, backup, data->internal, NULL) < 0) { VIR_TEST_VERBOSE("failed to format backup def '%s'", file_in); return -1; } --=20 2.31.1