From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9bid-0005Eo-N2 for qemu-devel@nongnu.org; Mon, 29 Jun 2015 12:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9biY-0002de-1J for qemu-devel@nongnu.org; Mon, 29 Jun 2015 12:15:39 -0400 Date: Mon, 29 Jun 2015 17:10:15 +0100 From: Stefan Hajnoczi Message-ID: <20150629161015.GD24772@stefanha-thinkpad.redhat.com> References: <1435316769-25381-1-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TybLhxa8M7aNoW+V" Content-Disposition: inline In-Reply-To: <1435316769-25381-1-git-send-email-pl@kamp.de> Subject: Re: [Qemu-devel] [PATCH V2] block/nfs: add support for setting debug level List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, jcody@redhat.com, ronniesahlberg@gmail.com, qemu-devel@nongnu.org, qemu-block@nongnu.org --TybLhxa8M7aNoW+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 26, 2015 at 01:06:09PM +0200, Peter Lieven wrote: > upcoming libnfs versions will support logging debug messages. Add > support for it in qemu through a cmdline parameter. >=20 > Example > qemu -nfs debug=3D99 -cdrom nfs://... >=20 > Signed-off-by: Peter Lieven > --- > v1->v2: reworked patch to accept the debug level as a cmdline > parameter instead of an URI parameter [Stefan] >=20 > block/nfs.c | 40 ++++++++++++++++++++++++++++++++++++++++ > qemu-options.hx | 21 +++++++++++++++++++++ > vl.c | 8 ++++++++ > 3 files changed, 69 insertions(+) >=20 > diff --git a/block/nfs.c b/block/nfs.c > index ca9e24e..43d48ae 100644 > --- a/block/nfs.c > +++ b/block/nfs.c > @@ -274,6 +274,30 @@ static void nfs_file_close(BlockDriverState *bs) > nfs_client_close(client); > } > =20 > +static void nfs_parse_options(NFSClient *client) > +{ > + QemuOptsList *list; > + QemuOpts *opts; > + const char *debug; > + > + list =3D qemu_find_opts("nfs"); > + if (list) { > + opts =3D QTAILQ_FIRST(&list->head); > + if (opts) { > + debug =3D qemu_opt_get(opts, "debug"); > + if (debug) { > +#ifdef LIBNFS_FEATURE_DEBUG > + nfs_set_debug(client->context, atoi(debug)); This is a per-context API and there are already per-drive run-time options. Please use per-drive options instead of adding a global option. Stefan --TybLhxa8M7aNoW+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVkW3nAAoJEJykq7OBq3PI37oH/RMsTzVIYH8+zJLZy7gqVQUl 0xxCjGzLl7AGvSZGnrpVVw8XOFFKaoDzaiXxa/4kEZC1nxnPlmpmeflKBbVOTEo6 /9mueubaIy5WzRej43Xo4b91Xih7wQediYVPIq63zKfnW05/g0u3KJ7xisvCZdEB s4eG5o7bVwAf99XA4XCdHIb7VOfu6T3M8CEXjq3uj8BXJfj1zjJhfIJrLABM7D5b Z5WdyrQEmtEWTUyhSzsJSb8Hbha140uk19CmVOJ4qUfpTMUfujm8EO8VqqEkUun9 yneVqVyDvBrbbUaIpLO45STATuNXnOBtA1lM+m9m9BuZQU5UH340om4UV+G/jjk= =hNmh -----END PGP SIGNATURE----- --TybLhxa8M7aNoW+V--