From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGsyG-0006mS-3O for qemu-devel@nongnu.org; Wed, 06 Jan 2016 13:38:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGsyC-0004hs-Tk for qemu-devel@nongnu.org; Wed, 06 Jan 2016 13:38:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGsyC-0004hF-Oy for qemu-devel@nongnu.org; Wed, 06 Jan 2016 13:38:04 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A972BF5DC3 for ; Wed, 6 Jan 2016 18:38:03 +0000 (UTC) Date: Thu, 7 Jan 2016 00:07:54 +0530 (IST) From: P J P In-Reply-To: <81110f82ab57277a4200d66da5c6d438f61aef93.1452076543.git.mprivozn@redhat.com> Message-ID: References: <81110f82ab57277a4200d66da5c6d438f61aef93.1452076543.git.mprivozn@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH] virtio-blk: Allow startup of empty cdroms List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michal Privoznik Cc: qemu-devel@nongnu.org +-- On Wed, 6 Jan 2016, Michal Privoznik wrote --+ | } | - if (!blk_is_inserted(conf->conf.blk)) { | + | + dinfo = blk_legacy_dinfo(conf->conf.blk); | + if (!((dinfo && dinfo->media_cd) || | + blk_is_inserted(conf->conf.blk))) { | error_setg(errp, "Device needs media, but drive is empty"); | return; | } The if expression seems little confusing; Maybe -> if (dinfo && !dinfo->media_cd && !blk_is_inserted(conf->conf.blk)) -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F