Received: from eggs.gnu.org ([2001:4830:134:3::10]:55135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkZWp-0007ve-Eu for qemu-devel@nongnu.org; Thu, 15 Sep 2016 12:28:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkZWm-0002Mk-6Y for qemu-devel@nongnu.org; Thu, 15 Sep 2016 12:28:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkZWl-0002MU-U7 for qemu-devel@nongnu.org; Thu, 15 Sep 2016 12:28:44 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8FGSPhC043969 for ; Thu, 15 Sep 2016 12:28:43 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 25fr9hfew1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Sep 2016 12:28:42 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Sep 2016 17:28:40 +0100 From: Sascha Silbe In-Reply-To: <87mvj9cf4q.fsf@oc4731375738.ibm.com> References: <1471625435-6190-1-git-send-email-kwolf@redhat.com> <1471625435-6190-11-git-send-email-kwolf@redhat.com> <32842c09-6dce-b68b-d95e-de3813099faa@redhat.com> <87mvj9cf4q.fsf@oc4731375738.ibm.com> Date: Thu, 15 Sep 2016 18:28:38 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: <87k2edcekp.fsf@oc4731375738.ibm.com> Subject: Re: [Qemu-devel] [PATCH 10/10] qemu-iotests/118: Test media change with qdev name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, mreitz@redhat.com Dear Eric, Sascha Silbe writes: > result =3D self.vm.qmp('blockdev-change-medium', > id=3Dself.device_name or 'drive0', filename= =3Dnew_img, > format=3Diotests.imgfmt) Sorry, my eyes deceived me. I thought the original code was setting the "id" parameter in both cases. QEMUMachine.qmp() and QEMUMonitorProtocol.cmd() together translate the keyword arguments directly into QMP arguments, so passing None is different from not passing anything at all. The if/else is probably the best approach in that case; everything else I can think of would just be more complicated. Sascha --=20 Softwareentwicklung Sascha Silbe, Niederhofenstra=C3=9Fe 5/1, 71229 Leonberg https://se-silbe.de/ USt-IdNr. DE281696641