From patchwork Thu Nov 17 17:35:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9434817 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 04A976047D for ; Thu, 17 Nov 2016 17:38:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBA2728644 for ; Thu, 17 Nov 2016 17:38:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E088D2968C; Thu, 17 Nov 2016 17:38:48 +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 6EB2228644 for ; Thu, 17 Nov 2016 17:38:48 +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 1c7Qc8-0008OI-Uh; Thu, 17 Nov 2016 17:36:44 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7Qc7-0008LE-7t for xen-devel@lists.xen.org; Thu, 17 Nov 2016 17:36:43 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 5C/DF-22514-9AAED285; Thu, 17 Nov 2016 17:36:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42I53H6XVXfFK90 IgxV/DCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ozGp0uYCv6bVPycsoutgbFRvYuRk0NIYAmj xP/pcSA2m4C9RNefo0wgtoiAtMS1z5cZQWxmgRKJvU87wGxhAXeJDaf3soPYLAKqErc2b2ABs XkFLCTe/GthBbElBOQlLlw9BRbnBIofOHyOGWKXucSbNwuYIOoFJU7OfAJUwwE0X11i/TwhiF XyEs1bZzNPYOSdhaRqFkLVLCRVCxiZVzFqFKcWlaUW6Roa6CUVZaZnlOQmZuYAeaZ6uanFxYn pqTmJScV6yfm5mxiBAcUABDsY10x1PsQoycGkJMrL/FI3QogvKT+lMiOxOCO+qDQntfgQowwH h5IE788XQDnBotT01Iq0zBxgaMOkJTh4lER4JUFaeYsLEnOLM9MhUqcYFaXEeT+C9AmAJDJK8 +DaYPF0iVFWSpiXEegQIZ6C1KLczBJU+VeM4hyMSsK8b0Gm8GTmlcBNfwW0mAlo8R4BHZDFJY kIKakGxinJJlJmx4qkSiXnxmSI8e++njF7suFMF/X6kIcHpjW9l+VbnpXzfp37kTmp1bKCl7o 1+lfMmrMriOOdd4TkErMC043tCSs+tX+ZmSGQG5AaLtb75fzqV2WGsRcMRZkCD15I2rvwxyHD Z8v55r/3+ZZvylx+yJEj8kI8x7Gtzs/aVs31/2Rqp8RSnJFoqMVcVJwIAOQCbguiAgAA X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1479404197!55290805!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 23253 invoked from network); 17 Nov 2016 17:36:38 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Nov 2016 17:36:38 -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); Thu, 17 Nov 2016 18:36:38 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Thu, 17 Nov 2016 18:35:54 +0100 Message-Id: <20161117173617.6697-13-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161117173617.6697-1-cbosdonnat@suse.com> References: <20161117173617.6697-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson , 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 --- 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; }