From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2kbH-0007Xl-7r for qemu-devel@nongnu.org; Fri, 26 Jul 2013 12:10:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2kbG-00018A-1T for qemu-devel@nongnu.org; Fri, 26 Jul 2013 12:10:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2kbF-00017D-BU for qemu-devel@nongnu.org; Fri, 26 Jul 2013 12:10:37 -0400 Message-ID: <51F29F77.608@redhat.com> Date: Fri, 26 Jul 2013 10:10:31 -0600 From: Eric Blake MIME-Version: 1.0 References: <1374584606-5615-1-git-send-email-kwolf@redhat.com> <1374584606-5615-14-git-send-email-kwolf@redhat.com> In-Reply-To: <1374584606-5615-14-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t1NL6V5lI1qmXLXO9snq8wFPCAlbNshAN" Subject: Re: [Qemu-devel] [PATCH 13/18] blockdev: Rename I/O throttling options for QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: armbru@redhat.com, =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , qemu-devel@nongnu.org, stefanha@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --t1NL6V5lI1qmXLXO9snq8wFPCAlbNshAN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/23/2013 07:03 AM, Kevin Wolf wrote: > In QMP, we want to use dashes instead of underscores in QMP argument > names, and use nested options for throttling. Convert them for -drive > before calling into the code that will be shared between -drive and > blockdev-add. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 52 +++++++++++++++++++++++++++++++++++++++------------- > 1 file changed, 39 insertions(+), 13 deletions(-) >=20 This patch will probably conflict with Beno=C3=AEt's work on leaky bucket= throttling; can the two of you decide which one should go in first? Are we trying to target both this series and leaky bucket throttling for 1.6?= > @@ -485,17 +486,17 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockIn= terfaceType block_default_type) > =20 > /* disk I/O throttling */ > io_limits.bps[BLOCK_IO_LIMIT_TOTAL] =3D > - qemu_opt_get_number(opts, "bps", 0); > + qemu_opt_get_number(opts, "throttling.bps-total", 0); I like the rename to bps-total, to make it more obvious why it is provided in addition to bps-{read,write}. > io_limits.bps[BLOCK_IO_LIMIT_READ] =3D > - qemu_opt_get_number(opts, "bps_rd", 0); > + qemu_opt_get_number(opts, "throttling.bps-read", 0); > io_limits.bps[BLOCK_IO_LIMIT_WRITE] =3D > - qemu_opt_get_number(opts, "bps_wr", 0); > + qemu_opt_get_number(opts, "throttling.bps-write", 0); Thank you for spelling out the names; QMP doesn't need the abbreviations that the command line has. > +DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_def= ault_type) > +{ > + /* Change legacy command line options into QMP ones */ > + qemu_opt_rename(all_opts, "iops", "throttling.iops-total"); > + qemu_opt_rename(all_opts, "iops_rd", "throttling.iops-read"); > + qemu_opt_rename(all_opts, "iops_wr", "throttling.iops-write"); Of course, the intent here is to preserve back-compat (the old spelling continues to work, even if it differs from the QMP spelling). But will this patch also allow the command line to learn support for the new spellings? If so, is that worth mentioning as an intentional side effect in the commit message? Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --t1NL6V5lI1qmXLXO9snq8wFPCAlbNshAN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR8p93AAoJEKeha0olJ0NqynIH/RqStfD/JVk1SVI1yF8bMhGb GvgkmDWi8d2+8Cip/7/c7IMcIm7GXy3I7Io9/lAUGv9WY7aZTeeW+NCgA2SipbF5 u66QaisvoQnumu/80kyJNu9jCjNYxjJA4NTTRlL/t2tdXWBpFKRlprFwmP1CoqWu R4R0tqKpGwARcVvadrp9zX5Ec9he8BDU46alZb4utZWLS2JgZGBLjVwYUIpHi/dm LSoiolkELMSpa+C3izLAIEHLrnz5UKkpyBKvGHC3KTwRL7PFpgbJ3Dd4jeuP0K4d RdZ6uh0gCuDb3LCA/eHQ5epaBNuT5W0hs9/jVD8HDvb7/4cxtag6RbkXGusX8vw= =dDTe -----END PGP SIGNATURE----- --t1NL6V5lI1qmXLXO9snq8wFPCAlbNshAN--