From patchwork Sun Nov 10 19:03:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Plotnikov X-Patchwork-Id: 1192657 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47B3N624Xpz9sPc for ; Mon, 11 Nov 2019 06:04:36 +1100 (AEDT) Received: from localhost ([::1]:44682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTsVk-0000KH-0q for incoming@patchwork.ozlabs.org; Sun, 10 Nov 2019 14:04:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34935) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTsV3-0000FX-Dl for qemu-devel@nongnu.org; Sun, 10 Nov 2019 14:03:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTsV2-000376-AR for qemu-devel@nongnu.org; Sun, 10 Nov 2019 14:03:49 -0500 Received: from relay.sw.ru ([185.231.240.75]:42168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iTsUz-00033i-Fx; Sun, 10 Nov 2019 14:03:45 -0500 Received: from [10.94.4.71] (helo=dptest2.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1iTsUv-00076X-3N; Sun, 10 Nov 2019 22:03:41 +0300 From: Denis Plotnikov To: qemu-block@nongnu.org Subject: [PATCH v0 0/2] allow to set 'drive' property on a realized block device Date: Sun, 10 Nov 2019 22:03:08 +0300 Message-Id: <20191110190310.19799-1-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, berrange@redhat.com, ehabkost@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, pbonzini@redhat.com, den@virtuozzo.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This allows to replace the file on a block device and is useful to workaround the cases (migration) when the VM image is placed on some shared storage with exclusive file opening model but the image should be open form more than one app. The previous version of approaching the workaround was based on the "blockdev-change-medium" command modification but had some flaws: * semantics: blockdev-change-medium is aimed to be used with removable devices only * interface: it can't accept all possible combination of parameters for the "drive" replacement (creation). More details here: http://patchwork.ozlabs.org/patch/1179329/ The current series suggests another approach: 1. blockdev-add 2. qom-set disk.drive = the blockdev added (this is what the series adds) Denis Plotnikov (2): qdev-properties-system: extend set_pionter for unrealized devices block: allow to set 'drive' property on a realized block device hw/core/qdev-properties-system.c | 117 +++++++++++++++++++++++++------ 1 file changed, 96 insertions(+), 21 deletions(-)