From nobody Sun May 5 04:23:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1490775096345477.303193422174; Wed, 29 Mar 2017 01:11:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDC85C05AA6A; Wed, 29 Mar 2017 08:11:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 956FD7DD58; Wed, 29 Mar 2017 08:11:34 +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 6699C18523C6; Wed, 29 Mar 2017 08:11:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2T8BVuo007047 for ; Wed, 29 Mar 2017 04:11:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7766591347; Wed, 29 Mar 2017 08:11:31 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70ACF173A6 for ; Wed, 29 Mar 2017 08:11:29 +0000 (UTC) Received: from swiftbird.org (92-255-100-1.customer.comfortel.pro [92.255.100.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFDD181227 for ; Wed, 29 Mar 2017 08:11:28 +0000 (UTC) Received: from vtolstov by swiftbird.org with local (Exim 4.87) (envelope-from ) id 1csoKI-00030k-11 for libvir-list@redhat.com; Tue, 28 Mar 2017 13:26:10 +0300 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BDC85C05AA6A Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=selfip.ru Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BDC85C05AA6A DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BFDD181227 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=selfip.ru Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=vtolstov@swiftbird.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BFDD181227 From: Vasiliy Tolstov To: libvir-list@redhat.com Date: Tue, 28 Mar 2017 13:26:09 +0300 Message-Id: <20170328102609.11470-2-v.tolstov@selfip.ru> In-Reply-To: <20170328102609.11470-1-v.tolstov@selfip.ru> References: <20170328102609.11470-1-v.tolstov@selfip.ru> X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 29 Mar 2017 08:11:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 29 Mar 2017 08:11:29 +0000 (UTC) for IP:'92.255.100.1' DOMAIN:'92-255-100-1.customer.comfortel.pro' HELO:'swiftbird.org' FROM:'vtolstov@swiftbird.org' RCPT:'' X-RedHat-Spam-Score: 1.783 * (BAYES_50, HEADER_FROM_DIFFERENT_DOMAINS, RDNS_DYNAMIC) 92.255.100.1 92-255-100-1.customer.comfortel.pro 92.255.100.1 92-255-100-1.customer.comfortel.pro X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] allow to specify empty base and top for block commit 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 29 Mar 2017 08:11:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Vasiliy Tolstov --- src/libvirt-php.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/libvirt-php.c b/src/libvirt-php.c index e8384795d635..6bbacda19611 100644 --- a/src/libvirt-php.c +++ b/src/libvirt-php.c @@ -313,7 +313,7 @@ ZEND_ARG_INFO(0, memory) ZEND_ARG_INFO(0, flags) ZEND_END_ARG_INFO() =20 -ZEND_BEGIN_ARG_INFO_EX(arginfo_libvirt_domain_block_commit, 0, 0, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_libvirt_domain_block_commit, 0, 0, 2) ZEND_ARG_INFO(0, res) ZEND_ARG_INFO(0, disk) ZEND_ARG_INFO(0, base) @@ -6986,16 +6986,22 @@ PHP_FUNCTION(libvirt_domain_block_commit) php_libvirt_domain *domain =3D NULL; zval *zdomain; int retval; - char *disk; - int disk_len; + char *disk =3D NULL; + strsize_t disk_len; char *base =3D NULL; - int base_len; + strsize_t base_len; char *top =3D NULL; - int top_len; - long bandwidth =3D 0; - long flags =3D 0; + strsize_t top_len; + zend_long bandwidth =3D 0; + zend_long flags =3D 0; =20 - GET_DOMAIN_FROM_ARGS("rsssll", &zdomain, &disk, &disk_len, &base, &bas= e_len, &top, &top_len, &bandwidth, &flags); + GET_DOMAIN_FROM_ARGS("rs|ssll", &zdomain, &disk, &disk_len, &base, &ba= se_len, &top, &top_len, &bandwidth, &flags); + if (strcmp(disk, "") =3D=3D 0) + RETURN_FALSE; + if (strcmp(base, "") =3D=3D 0) + base =3D NULL; + if (strcmp(top, "") =3D=3D 0) + top =3D NULL; =20 retval =3D virDomainBlockCommit(domain->domain, disk, base, top, bandw= idth, flags); if (retval =3D=3D -1) --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list