From patchwork Wed Apr 27 04:35:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Fehlig X-Patchwork-Id: 8952691 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 721199F372 for ; Wed, 27 Apr 2016 04:37:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1FA9201FE for ; Wed, 27 Apr 2016 04:37:42 +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 C441F201EF for ; Wed, 27 Apr 2016 04:37:41 +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 1avHCY-0005SH-Ai; Wed, 27 Apr 2016 04:35:50 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avHCX-0005S9-EI for xen-devel@lists.xen.org; Wed, 27 Apr 2016 04:35:49 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id BE/38-19343-4A140275; Wed, 27 Apr 2016 04:35:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrELMWRWlGSWpSXmKPExsXS6fgrUHeJo0K 4Qdt1HoslHxezODB6HN39mymAMYo1My8pvyKBNWPN5qUsBXe5Kn43fWdvYHzH3sXIxSEksIVR YsqjB6xdjJwcbALKEi87b4HZIgLSEtc+X2YEsZkFgiUW/trEBmILC9hKHFw2nx3EZhFQlZi89 D9YDa+AvcSXfx9ZQGwJATmJ88d/Mk9g5FjAyLCKUaM4tagstUjX0EAvqSgzPaMkNzEzB8gz1s tNLS5OTE/NSUwq1kvOz93ECPRLPQMD4w7GbV3OhxglOZiURHm/mCqEC/El5adUZiQWZ8QXlea kFh9ilOHgUJLg3eAAlBMsSk1PrUjLzAEGCExagoNHSYQ3ByTNW1yQmFucmQ6ROsWoKCXOOw8k IQCSyCjNg2uDBeUlRlkpYV5GBgYGIZ6C1KLczBJU+VeM4hyMSsK8K0Cm8GTmlcBNfwW0mAlo8 eVDsiCLSxIRUlINjIsyE5IsVSs4Pc1uq0ROZWjJWbkzyczmnZ8Fv8kfhsvM8hP8XsmctDzBOF vbIcFCfL2FoP7SW0cy5Pjnnb8Qv3LB2iMLn971/vSyqHZbVbMZl/VmbXXmyzsF376bcvdWAwM L296Yg5z9AZZ3UkSrLx3vqv/td2vmrtar+Rd6He84Hnhdaj7bQ4mlOCPRUIu5qDgRALXNv3dF AgAA X-Env-Sender: jfehlig@suse.com X-Msg-Ref: server-16.tower-31.messagelabs.com!1461731746!29573616!1 X-Originating-IP: [137.65.250.81] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 33391 invoked from network); 27 Apr 2016 04:35:47 -0000 Received: from smtp2.provo.novell.com (HELO smtp2.provo.novell.com) (137.65.250.81) by server-16.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 27 Apr 2016 04:35:47 -0000 Received: from talkeetna.gns.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Tue, 26 Apr 2016 22:35:42 -0600 From: Jim Fehlig To: xen-devel@lists.xen.org Date: Tue, 26 Apr 2016 22:35:31 -0600 Message-Id: <1461731731-6794-1-git-send-email-jfehlig@suse.com> X-Mailer: git-send-email 2.1.4 Cc: wei.liu2@citrix.com, Jim Fehlig , ian.jackson@eu.citrix.com Subject: [Xen-devel] [PATCH] libxl: don't add cache mode for empty 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 the cache mode for empty drives. Attempting to create a domain with an empty qdisk cdrom 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 Change libxl to only emit cache mode when a cdrom target is specified. Signed-off-by: Jim Fehlig --- 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..df1207b 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1368,11 +1368,11 @@ 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", + "if=ide,index=%d,readonly=%s,media=cdrom,id=ide-%i", disk, disks[i].readwrite ? "off" : "on", dev_number); if (target_path) - drive = libxl__sprintf(gc, "%s,file=%s,format=%s", + drive = libxl__sprintf(gc, "%s,file=%s,format=%s,cache=writeback", drive, target_path, format); } else { /*