From patchwork Wed Jan 25 19:44:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 719969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v89X31w2Vz9tjt for ; Thu, 26 Jan 2017 16:31:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="EOC8LCRG"; dkim-atps=neutral Received: from localhost ([::1]:36221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWcer-0007dk-Ay for incoming@patchwork.ozlabs.org; Thu, 26 Jan 2017 00:31:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWce8-00079e-JO for qemu-devel@nongnu.org; Thu, 26 Jan 2017 00:30:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWce5-0004ia-Dj for qemu-devel@nongnu.org; Thu, 26 Jan 2017 00:30:56 -0500 Received: from mail-he1eur01on0094.outbound.protection.outlook.com ([104.47.0.94]:23666 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cWce4-0004hl-JX for qemu-devel@nongnu.org; Thu, 26 Jan 2017 00:30:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IknY1F0rABYwCWuiW+dVcuUXDZyIZMjclOttTSGfdFI=; b=EOC8LCRGcACvwN93z2N4onJdCAbCOGZ0WnmDMfKITVAHbkmkEtZdCUd7AYbHgn69raXydZG1Swdf+Zy0TNHBPoTGOp67esHgQU+6NxD6DyLmab7s+RVnHhpeXhzEFE/M39sxrLGILOoDGqfe0VQfWVuB6i26jL5X8XqHiqy4jRE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=den@virtuozzo.com; Received: from [192.168.1.248] (213.251.197.68) by VI1PR0801MB1806.eurprd08.prod.outlook.com (10.168.67.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 25 Jan 2017 19:44:58 +0000 To: Max Reitz , References: <1485362572-7246-1-git-send-email-den@openvz.org> <1e511c84-c9fa-1d4e-8a73-e48c0b29a59a@redhat.com> From: "Denis V. Lunev" Message-ID: <1251c8d7-3862-2cb9-a3c8-aa6d3c8e3924@openvz.org> Date: Wed, 25 Jan 2017 22:44:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1e511c84-c9fa-1d4e-8a73-e48c0b29a59a@redhat.com> X-Originating-IP: [213.251.197.68] X-ClientProxiedBy: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (10.171.121.142) To VI1PR0801MB1806.eurprd08.prod.outlook.com (10.168.67.147) X-MS-Office365-Filtering-Correlation-Id: d61559f1-9b0b-429d-03b8-08d4455aa57a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:VI1PR0801MB1806; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1806; 3:fn9XCtZzXC3l+Vbt2HH3c2J44uzj/7Ts+3SB72HBXt1P2KBBigli3iVUPzU8aygPz6WjgYvRFoQ0/AyUyDYNgf7k4Emz0bGXnAodp7m/+PIioCD1oTmL4WIulwG7v0VgL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CKuT0QV0TOai8= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1806; 31:WzGJHrOFVsJ0XzkdLJ5Lftlixrzmu/VAR4kx9TCgHwvoR6noVsXHl8/YdTQgvgGAkfSuPTqRq+rjXvi0m1lpbQ0Kv4YVNDaYiCdcW3RBCj1HFuGCKQPMy3LE6XxLeS8/Tss19R8BiUSero1k27DfWq6rrKgQEFr+S1k4Us/tXafPF7I01CIFR82p/uMnYzUlScQNm8WcX5OnmieK6mPI8qG7bPyUWt9GWEpxbKoahNyeRKg9Jl/yKBJAk8ZuB7ZqHB6XJSic92hvheu4xW9sERvOYx6v7pj+CPrLIHXGPBE=; 20:RZrMOaKi7GCy9tobma/t21lDea7iSc5eZIuCZcxuZkz6mjHG8JQ/h9g9+iGNGvWXy+TiB4hQxIodeZmeg5MOga9o21+SlN7KZwmMpxGF9LqNX8U2AGN9lsEpF/XPX5vm/3b7/xFOHmZUe+CLXgPCgikU2HFHYdKiMs5RfjCsq7CL3BxRYq7FkZ/9TOHG5efsBgBbZn6ASTcWYSK1TnR2UoT7RltIMxwa/BF9DVoGFKMIx66W1ZJspCWMbzIzpBGs X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506)(83566789882024); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148); SRVR:VI1PR0801MB1806; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1806; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1806; 4:Ggh8MQbZbXYOeXmgPbRmq4l/amjXQ8a9c5MPFw1/59f/bw1AuXWEUYVdNoq11o05narSaDUlYj+TyHopMgubSxIpnK7CJauYLwvBl2m8lL+RjBbTfF01pjf2fWYUDVwgI4gwTEiyDPorNc93wEGAeNmRq6iFLvFK8T2sPKhFOE/+3gBmack22cI2JzxUGTiJIlRWmI2wLtIESN1/CWMtum1v0NZhnhnR0YlzfjTHNwsUQGsJGLNj+lNYgUi5mimNIzZM/tqChudi2s/0ZvncRti1DiD26IbSyF4TjlNBbx5h5iahPhSbe9XVKvR/fKcHfigPupW8Zdr/mQwmYMVVBeCnIapbAlK8IlLzMVbE9KLYT7j+C5S2MI9uzLW707uW+KViq/z7BDMPP+AMIYD7wrEH3WA/5BmS3yxnseVJVORvdt2cWltqbuiwXyxBr4UCHQfJgT32VRdWNYUxmkzXzdx3WDbU6NcI62d7B5jrMp8/S6akjkO3C1PnIeeVhmzhiBoXoe7QvOja2virx6AUZU7ieGxhCQ0KMkx/aNjWNRqM7eZr3IJk09H1vXJf2+3+bDSNcPvNtCvdKUSzS1XfbUwHjx+VzJXbtmR0Bsk5dVcz6Fvjf/J9tNn7kmjuGqqGfqLdgeUZo+3SfA6qI29XGQ== X-Forefront-PRVS: 01986AE76B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(39830400002)(39450400003)(39410400002)(377454003)(45984002)(199003)(189002)(24454002)(50986999)(83506001)(42186005)(54356999)(8746002)(101416001)(31686004)(50466002)(76176999)(2950100002)(23756003)(8676002)(81156014)(305945005)(7736002)(64126003)(106356001)(42882006)(65826007)(117156001)(81166006)(105586002)(6666003)(5660300001)(38730400001)(53936002)(31696002)(33646002)(97736004)(4001350100001)(5001770100001)(65806001)(47776003)(3846002)(2906002)(4326007)(189998001)(66066001)(54906002)(68736007)(6486002)(6116002)(229853002)(92566002)(65956001)(36756003)(90366009)(6306002)(77096006)(25786008)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1806; H:[192.168.1.248]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?iso-8859-15?Q?1; VI1PR0801MB1806; 23:TRbl3ek33btDgK2/wrFk4qbdJCeAZQLn6Lym?= =?iso-8859-15?Q?1BQNlEHDkcPUs1eOA3/QCPbjlLUeKqlcoDrTosHYdg4oISIkNY/+02HBZ?= =?iso-8859-15?Q?KMugKCl4aJDO5X78GUXtfI+dAXiuuHp5f6KGen34yIcVUu1hoCBQQm4ki?= =?iso-8859-15?Q?NeZHZm+a3LlPRHzj69jTKgKeiGIrviSVJfxbZT5di1eARa3lRTrVa3FP0?= =?iso-8859-15?Q?X7d/n60W/BepphLHABL2XIJyuhTqNtxncFwLo2tZhu3GhMjHvp2077TtO?= =?iso-8859-15?Q?vVjZe2SIDCQU6RUfVhwiQm2ZmeGTlaaXVYaDKakQddw62JpvrBlmbLzhV?= =?iso-8859-15?Q?POE4cSByAOsEdexqwaH9UszerFcJQPgARVhEC46IieMKY+QCwnm/PFZZ5?= =?iso-8859-15?Q?2w3TA4cLSYr8ipxJAkTJpQvyDjAPB47IpN2M/JNjd6lXcVMzyByPakXcJ?= =?iso-8859-15?Q?lXqBXGXVo6lRA6ET/oxtH1R929kDflU1JdbV06Hoi1lvFohlTyClLAuo/?= =?iso-8859-15?Q?F52xCRAdjRbGhbTf7PFuChl6/NGqTr7JE7RmIJ2WSg9oTSi0A5t1BFtDG?= =?iso-8859-15?Q?ve5YhLS9Ef7gz2Zp1OBqnkIRvQvEr6SaJGx/7m1jdZHakbEt8VeScYni2?= =?iso-8859-15?Q?ifBG3r90T96W4f5bCsJNscKGwgxFuayf9d4SE/99domorn266962c+2Hq?= =?iso-8859-15?Q?EL+BEbHyxiLh14M+gbzVtsEl7YTn1qakxHTah4H0JXKIX3FCcOwtprQaV?= =?iso-8859-15?Q?A2WqfTlYmhjlfUumKtdwOyT2wyt7kpRK/7Fp6pwxSCZNdexeRthhkjOTK?= =?iso-8859-15?Q?BytgRfn41c7a6CPs2+lpCYBxaa19YS5zmadvJvlQdlLF/nNvLiMwKh2Pm?= =?iso-8859-15?Q?uhI+vnSyJ7PB1Kqa5G9t7d0T6KEPbLLjFkffN0uf8BjYOFCFBEsZ1Usdl?= =?iso-8859-15?Q?h6wHHMfvhrNoQDVYmb/8nXzytto3uNQyol7BbfDb1jMRC4qJcPPmIjfr1?= =?iso-8859-15?Q?XRtZXQm/fEar+0LeIkkWEyy6RSZU1Z+sE+E228X7Fwv/einulisPBEZuY?= =?iso-8859-15?Q?BF4PGN24rldOHO3s2HxoEaNuDPD9vXVbt4nNRGkAEbrmP8aacyEFqw3pF?= =?iso-8859-15?Q?0R1CNKBg1xzsRTf5j8aR7+cVl4GveByBukuXTFwgFk+VFSTz2VZ4SbzMW?= =?iso-8859-15?Q?hWGKHisrnubhMzfbIZaNfHwcAW+VeBFAXWlbkL7aAaN9f23mydZrZLiU7?= =?iso-8859-15?Q?ElBM8mw8IPZBviWjQCFMHvOKvbTpj68x06rE95dR+jPdCANeGA9zqxyFf?= =?iso-8859-15?Q?iashhiHJ7jJVo5MQRZbqKLE5cH63W2XVrME8GVluX6dAsWhTo45sgdZDa?= =?iso-8859-15?Q?TK82nqeNmvlIeg5tjSBu4TE4bXIkDABO6uwprFHJmGtlgLd9SOVorHuvP?= =?iso-8859-15?Q?II4WylGQe2NVWaFRSYuf6eA9o+UHYl8ojdrONpHR0hCwf5GRpC81o265j?= =?iso-8859-15?Q?RWtfb/HB39gly6V5aLZQqDJDPP2GrUFNDX32Nf6Y1Pkf4DRZLGIQftcZ+?= =?iso-8859-15?Q?mTPwe5+582zIerOPTWasLXGgkKtVfiw3Qk9gxsEg/SeY3HVWRuYNA0=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1806; 6:96DcqVVKfrQ58prlMxLV64/ga34+5Bd2JO0AYCg/okhykZc7HXwoffOo9cEgoqbKWRgqiUXsMGmiy6S7WtJOKIMjm9yJWO3QG4bYOR4JP6QMfgtZNy2CR/88Xc7Myr+CUuR2Dp7eoiu9Hq9s1yHPVzR4bvAt1eeXGLbhaWdLHrC+ST0KzqgP5BU+ae9Eq+gQoOht5iTNCFfRGmu1DRc0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ly0Ehz7gBxJmrtrm1CIWPNoQ2K/5l09yUQr2eqvz7UbmfGvjQlBdM3QjdZ2u0OedpTdq5muuBYT6D6fEvLiiWxRvUgWhicHhfiTYOnq8yc/KXpo77XCpN5f+TIFHxMmcZZvZf3G+zOqvwygmvk=; 23:/SZR2DZNxLPToTtKxyV/ipfcHBkrRl0NcrsVnSQkVz3Fd776qaaK4s+A/2jc6DwlplcHpDxsX5sql4BmNxIrJbaAZNaXeYJA3pL4uc/Pfc1fwPpwezMncYK1vpBlITpcNQwrikK5KxtSiRwOzto6JA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 19:44:58.5607 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1806 X-OriginatorOrg: openvz.org X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.0.94 Subject: Re: [Qemu-devel] [PATCH 1/1] block: add missed BDRV_O_NOCACHE when block device is opened without file 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: Kevin Wolf , John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" On 01/25/2017 08:59 PM, Max Reitz wrote: > [CC-ing John] > > On 25.01.2017 17:42, Denis V. Lunev wrote: >> Technically there is a problem when the guest DVD is created by libvirt >> with AIO mode 'native' on Linux. Current QEMU is unable to start the >> domain configured as follows: >> >> >> >> >> >> The problem comes from the combination of 'cache' and 'io' options. >> >> 'io' option is common option and it is removed from block driver >> specific options. 'cache' originally is not. The patch makes 'cache' >> option common. This works fine as long as cdrom media insertion >> later on. >> >> Signed-off-by: Denis V. Lunev >> CC: Kevin Wolf >> CC: Max Reitz >> --- >> blockdev.c | 18 +++++++++++++++--- >> 1 file changed, 15 insertions(+), 3 deletions(-) > There was a Red Hat BZ for this: > > https://bugzilla.redhat.com/show_bug.cgi?id=1342999 > > There is now a corresponding BZ for libvirt: > > https://bugzilla.redhat.com/show_bug.cgi?id=1377321 > > The gist is that it was determined to be a problem with libvirt. > > RHEL has a downstream commit to work around this issue by ignoring the > cache mode set for empty CD-ROMs -- but that is only because that was > simpler than fixing libvirt. > > (Note that it's ignoring the cache mode instead of actually evaluating it.) > This is what I have exactly started from: http://ftp.redhat.com/pub/redhat/linux/enterprise/7Server/en/RHEV/SRPMS/qemu-kvm-rhev-2.6.0-27.el7.src.rpm This package starts VM well for the above mentioned configuration: but the problem comes later at 'change' moment. It reports 'Details: internal error: unable to execute QEMU command 'change': aio=native was specified, but it requires cache.direct=on, which was not specified.)' Thus partial solution implemented by the RedHat is really partial and does not work at the second stage. I have started from blk_rs->read_only = !(bdrv_flags & BDRV_O_RDWR); The problem for us is that we have such previously valid configurations in the field. >> May be this has already discussed, but still. AIO=native for CDROM without >> media seems important case. > First, I personally don't find aio=native very important for CD-ROM > drives. Yes, we shouldn't make IDE CD-ROM slower than necessary, but I > don't think aio=native will make the difference between "Slow like > CD-ROMs are in reality" and "As fast as virtio". the problem for me is that each clone() call is costly and counts. That is why we are trying to avoid it whenever possible. That is why 'native' mode is MUCH better. Also it would be very nice not to use cached IO, which is very good for memory overcommit situations. Here I am fighting not with the performance, which does not make any real sense, but with a memory footprint. > Second, all this patch does is revert some changes done by commit > 91a097e7478940483e76d52217f05bc05b98d5a5, which was very deliberate. > > Third, you may then be asking for the recommended way to put an > aio=native medium into a CD-ROM drive. Good thing you ask, because we > have a way that we want to recommend but can't because it's still > considered experimental: > > The BDS is added using blockdev-add, with all of the appropriate caching > and aio options. Then it's inserted into the drive using the > x-blockdev-insert-medium command, and the drive is closed using > blockdev-close-tray. the problem, again, is that with x-blockdev-insert-medium I can not deal with block driver options, or may be I am missing something. > There are a couple of issues with this: First, blockdev-add and > x-blockdev-insert-medium are still experimental. The good news are that > I think the reason why the latter is experimental has actually > disappeared and we can just drop the x- by now. The > not-so-good-but-not-so-bad-either news are that we plan to get > blockdev-add declared non-experimental for 2.9. Let's see how it goes. Does this mean that x-blockdev-del would also lose x- prefix? > The other issue is that of course it's more cumbersome to use than a > simple 'change' via HMP. I argue that if someone communicates with a VM > by hand, they either have to deal with this added complexity or they > cannot use aio=native for CD-ROM drives -- which, as I said, I don't > think is too bad. this is how 'virsh change-media' works at the moment, at least with latest downstreams. That is why this is not that clear. > However, there is a reason why you cannot set cache/aio for an empty > drive and it's simply that it doesn't make sense. > > Max > Thank you very much for the prompt answer. Den diff --git a/blockdev.c b/blockdev.c index d280dc4..e2c9053 100644 --- a/blockdev.c +++ b/blockdev.c @@ -608,6 +608,13 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, goto early_err; } + if (qdict_haskey(bs_opts, BDRV_OPT_CACHE_DIRECT)) { + bdrv_flags |= BDRV_O_NOCACHE; + } + if (qdict_haskey(bs_opts, BDRV_OPT_CACHE_NO_FLUSH)) { + bdrv_flags |= BDRV_O_NO_FLUSH; + } + blk_rs = blk_get_root_state(blk); blk_rs->open_flags = bdrv_flags;