From patchwork Fri Dec 2 15:08:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9458689 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9ACC960236 for ; Fri, 2 Dec 2016 15:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C82628542 for ; Fri, 2 Dec 2016 15:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 811562856C; Fri, 2 Dec 2016 15:11:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F38C28542 for ; Fri, 2 Dec 2016 15:11:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpSe-000324-SW; Fri, 02 Dec 2016 15:09:16 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpSd-0002yU-56 for xen-devel@lists.xen.org; Fri, 02 Dec 2016 15:09:15 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id C5/56-12362-A9E81485; Fri, 02 Dec 2016 15:09:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42I53H6XVXdmn2O Ewb7zxhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8av87uZCpabVvx+uoK1gXGpehcjF4eQwBJG iQ9zXjN3MXJysAnYS3T9OcoEYosISEtc+3yZEcRmFiiRaDrXCVYjLOAuseH0XnYQm0VAVeLx5 Clg9bwClhKXPr0Ci0sIyEssPH8ELM4JFH/Qch1sjpCAhUTzjTssEPWCEidnPgGyOYDmq0usny cEsUpeonnrbOYJjLyzkFTNQqiahaRqASPzKkb14tSistQiXSO9pKLM9IyS3MTMHF1DA2O93NT i4sT01JzEpGK95PzcTYzAgKpnYGDcwXiq2fkQoyQHk5Ior2mOY4QQX1J+SmVGYnFGfFFpTmrx IUYZDg4lCd6/PUA5waLU9NSKtMwcYGjDpCU4eJREeFV7gdK8xQWJucWZ6RCpU4yKUuK8ziAJA ZBERmkeXBssni4xykoJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEoaYwpOZVwI3/RXQYiagxR3X7U EWlyQipKQaGLOvHeDPkZ0Tvs/3Sqb3mW+MCXyeT05uXbZNIL5tm7F47U+9HZ9miGW3p5Wcydn /oFpNdnr2db/3mRkTf4iWFe3oUTGdfeaj0q5LIXL7xR/nXDQu2iO/yVWVPfCV49NZidvu59rf tWJtNZ+x6qNuiWLHhddC7gvOStrIRK/bJ1d18K5tzcaZs5RYijMSDbWYi4oTAR9D0MqiAgAA X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1480691353!74220621!1 X-Originating-IP: [195.135.221.5] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28517 invoked from network); 2 Dec 2016 15:09:13 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Dec 2016 15:09:13 -0000 Received: from laptop.vms (mhy71-2-88-167-63-197.fbx.proxad.net [88.167.63.197]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Fri, 02 Dec 2016 16:09:12 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Fri, 2 Dec 2016 16:08:18 +0100 Message-Id: <20161202150841.31227-13-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161202150841.31227-1-cbosdonnat@suse.com> References: <20161202150841.31227-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Ian Jackson , Wei Liu , Cedric Bosdonnat Subject: [Xen-devel] [PATCH v2 12/35] libxl/libxl_colo_save.c: used LOG*D functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cedric Bosdonnat Use LOG*D logging functions where possible instead of the LOG* ones. Signed-off-by: Cédric Bosdonnat Acked-by: Wei Liu --- tools/libxl/libxl_colo_save.c | 49 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/tools/libxl/libxl_colo_save.c b/tools/libxl/libxl_colo_save.c index 26b3afd..6277770 100644 --- a/tools/libxl/libxl_colo_save.c +++ b/tools/libxl/libxl_colo_save.c @@ -90,7 +90,7 @@ void libxl__colo_save_setup(libxl__egc *egc, libxl__colo_save_state *css) STATE_AO_GC(dss->ao); if (dss->type != LIBXL_DOMAIN_TYPE_HVM) { - LOG(ERROR, "COLO only supports hvm now"); + LOGD(ERROR, dss->domid, "COLO only supports hvm now"); goto out; } @@ -122,8 +122,7 @@ void libxl__colo_save_setup(libxl__egc *egc, libxl__colo_save_state *css) libxl__stream_read_start(egc, &css->srs); css->cps.ao = ao; if (colo_proxy_setup(&css->cps)) { - LOG(ERROR, "COLO: failed to setup colo proxy for guest with domid %u", - cds->domid); + LOGD(ERROR, cds->domid, "COLO: failed to setup colo proxy for guest"); goto out; } @@ -156,8 +155,7 @@ static void colo_save_setup_done(libxl__egc *egc, return; } - LOG(ERROR, "COLO: failed to setup device for guest with domid %u", - dss->domid); + LOGD(ERROR, dss->domid, "COLO: failed to setup device for guest"); cds->callback = colo_save_setup_failed; libxl__checkpoint_devices_teardown(egc, cds); } @@ -171,8 +169,9 @@ static void colo_save_setup_failed(libxl__egc *egc, STATE_AO_GC(cds->ao); if (rc) - LOG(ERROR, "COLO: failed to teardown device after setup failed" - " for guest with domid %u, rc %d", cds->domid, rc); + LOGD(ERROR, cds->domid, + "COLO: failed to teardown device after setup failed" + " for guest, rc %d", rc); cleanup_device_subkind(cds); dss->callback(egc, dss, rc); @@ -192,8 +191,9 @@ void libxl__colo_save_teardown(libxl__egc *egc, EGC_GC; - LOG(WARN, "COLO: Domain suspend terminated with rc %d," - " teardown COLO devices...", rc); + LOGD(WARN, dss->domid, + "COLO: Domain suspend terminated with rc %d," + " teardown COLO devices...", rc); libxl__stream_read_abort(egc, &css->srs, 1); @@ -268,7 +268,7 @@ static void colo_suspend_primary_vm_done(libxl__egc *egc, EGC_GC; if (rc) { - LOG(ERROR, "cannot suspend primary vm"); + LOGD(ERROR, dss->domid, "cannot suspend primary vm"); goto out; } @@ -294,7 +294,7 @@ static void colo_postsuspend_cb(libxl__egc *egc, EGC_GC; if (rc) { - LOG(ERROR, "postsuspend fails"); + LOGD(ERROR, dss->domid, "postsuspend fails"); goto out; } @@ -326,13 +326,14 @@ static void colo_read_svm_suspended_done(libxl__egc *egc, EGC_GC; if (id != CHECKPOINT_SVM_SUSPENDED) { - LOG(ERROR, "invalid section: %d, expected: %d", id, + LOGD(ERROR, dss->domid, "invalid section: %d, expected: %d", id, CHECKPOINT_SVM_SUSPENDED); goto out; } if (!css->paused && libxl__qmp_get_replication_error(gc, dss->domid)) { - LOG(ERROR, "replication error occurs when primary vm is running"); + LOGD(ERROR, dss->domid, + "replication error occurs when primary vm is running"); goto out; } @@ -405,7 +406,7 @@ static void colo_read_svm_ready_done(libxl__egc *egc, EGC_GC; if (id != CHECKPOINT_SVM_READY) { - LOG(ERROR, "invalid section: %d, expected: %d", id, + LOGD(ERROR, dss->domid, "invalid section: %d, expected: %d", id, CHECKPOINT_SVM_READY); goto out; } @@ -432,13 +433,13 @@ static void colo_preresume_cb(libxl__egc *egc, EGC_GC; if (rc) { - LOG(ERROR, "preresume fails"); + LOGD(ERROR, dss->domid, "preresume fails"); goto out; } if (css->qdisk_used && !css->qdisk_setuped) { if (libxl__qmp_start_replication(gc, dss->domid, true)) { - LOG(ERROR, "starting replication fails"); + LOGD(ERROR, dss->domid, "starting replication fails"); goto out; } css->qdisk_setuped = true; @@ -446,14 +447,14 @@ static void colo_preresume_cb(libxl__egc *egc, if (!css->paused) { if (libxl__qmp_do_checkpoint(gc, dss->domid)) { - LOG(ERROR, "doing checkpoint fails"); + LOGD(ERROR, dss->domid, "doing checkpoint fails"); goto out; } } /* Resumes the domain and the device model */ if (libxl__domain_resume(gc, dss->domid, /* Fast Suspend */1)) { - LOG(ERROR, "cannot resume primary vm"); + LOGD(ERROR, dss->domid, "cannot resume primary vm"); goto out; } @@ -464,7 +465,7 @@ static void colo_preresume_cb(libxl__egc *egc, if (css->paused) { rc = libxl_domain_unpause(CTX, dss->domid); if (rc) { - LOG(ERROR, "cannot unpause primary vm"); + LOGD(ERROR, dss->domid, "cannot unpause primary vm"); goto out; } css->paused = false; @@ -491,7 +492,7 @@ static void colo_read_svm_resumed_done(libxl__egc *egc, EGC_GC; if (id != CHECKPOINT_SVM_RESUMED) { - LOG(ERROR, "invalid section: %d, expected: %d", id, + LOGD(ERROR, dss->domid, "invalid section: %d, expected: %d", id, CHECKPOINT_SVM_RESUMED); goto out; } @@ -553,7 +554,7 @@ static void colo_proxy_async_call_done(libxl__egc *egc, EGC_GC; if (status) { - LOG(ERROR, "failed to wait for new checkpoint"); + LOGD(ERROR, dss->domid, "failed to wait for new checkpoint"); colo_start_new_checkpoint(egc, &dss->cds, ERROR_FAIL); return; } @@ -595,7 +596,7 @@ static void colo_device_commit_cb(libxl__egc *egc, EGC_GC; if (rc) { - LOG(ERROR, "commit fails"); + LOGD(ERROR, dss->domid, "commit fails"); goto out; } @@ -644,7 +645,7 @@ static void colo_common_write_stream_done(libxl__egc *egc, if (rc < 0) { /* TODO: it may be a internal error, but we don't know */ - LOG(ERROR, "sending data fails"); + LOGD(ERROR, dss->domid, "sending data fails"); ok = 0; goto out; } @@ -675,7 +676,7 @@ static void colo_common_read_stream_done(libxl__egc *egc, if (rc < 0) { /* TODO: it may be a internal error, but we don't know */ - LOG(ERROR, "reading data fails"); + LOGD(ERROR, dss->domid, "reading data fails"); ok = 0; goto out; }