From patchwork Thu Apr 28 21:20:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Fehlig X-Patchwork-Id: 8975051 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69AFE9F1D3 for ; Thu, 28 Apr 2016 21:26:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C348201E4 for ; Thu, 28 Apr 2016 21:26:15 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id BF6A120166 for ; Thu, 28 Apr 2016 21:26:14 +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 1avtPa-00045z-Jv; Thu, 28 Apr 2016 21:23:50 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avtPY-00045t-OW for xen-devel@lists.xen.org; Thu, 28 Apr 2016 21:23:48 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 28/F4-09532-46F72275; Thu, 28 Apr 2016 21:23:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrALMWRWlGSWpSXmKPExsXS6fijRje5Xin c4FGDhMWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmvF923XGgkm8FS/+1zYwbuTqYuTiEBLoYpT4 NqWdvYuRk4NNQFniZectVhBbREBa4trny4wgNrNAsMTCX5vYQGxhATeJcx+PgdksAqoSV++eB LN5BewlZj5cCTZHQkBB4vS7uywTGDkWMDKsYlQvTi0qSy3SNdJLKspMzyjJTczM0TU0MNPLTS 0uTkxPzUlMKtZLzs/dxAj0CQMQ7GBc9tfpEKMkB5OSKO/BVKVwIb6k/JTKjMTijPii0pzU4kO MMhwcShK84XVAOcGi1PTUirTMHGBwwKQlOHiURHjv1gKleYsLEnOLM9MhUqcYFaXEeW1B+gRA EhmleXBtsIC8xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJWFeP5ApPJl5JXDTXwEtZgJaLLBJE WRxSSJCSqqBMeslg5BXYO+JtPTfdj6iabdufpSsTC3Vb6qe4xzILb0nSiL26c4zuqtqel2F1t hp7/+31mdP5P1zX62UFry/GHL12LW3t8uuW75KtJr70/P1l5cRs4MnTP568fIRlbbDb0QeN1o xmD/tn8K5iUlcMDXrxstHj3wN/5s+/innZplYtYwrfd/SZCWW4oxEQy3mouJEAGBGiwRDAgAA X-Env-Sender: jfehlig@suse.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1461878623!11916594!1 X-Originating-IP: [137.65.248.124] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21835 invoked from network); 28 Apr 2016 21:23:47 -0000 Received: from inet-orm.provo.novell.com (HELO mail.novell.com) (137.65.248.124) by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Apr 2016 21:23:47 -0000 Received: from jfehlig1.provo.novell.com ([137.65.135.33]) by mail.novell.com with ESMTP (NOT encrypted); Thu, 28 Apr 2016 15:23:30 -0600 From: Jim Fehlig To: xen-devel@lists.xen.org Date: Thu, 28 Apr 2016 15:20:46 -0600 Message-Id: <1461878446-7676-1-git-send-email-jfehlig@suse.com> X-Mailer: git-send-email 1.8.0.1 Cc: wei.liu2@citrix.com, Jim Fehlig , ian.jackson@eu.citrix.com Subject: [Xen-devel] [PATCH V2] libxl: don't add cache mode for qdisk cdrom drives 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP qemu commit 91a097e7 forbids specifying cache mode for empty drives. Attempting to create a domain with an empty qdisk cdrom drive results in qemu-system-x86_64: -drive if=ide,index=1,readonly=on,media=cdrom, cache=writeback,id=ide-832: Must specify either driver or file libxl only allows an empty 'target=' for cdroms. By default, cdroms are readonly (see the 'access' parameter in xl-disk-configuration.txt) and forced to readonly by any tools (e.g. xl) using libxlutil's xlu_disk_parse() function. With cdroms always marked readonly, explicitly specifying the cache mode for cdrom drives can be dropped. The drive's 'readonly=on' option can also be set unconditionally. Signed-off-by: Jim Fehlig --- V2: Drop explicitly setting cache mode since cdrom devices are readonly. Unconditionally add 'readonly=on' drive option for cdroms. tools/libxl/libxl_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index fd12844..959e292 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1368,8 +1368,8 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, if (disks[i].is_cdrom) { drive = libxl__sprintf(gc, - "if=ide,index=%d,readonly=%s,media=cdrom,cache=writeback,id=ide-%i", - disk, disks[i].readwrite ? "off" : "on", dev_number); + "if=ide,index=%d,readonly=on,media=cdrom,id=ide-%i", + disk, dev_number); if (target_path) drive = libxl__sprintf(gc, "%s,file=%s,format=%s",