From patchwork Tue Nov 15 10:18:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9429313 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 94EC360469 for ; Tue, 15 Nov 2016 10:21:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C4E0286BF for ; Tue, 15 Nov 2016 10:21:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68256286C4; Tue, 15 Nov 2016 10:21:50 +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 E9891286BF for ; Tue, 15 Nov 2016 10:21:49 +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 1c6aqT-0005K9-OL; Tue, 15 Nov 2016 10:20:05 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6aqT-0005BA-7l for xen-devel@lists.xen.org; Tue, 15 Nov 2016 10:20:05 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 27/9F-22495-451EA285; Tue, 15 Nov 2016 10:20:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42I53H6XVTf4oVa EwfdjChZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bcZ2EFraYVrz/fYWpgbFfvYuTiEBJYwihx vOErcxcjJwebgL1E15+jTCC2iIC0xLXPlxlBipgFTjBK9GzczAaSEBZwkdi88gGQzcHBIqAqs Wg+K0iYV8BSovXYBXYQW0JAXuLC1VMsIDYnUPzn0adgcSEBC4kll7uZIeoFJU7OfMICMoZZQF 1i/TwhkDAzUGvz1tnMExh5ZyGpmoVQNQtJ1QJG5lWM6sWpRWWpRbqGeklFmekZJbmJmTm6hgb GermpxcWJ6ak5iUnFesn5uZsYgeHEAAQ7GJd/dDrEKMnBpCTKK7RaK0KILyk/pTIjsTgjvqg0 J7X4EKMMB4eSBK/CA6CcYFFqempFWmYOMLBh0hIcPEoivDEgad7igsTc4sx0iNQpRkUpcd4Ak IQASCKjNA+uDRZNlxhlpYR5GYEOEeIpSC3KzSxBlX/FKM7BqCTMu/E+0BSezLwSuOmvgBYzAS 3eZa4BsrgkESEl1cCoELfdbnL/HEbuh9s2RH1PytvAeEdirXZ3ob5j5h6vQ6l2jIdNXpvxz+B +FcJQcdG0UO7Mkya+h6dnMb8y/z7hVlySgPTkoNfHl3Cck4pYlya+7dAulzvvDldXW1XvPZCo suBj1qed60/bl7aEHrmW0Hv5R3JYkGacem5qxdPEqz6zKqqWXb2vxFKckWioxVxUnAgAw1tgC 6ECAAA= X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1479205203!44659541!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 59550 invoked from network); 15 Nov 2016 10:20:03 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-6.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 15 Nov 2016 10:20:03 -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); Tue, 15 Nov 2016 11:20:02 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Tue, 15 Nov 2016 11:18:50 +0100 Message-Id: <20161115101913.10396-13-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161115101913.10396-1-cbosdonnat@suse.com> References: <20161115101913.10396-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= , Wei Liu , Ian Jackson , =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Subject: [Xen-devel] [PATCH 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: Cédric 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; }