From patchwork Mon Mar 4 08:42:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 10837449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E97A1390 for ; Mon, 4 Mar 2019 08:43:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18B9129C93 for ; Mon, 4 Mar 2019 08:43:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A10A29CA8; Mon, 4 Mar 2019 08:43:26 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AEF7F29C93 for ; Mon, 4 Mar 2019 08:43:25 +0000 (UTC) Received: from localhost ([127.0.0.1]:50338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0jC1-0006Ea-4E for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Mar 2019 03:43:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0jBL-0005vU-LE for qemu-devel@nongnu.org; Mon, 04 Mar 2019 03:42:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0jBK-0003tg-W2 for qemu-devel@nongnu.org; Mon, 04 Mar 2019 03:42:43 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:40580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0jBK-0003sW-Mb for qemu-devel@nongnu.org; Mon, 04 Mar 2019 03:42:42 -0500 Received: by mail-wm1-x341.google.com with SMTP id g20so3759657wmh.5 for ; Mon, 04 Mar 2019 00:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=QzrzsipAyvVjerEH0dsyosg/SnkGDdSMP6sCUwJPJGw=; b=YyVSamPuJesrr8EuYANEDVRgbGbxH+xaz4iUZFwvLHt9ZJpu1wLo6PA9H2/8Dg26Tr aF5B/ASaUAOoaGcZ3SSvRERpgkR8p2ZKke19GmG0b0rEn66XBv+SQcFc9h0edcem3jd6 10WuFgFIIeWbIyOecdvoL2fDOHfujOlqPREZy0xmOW/uSeCDneTegjopvvfVcfEe5OIv 691kT7sUQNepQR9AiTv6I3R3P3J5sSjNyIufa1z/lLNgG3IFBGe8zNunlbGbrdeQWkEx hRnPZZg6vlNxU7vwSK4YKzcxvfNJ6v7ZYkvqw8KJUuWLWuUskRQ/UX6fDtGne/k7SZ34 2H5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QzrzsipAyvVjerEH0dsyosg/SnkGDdSMP6sCUwJPJGw=; b=plxzVVrdvh/oY9iklEwQBSBtUZnsRLRasHshKQrkuVEMNGsjCF/q6mxcviwSv30gQ6 lYJs8Ugy6ohMJKyuxH7850srGXUfP50LESHvS5PJsQGbcK57NYmgjUJJ3uXiWPdK4fcv TJFVVLKML/rt9z8lDYJCaDbDBXSvNQ23W7fn44XSdGZwysviaKCOokm8DTerVi+zd+DD o1cbU59+BLZ/DMz7g8MCoz5yXYBZZcX/lSHD3hO1TyWeNYD5CTdzSPsQnHNbSA6frMJx IDN66OfeeKtIkNuBJwla5HnjClaXSnv9a09qB6sTpKYbvPLHLiWb1b4okfwm7nAzJpk/ BkQw== X-Gm-Message-State: APjAAAUKrWqSj2ojetdy+Itkv9t2BgZ4TP7e+bUvjUmIX1bpkvHdiHoX 4/Wq9joiBn3CD8UZXV8vFFpbFuUz X-Google-Smtp-Source: APXvYqwAHh+KpywPnaqq27bMzRKm6okn+MrAQ/TSZffYXCLzzSxGY1aPyVfWiSX7GLSngn9IrBDMZA== X-Received: by 2002:a7b:cf32:: with SMTP id m18mr8683921wmg.98.1551688960869; Mon, 04 Mar 2019 00:42:40 -0800 (PST) Received: from localhost.localdomain ([176.228.155.165]) by smtp.gmail.com with ESMTPSA id u13sm11032837wmf.3.2019.03.04.00.42.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2019 00:42:40 -0800 (PST) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Mon, 4 Mar 2019 10:42:38 +0200 Message-Id: <20190304084238.13481-1-marcel.apfelbaum@gmail.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH] migration/rdma: clang compilation fix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dgilbert@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Configuring QEMU with: ../configure --cc=clang --enable-rdma Leads to compilation error: CC migration/rdma.o CC migration/block.o qemu/migration/rdma.c:3615:58: error: taking address of packed member 'rkey' of class or structure 'RDMARegisterResult' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] (uintptr_t)host_addr, NULL, ®_result->rkey, ^~~~~~~~~~~~~~~~ This is a false warning; even if RDMARegisterResult is "packed", rkey is the first field so is guaranteed to be aligned. Fix it by disabling the warning only for this instance. Signed-off-by: Marcel Apfelbaum --- migration/rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migration/rdma.c b/migration/rdma.c index 54a3c11540..e0f66a4717 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3611,6 +3611,8 @@ static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque) } chunk_start = ram_chunk_start(block, chunk); chunk_end = ram_chunk_end(block, chunk + reg->chunks); + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Waddress-of-packed-member" if (qemu_rdma_register_and_get_keys(rdma, block, (uintptr_t)host_addr, NULL, ®_result->rkey, chunk, chunk_start, chunk_end)) { @@ -3618,6 +3620,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque) ret = -EINVAL; goto out; } + #pragma clang diagnostic pop reg_result->host_addr = (uintptr_t)block->local_host_addr;