From nobody Wed May 1 23:50:39 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.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552319059877762.8475150905037; Mon, 11 Mar 2019 08:44:19 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 1400B307D846; Mon, 11 Mar 2019 15:44:18 +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 D6CE260123; Mon, 11 Mar 2019 15:44:17 +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 88685181A137; Mon, 11 Mar 2019 15:44:17 +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 x2A13mn7016386 for ; Sat, 9 Mar 2019 20:03:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0DBAF60BFB; Sun, 10 Mar 2019 01:03:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E886260BF2; Sun, 10 Mar 2019 01:03:45 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D7C9C057F3B; Sun, 10 Mar 2019 01:03:44 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id w6so1304394wrs.4; Sat, 09 Mar 2019 17:03:44 -0800 (PST) Received: from lean.com (89-138-89-250.bb.netvision.net.il. [89.138.89.250]) by smtp.gmail.com with ESMTPSA id 62sm1672133wra.46.2019.03.09.17.03.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2019 17:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=r2R9JX0FMe8t1D0HOWnwrK/pI2oxRSlavaJe4hT1dAQ=; b=V2HfZ15a4do+TraN5/h8JaOOUPpDovd2tMqwS0sQCbcozLVnvQxxvgcU5SDzH2sPWv FM+gx5ff7/9EwSFuubNM7xKcXRx2qjoevtOP0UeO9RhouL2oScNqPZycQfIrPFhRgqzc A8GMEAq/xFMf5q7rDlmWckTDp1nS4aankwL56+k+flWHgxD4hSC+WzgMvy9t9R1fxc85 +1BYrojtWkfO+nVt9rwGQPFM8OkZQTnagzdLyDnU+c+7fMV7Y7Xu63G6+p9rJwv/5Roo jbVL7Ql+lG/Zgc2lteZljexCSZeouKfNq7iqE1kMPpMdRxlWSHtjPKcTAG+H7uxkC3sd WEbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=r2R9JX0FMe8t1D0HOWnwrK/pI2oxRSlavaJe4hT1dAQ=; b=XpDSHEgttP3yrY3o3Dam7mIrftmQYIAwqiBh6NpA6gHTLpfUbJAjJIGLiKU/GSltVQ uiaZljwOkzq5xDrNh/FSEoWq4cj9bYk6yzJBxkeqs7Rk5dN+hxYedriYBUIXhA8EQiMO xi8zV0cuYPi4sg1LP0kIlGFDaOe2qX6tZp015aPnN82OYIQgp55vz1eeNzrR6mrQoR0O UozetC5wjrfaMEaFE6wQNm38CcCMYcprIV6yjcwpfgdMWvsfUbyAEhsVmkE6k+jsMvcV Q9tOpUwAMXq+9TsanUTM2cTo6z4YlejMK6vZjwKfi3dN6Vvjx8v2NmDWLXHFkZHv/rcr 2QlQ== X-Gm-Message-State: APjAAAXjj0t3E1wObUP/8ISGXYXUzRy3uOSGK64L8/VDvpsrEybSJqRH jCN73XsH4tiWt60pYwJVCkp7SmKg X-Google-Smtp-Source: APXvYqzbiZ9YmWMx/QBChq39Kem+Jm9nqEodUqDX5OgP+eRcUMopxlMmKgLqTn8BKAT3/3spZagdFg== X-Received: by 2002:adf:fe05:: with SMTP id n5mr2923937wrr.160.1552179822709; Sat, 09 Mar 2019 17:03:42 -0800 (PST) From: Nir Soffer X-Google-Original-From: Nir Soffer To: libvir-list@redhat.com Date: Sun, 10 Mar 2019 03:03:25 +0200 Message-Id: <20190310010325.31863-1-nsoffer@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 10 Mar 2019 01:03:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 10 Mar 2019 01:03:44 +0000 (UTC) for IP:'209.85.221.43' DOMAIN:'mail-wr1-f43.google.com' HELO:'mail-wr1-f43.google.com' FROM:'nirsof@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.11 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.43 mail-wr1-f43.google.com 209.85.221.43 mail-wr1-f43.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 11 Mar 2019 11:44:16 -0400 Cc: Nir Soffer , phrdina@redhat.com Subject: [libvirt] [PATCH python] Fix handling of optional params in blockCopy() 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 11 Mar 2019 15:44:18 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit 2b4bd07e0a22 (Add check for params, nparams being a dictionary) changed the way the optional params argument is treated. If libvirt.virDomain.blockCopy() is called without specifying params, params is None, and the call will fail with: TypeError: block params must be a dictionary This is wrong as params is defined as kwarg, breaking existing libvirt users like oVirt. Remove the check, restoring the previous behaviour. Resolves: https://bugzilla.redhat.com/1687114 Signed-off-by: Nir Soffer --- libvirt-override.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libvirt-override.c b/libvirt-override.c index 857c018..127d71c 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -8829,19 +8829,17 @@ libvirt_virDomainBlockCopy(PyObject *self ATTRIBUTE= _UNUSED, =20 if (!PyArg_ParseTuple(args, (char *) "Ozz|OI:virDomainBlockCopy", &pyobj_dom, &disk, &destxml, &pyobj_dict, &flags= )) return NULL; =20 + /* Note: params is optional in libvirt.py */ if (PyDict_Check(pyobj_dict)) { if (virPyDictToTypedParams(pyobj_dict, ¶ms, &nparams, virPyDomainBlockCopyParams, VIR_N_ELEMENTS(virPyDomainBlockCopyPara= ms)) < 0) { return NULL; } - } else { - PyErr_Format(PyExc_TypeError, "block params must be a dictionary"); - return NULL; } =20 dom =3D (virDomainPtr) PyvirDomain_Get(pyobj_dom); =20 LIBVIRT_BEGIN_ALLOW_THREADS; --=20 2.17.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list