Message ID | 20180723201748.25573-13-mdroth@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> 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 B309314BC for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 20:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25D32848D for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 20:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96F4228495; Mon, 23 Jul 2018 20:27:15 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 34D2F2848D for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 20:27:15 +0000 (UTC) Received: from localhost ([::1]:36377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1fhhQI-0000sw-8n for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Jul 2018 16:27:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhIB-0001MR-RV for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:18:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhI8-0002JZ-HQ for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:18:51 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:37377) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhI8-0002Il-BE; Mon, 23 Jul 2018 16:18:48 -0400 Received: by mail-oi0-x234.google.com with SMTP id k81-v6so3469461oib.4; Mon, 23 Jul 2018 13:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WwITfhk8KiOTFgv9FiELfz5lI90hgvziGAE5hDjMYFE=; b=Iq/LlohfDOQ1MFifJz7wuu6GOrak5uZW09bN/41wsgIcIUhviDX+BM+KXvO8s2YvEV lpLEn/ThFNyjY7dz/R6QsBJ7fWh236JElJP0DUplJyfDzCd2lgJbgMRJp4VPu4l+EUPY K4SqK128MJTzDjbKHRl/1TxUNXvqLMTphk/86r69VjcWBvs/9McEu2gXzfxkE3c6JGzT k2/bEU7XJIEGZJmUrOgewiyJhDNPlTaMm4YViD8X5itjn3TjfE7+Nv47F4HVtu0/LLQR oPv9XmdKNaa/ZUKINrp+l/MOIN2sZAYEGMIvxl4APSSJlBLrDdAE3N9fdFKXU94DtLEC ccIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=WwITfhk8KiOTFgv9FiELfz5lI90hgvziGAE5hDjMYFE=; b=jCN2fx4j6UsVBb3/Jc8Sb0EuGffuULh+Pi2gex6V1bmg5E98n8HxfqGTF0Be/hq61u JoR7C4vakVBgWNuINqVVZju5nHL5aV6m6rp7G9oGEV/AuEmYyYZ7UKsn1hVKvICSLKqm UbXDRNDWlMux4HdK22SOQUglYKgKx99FxtWd7DFDo0UOveglgMWYwp2PsPQbsjTiZSRa xSXAg2wWWA4Pa9XRzzuvzc3tBSgFy8hCd9flY2t8fG8P6NBvCAGX/N0WyDKnANTKYTEq QM/KrMauQsMmB4aAPCdMoAhzHuKev+sR+b4G6Z8oO3r4UopuIS3mctIsJVPU4UwM57Ro u9OA== X-Gm-Message-State: AOUpUlEJV2odJ5CiFH+1iCadtCEoDPs/e5UqBiQbNQQwhpk+kui8ZCpj 4PDusj3zl4iNz/kY6mTyM+okJP7MCI0= X-Google-Smtp-Source: AAOMgpeifXvouXcwvhpnWA85VWAJOSIVqFjRARmZaDm3cccnULqE4kOLS1BWW7EIzHBtyoy/kw+kaA== X-Received: by 2002:aca:dad7:: with SMTP id r206-v6mr255350oig.271.1532377127145; Mon, 23 Jul 2018 13:18:47 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id s142-v6sm8868851oie.48.2018.07.23.13.18.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:18:46 -0700 (PDT) From: Michael Roth <mdroth@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:21 -0500 Message-Id: <20180723201748.25573-13-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::234 Subject: [Qemu-devel] [PATCH 12/99] qemu-img: Resolve relative backing paths in rebase X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: qemu-stable@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Patch Round-up for stable 2.12.1, freeze on 2018-07-30
|
expand
|
diff --git a/qemu-img.c b/qemu-img.c index 855fa52514..15d457d6b8 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3191,6 +3191,9 @@ static int img_rebase(int argc, char **argv) } if (out_baseimg[0]) { + const char *overlay_filename; + char *out_real_path; + options = qdict_new(); if (out_basefmt) { qdict_put_str(options, "driver", out_basefmt); @@ -3199,8 +3202,26 @@ static int img_rebase(int argc, char **argv) qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true); } - blk_new_backing = blk_new_open(out_baseimg, NULL, + overlay_filename = bs->exact_filename[0] ? bs->exact_filename + : bs->filename; + out_real_path = g_malloc(PATH_MAX); + + bdrv_get_full_backing_filename_from_filename(overlay_filename, + out_baseimg, + out_real_path, + PATH_MAX, + &local_err); + if (local_err) { + error_reportf_err(local_err, + "Could not resolve backing filename: "); + ret = -1; + g_free(out_real_path); + goto out; + } + + blk_new_backing = blk_new_open(out_real_path, NULL, options, src_flags, &local_err); + g_free(out_real_path); if (!blk_new_backing) { error_reportf_err(local_err, "Could not open new backing file '%s': ",