From nobody Mon Feb 9 07:39:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1636986174; cv=none; d=zohomail.com; s=zohoarc; b=dz4TuBpHoAzZw3kG0O11DB3WSZXtZcbAYFaVt9PEVNY5tkFi9iJ+ciCAtzt0UH29rLzq6YGyyfVb3X2WWwLDJl6vkJPlOZL+KtOC0djrhkgw9JAQvU21jkzMyK/x62eCi07sZFl8ZKYNGdfeOByrIf6BNOxkgYGS1Owq0a8sVjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636986174; 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=y1ABHfgdUFxxrQO6EAt5v5bZeeMB5duo990IQyV+4tU=; b=FxoRwiq1Cko/iHWbm0jH2lCv1N34Rzmb5zDSWORWbTnntmfqGRSyXv0JUKRUNgTCIPmmOd3hHjvy9fwov/glhYbZZNtcrpJzNhjt3T9H7yTg9bNBAqATtIEoj9hiiA5PhkZb99kaIgtW/JDSzqxxhdraFu+7YjdVfoyXPGZJbKc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1636986174203401.1781921050274; Mon, 15 Nov 2021 06:22:54 -0800 (PST) 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-584-j0xtKy7APgWWBjeFBgTgew-1; Mon, 15 Nov 2021 09:22:50 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E95F425C9; Mon, 15 Nov 2021 14:22:45 +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 02D7C5D9CA; Mon, 15 Nov 2021 14:22:45 +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 B4C6F4EA37; Mon, 15 Nov 2021 14:22:44 +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 1AFEMNec009696 for ; Mon, 15 Nov 2021 09:22:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id C522C2AF6D; Mon, 15 Nov 2021 14:22:23 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2554722719 for ; Mon, 15 Nov 2021 14:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636986173; 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=y1ABHfgdUFxxrQO6EAt5v5bZeeMB5duo990IQyV+4tU=; b=GzDsMBYqEXu/fQjFyxpvQ/VKxf+v40YHIckIc3tyM2hrzgBYcYYdvjxI7vavXQLK/ZMFuf ysDZULqcQT4jD9111qhFdXLLafDorUBdY/NaEhNEAZdp36JuTWUxp0soolalUqJ6e78nev zRTqueomLEFDUq9dnYyBoCmBbi+gVik= X-MC-Unique: j0xtKy7APgWWBjeFBgTgew-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/18] qemu: block: Replace virJSONValueObjectCreate by virJSONValueObjectAdd Date: Mon, 15 Nov 2021 15:22:03 +0100 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 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.14 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: 1636986258618100007 Content-Type: text/plain; charset="utf-8" virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 342 +++++++++++++++++++++--------------------- 1 file changed, 171 insertions(+), 171 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a1adef0c5d..53a0b919f9 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -459,11 +459,11 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStora= geNetHostDef *host, port =3D g_strdup_printf("%u", host->port); - if (virJSONValueObjectCreate(&server, - "s:type", transport, - "s:host", host->name, - "s:port", port, - NULL) < 0) + if (virJSONValueObjectAdd(&server, + "s:type", transport, + "s:host", host->name, + "s:port", port, + NULL) < 0) return NULL; break; @@ -473,10 +473,10 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStora= geNetHostDef *host, else field =3D "s:path"; - if (virJSONValueObjectCreate(&server, - "s:type", "unix", - field, host->socket, - NULL) < 0) + if (virJSONValueObjectAdd(&server, + "s:type", "unix", + field, host->socket, + NULL) < 0) return NULL; break; @@ -548,10 +548,10 @@ qemuBlockStorageSourceBuildJSONInetSocketAddress(virS= torageNetHostDef *host) port =3D g_strdup_printf("%u", host->port); - ignore_value(virJSONValueObjectCreate(&ret, - "s:host", host->name, - "s:port", port, - NULL)); + ignore_value(virJSONValueObjectAdd(&ret, + "s:host", host->name, + "s:port", port, + NULL)); return ret; } @@ -571,10 +571,10 @@ qemuBlockStorageSourceBuildJSONNFSServer(virStorageNe= tHostDef *host) { virJSONValue *ret =3D NULL; - ignore_value(virJSONValueObjectCreate(&ret, - "s:host", host->name, - "s:type", "inet", - NULL)); + ignore_value(virJSONValueObjectAdd(&ret, + "s:host", host->name, + "s:type", "inet", + NULL)); return ret; } @@ -628,10 +628,10 @@ qemuBlockStorageSourceGetGlusterProps(virStorageSourc= e *src, * server :[{type:"tcp", host:"1.2.3.4", port:24007}, * {type:"unix", socket:"/tmp/glusterd.socket"}, ...]} */ - if (virJSONValueObjectCreate(&props, - "s:volume", src->volume, - "s:path", src->path, - "a:server", &servers, NULL) < 0) + if (virJSONValueObjectAdd(&props, + "s:volume", src->volume, + "s:path", src->path, + "a:server", &servers, NULL) < 0) return NULL; if (!onlytarget && @@ -669,10 +669,10 @@ qemuBlockStorageSourceGetVxHSProps(virStorageSource *= src, * vdisk-id:"eb90327c-8302-4725-4e85ed4dc251", * server:{type:"tcp", host:"1.2.3.4", port:9999}} */ - ignore_value(virJSONValueObjectCreate(&ret, - "S:tls-creds", tlsAlias, - "s:vdisk-id", src->path, - "a:server", &server, NULL)); + ignore_value(virJSONValueObjectAdd(&ret, + "S:tls-creds", tlsAlias, + "s:vdisk-id", src->path, + "a:server", &server, NULL)); return ret; } @@ -694,9 +694,9 @@ qemuBlockStorageSourceGetNFSProps(virStorageSource *src) * path: "/foo/bar/baz", * server: {type:"tcp", host:"1.2.3.4"}} */ - if (virJSONValueObjectCreate(&ret, - "a:server", &server, - "S:path", src->path, NULL) < 0) + if (virJSONValueObjectAdd(&ret, + "a:server", &server, + "S:path", src->path, NULL) < 0) return NULL; if (src->nfs_uid !=3D -1 && @@ -757,16 +757,16 @@ qemuBlockStorageSourceGetCURLProps(virStorageSource *= src, cookiestr =3D qemuBlockStorageSourceGetCookieString(src); } - ignore_value(virJSONValueObjectCreate(&ret, - "s:url", uristr, - "S:username", username, - "S:password-secret", passwordali= as, - "T:sslverify", src->sslverify, - "S:cookie", cookiestr, - "S:cookie-secret", cookiealias, - "P:timeout", src->timeout, - "P:readahead", src->readahead, - NULL)); + ignore_value(virJSONValueObjectAdd(&ret, + "s:url", uristr, + "S:username", username, + "S:password-secret", passwordalias, + "T:sslverify", src->sslverify, + "S:cookie", cookiestr, + "S:cookie-secret", cookiealias, + "P:timeout", src->timeout, + "P:readahead", src->readahead, + NULL)); return ret; } @@ -822,15 +822,15 @@ qemuBlockStorageSourceGetISCSIProps(virStorageSource = *src, objalias =3D srcPriv->secinfo->alias; } - ignore_value(virJSONValueObjectCreate(&ret, - "s:portal", portal, - "s:target", target, - "u:lun", lun, - "s:transport", "tcp", - "S:user", username, - "S:password-secret", objalias, - "S:initiator-name", src->initiat= or.iqn, - NULL)); + ignore_value(virJSONValueObjectAdd(&ret, + "s:portal", portal, + "s:target", target, + "u:lun", lun, + "s:transport", "tcp", + "S:user", username, + "S:password-secret", objalias, + "S:initiator-name", src->initiator.= iqn, + NULL)); return ret; } @@ -857,11 +857,11 @@ qemuBlockStorageSourceGetNBDProps(virStorageSource *s= rc, if (onlytarget) tlsAlias =3D NULL; - if (virJSONValueObjectCreate(&ret, - "a:server", &serverprops, - "S:export", src->path, - "S:tls-creds", tlsAlias, - NULL) < 0) + if (virJSONValueObjectAdd(&ret, + "a:server", &serverprops, + "S:export", src->path, + "S:tls-creds", tlsAlias, + NULL) < 0) return NULL; return ret; @@ -925,24 +925,24 @@ qemuBlockStorageSourceGetRBDProps(virStorageSource *s= rc, return NULL; } - if (virJSONValueObjectCreate(&encrypt, - "s:format", encformat, - "s:key-secret", srcPriv->encinfo->ali= as, - NULL) < 0) + if (virJSONValueObjectAdd(&encrypt, + "s:format", encformat, + "s:key-secret", srcPriv->encinfo->alias, + NULL) < 0) return NULL; } - if (virJSONValueObjectCreate(&ret, - "s:pool", src->volume, - "s:image", src->path, - "S:snapshot", src->snapshot, - "S:conf", src->configFile, - "A:server", &servers, - "A:encrypt", &encrypt, - "S:user", username, - "A:auth-client-required", &authmodes, - "S:key-secret", keysecret, - NULL) < 0) + if (virJSONValueObjectAdd(&ret, + "s:pool", src->volume, + "s:image", src->path, + "S:snapshot", src->snapshot, + "S:conf", src->configFile, + "A:server", &servers, + "A:encrypt", &encrypt, + "S:user", username, + "A:auth-client-required", &authmodes, + "S:key-secret", keysecret, + NULL) < 0) return NULL; return ret; @@ -967,10 +967,10 @@ qemuBlockStorageSourceGetSheepdogProps(virStorageSour= ce *src) return NULL; /* libvirt does not support the 'snap-id' and 'tag' properties */ - if (virJSONValueObjectCreate(&ret, - "a:server", &serverprops, - "s:vdi", src->path, - NULL) < 0) + if (virJSONValueObjectAdd(&ret, + "a:server", &serverprops, + "s:vdi", src->path, + NULL) < 0) return NULL; return ret; @@ -1001,17 +1001,17 @@ qemuBlockStorageSourceGetSshProps(virStorageSource = *src) username =3D src->ssh_user; if (src->ssh_host_key_check_disabled && - virJSONValueObjectCreate(&host_key_check, - "s:mode", "none", - NULL) < 0) + virJSONValueObjectAdd(&host_key_check, + "s:mode", "none", + NULL) < 0) return NULL; - if (virJSONValueObjectCreate(&ret, - "s:path", src->path, - "a:server", &serverprops, - "S:user", username, - "A:host-key-check", &host_key_check, - NULL) < 0) + if (virJSONValueObjectAdd(&ret, + "s:path", src->path, + "a:server", &serverprops, + "S:user", username, + "A:host-key-check", &host_key_check, + NULL) < 0) return NULL; return ret; @@ -1034,11 +1034,11 @@ qemuBlockStorageSourceGetFileProps(virStorageSource= *src, iomode =3D virDomainDiskIoTypeToString(src->iomode); } - ignore_value(virJSONValueObjectCreate(&ret, - "s:filename", src->path, - "S:aio", iomode, - "S:pr-manager", prManagerAlias, - NULL) < 0); + ignore_value(virJSONValueObjectAdd(&ret, + "s:filename", src->path, + "S:aio", iomode, + "S:pr-manager", prManagerAlias, + NULL) < 0); return ret; } @@ -1053,10 +1053,10 @@ qemuBlockStorageSourceGetVvfatProps(virStorageSourc= e *src, * '*fat-type': 'int' * '*label': 'str' */ - if (virJSONValueObjectCreate(&ret, - "s:driver", "vvfat", - "s:dir", src->path, - "b:floppy", src->floppyimg, NULL) < 0) + if (virJSONValueObjectAdd(&ret, + "s:driver", "vvfat", + "s:dir", src->path, + "b:floppy", src->floppyimg, NULL) < 0) return NULL; if (!onlytarget && @@ -1077,11 +1077,11 @@ qemuBlockStorageSourceGetNVMeProps(virStorageSource= *src) if (!(pciAddr =3D virPCIDeviceAddressAsString(&nvme->pciAddr))) return NULL; - ignore_value(virJSONValueObjectCreate(&ret, - "s:driver", "nvme", - "s:device", pciAddr, - "U:namespace", nvme->namespc, - NULL)); + ignore_value(virJSONValueObjectAdd(&ret, + "s:driver", "nvme", + "s:device", pciAddr, + "U:namespace", nvme->namespc, + NULL)); return ret; } @@ -1100,10 +1100,10 @@ qemuBlockStorageSourceGetBlockdevGetCacheProps(virS= torageSource *src, if (qemuDomainDiskCachemodeFlags(src->cachemode, NULL, &direct, &noflu= sh) < 0) return -1; - if (virJSONValueObjectCreate(&cacheobj, - "b:direct", direct, - "b:no-flush", noflush, - NULL) < 0) + if (virJSONValueObjectAdd(&cacheobj, + "b:direct", direct, + "b:no-flush", noflush, + NULL) < 0) return -1; if (virJSONValueObjectAppend(props, "cache", &cacheobj) < 0) @@ -1375,10 +1375,10 @@ qemuBlockStorageSourceGetCryptoProps(virStorageSour= ce *src, return -1; } - return virJSONValueObjectCreate(encprops, - "s:format", encformat, - "s:key-secret", srcpriv->encinfo->alia= s, - NULL); + return virJSONValueObjectAdd(encprops, + "s:format", encformat, + "s:key-secret", srcpriv->encinfo->alias, + NULL); } @@ -1458,12 +1458,12 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(= virStorageSource *src) * '*force-share': 'bool' */ - if (virJSONValueObjectCreate(&props, - "s:node-name", src->nodeformat, - "b:read-only", src->readonly, - "S:discard", discard, - "S:detect-zeroes", detectZeroes, - NULL) < 0) + if (virJSONValueObjectAdd(&props, + "s:node-name", src->nodeformat, + "b:read-only", src->readonly, + "S:discard", discard, + "S:detect-zeroes", detectZeroes, + NULL) < 0) return NULL; if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, props) < 0) @@ -1612,15 +1612,15 @@ qemuBlockStorageSourceGetBlockdevStorageSliceProps(= virStorageSource *src) if (qemuBlockNodeNameValidate(src->sliceStorage->nodename) < 0) return NULL; - if (virJSONValueObjectCreate(&props, - "s:driver", "raw", - "s:node-name", src->sliceStorage->nodenam= e, - "U:offset", src->sliceStorage->offset, - "U:size", src->sliceStorage->size, - "s:file", src->nodestorage, - "b:auto-read-only", true, - "s:discard", "unmap", - NULL) < 0) + if (virJSONValueObjectAdd(&props, + "s:driver", "raw", + "s:node-name", src->sliceStorage->nodename, + "U:offset", src->sliceStorage->offset, + "U:size", src->sliceStorage->size, + "s:file", src->nodestorage, + "b:auto-read-only", true, + "s:discard", "unmap", + NULL) < 0) return NULL; if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, props) < 0) @@ -2186,12 +2186,12 @@ qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef= *disk) qemuDomainDiskPrivate *priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); virJSONValue *ret =3D NULL; - ignore_value(virJSONValueObjectCreate(&ret, - "s:driver", "copy-on-read", - "s:node-name", priv->nodeCopyOnR= ead, - "s:file", disk->src->nodeformat, - "s:discard", "unmap", - NULL)); + ignore_value(virJSONValueObjectAdd(&ret, + "s:driver", "copy-on-read", + "s:node-name", priv->nodeCopyOnRead, + "s:file", disk->src->nodeformat, + "s:discard", "unmap", + NULL)); return ret; } @@ -2270,12 +2270,12 @@ qemuBlockGetBackingStoreString(virStorageSource *sr= c, props =3D backingProps; if (src->sliceStorage) { - if (virJSONValueObjectCreate(&sliceProps, - "s:driver", "raw", - "U:offset", src->sliceStorage->offset, - "U:size", src->sliceStorage->size, - "a:file", &backingProps, - NULL) < 0) + if (virJSONValueObjectAdd(&sliceProps, + "s:driver", "raw", + "U:offset", src->sliceStorage->offset, + "U:size", src->sliceStorage->size, + "a:file", &backingProps, + NULL) < 0) return NULL; props =3D sliceProps; @@ -2329,11 +2329,11 @@ qemuBlockStorageSourceCreateGetFormatPropsGeneric(v= irStorageSource *src, { g_autoptr(virJSONValue) props =3D NULL; - if (virJSONValueObjectCreate(&props, - "s:driver", driver, - "s:file", src->nodestorage, - "U:size", src->capacity, - NULL) < 0) + if (virJSONValueObjectAdd(&props, + "s:driver", driver, + "s:file", src->nodestorage, + "U:size", src->capacity, + NULL) < 0) return -1; if (backing && @@ -2358,9 +2358,9 @@ qemuBlockStorageSourceCreateGetEncryptionLUKS(virStor= ageSource *src, srcpriv->encinfo) keysecret =3D srcpriv->encinfo->alias; - if (virJSONValueObjectCreate(&props, - "s:key-secret", keysecret, - NULL) < 0) + if (virJSONValueObjectAdd(&props, + "s:key-secret", keysecret, + NULL) < 0) return -1; if (src->encryption) { @@ -2447,13 +2447,13 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow2(vir= StorageSource *src, else if (STREQ_NULLABLE(src->compat, "1.1")) qcow2version =3D "v3"; - if (virJSONValueObjectCreate(&qcow2props, - "s:driver", "qcow2", - "s:file", src->nodestorage, - "U:size", src->capacity, - "S:version", qcow2version, - "P:cluster-size", src->clusterSize, - NULL) < 0) + if (virJSONValueObjectAdd(&qcow2props, + "s:driver", "qcow2", + "s:file", src->nodestorage, + "U:size", src->capacity, + "S:version", qcow2version, + "P:cluster-size", src->clusterSize, + NULL) < 0) return -1; if (qemuBlockStorageSourceCreateAddBacking(backing, qcow2props, true) = < 0 || @@ -2472,11 +2472,11 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow(virS= torageSource *src, { g_autoptr(virJSONValue) qcowprops =3D NULL; - if (virJSONValueObjectCreate(&qcowprops, - "s:driver", "qcow", - "s:file", src->nodestorage, - "U:size", src->capacity, - NULL) < 0) + if (virJSONValueObjectAdd(&qcowprops, + "s:driver", "qcow", + "s:file", src->nodestorage, + "U:size", src->capacity, + NULL) < 0) return -1; if (qemuBlockStorageSourceCreateAddBacking(backing, qcowprops, false) = < 0 || @@ -2495,11 +2495,11 @@ qemuBlockStorageSourceCreateGetFormatPropsQed(virSt= orageSource *src, { g_autoptr(virJSONValue) qedprops =3D NULL; - if (virJSONValueObjectCreate(&qedprops, - "s:driver", "qed", - "s:file", src->nodestorage, - "U:size", src->capacity, - NULL) < 0) + if (virJSONValueObjectAdd(&qedprops, + "s:driver", "qed", + "s:file", src->nodestorage, + "U:size", src->capacity, + NULL) < 0) return -1; if (qemuBlockStorageSourceCreateAddBacking(backing, qedprops, true) < = 0) @@ -2675,12 +2675,12 @@ qemuBlockStorageSourceCreateGetStorageProps(virStor= ageSource *src, return -1; } - if (virJSONValueObjectCreate(props, - "s:driver", driver, - "S:filename", filename, - "A:location", &location, - "U:size", src->physical, - NULL) < 0) + if (virJSONValueObjectAdd(props, + "s:driver", driver, + "S:filename", filename, + "A:location", &location, + "U:size", src->physical, + NULL) < 0) return -1; return 0; @@ -3334,9 +3334,9 @@ qemuBlockReopenFormatMon(qemuMonitor *mon, if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0) return -1; - if (virJSONValueObjectCreate(&reopenprops, - "a:options", &reopenoptions, - NULL) < 0) + if (virJSONValueObjectAdd(&reopenprops, + "a:options", &reopenoptions, + NULL) < 0) return -1; if (qemuMonitorBlockdevReopen(mon, &reopenprops) < 0) @@ -3554,14 +3554,14 @@ qemuBlockExportGetNBDProps(const char *nodename, } } - if (virJSONValueObjectCreate(&ret, - "s:type", "nbd", - "s:id", exportid, - "s:node-name", nodename, - "b:writable", writable, - "s:name", exportname, - "A:bitmaps", &bitmapsarr, - NULL) < 0) + if (virJSONValueObjectAdd(&ret, + "s:type", "nbd", + "s:id", exportid, + "s:node-name", nodename, + "b:writable", writable, + "s:name", exportname, + "A:bitmaps", &bitmapsarr, + NULL) < 0) return NULL; return ret; --=20 2.31.1