From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2 13/18] libxl: make libxl_cd_insert "eject" + "insert" Date: Wed, 27 Aug 2014 03:04:46 +0100 Message-ID: <1409105086.28009.76.camel@citrix.com> References: <1406744639-28782-1-git-send-email-wei.liu2@citrix.com> <1406744639-28782-14-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406744639-28782-14-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-07-30 at 19:23 +0100, Wei Liu wrote: > A "cdrom insert" is always processed as "eject" + "insert", with JSON > config updated in between. So that we can know the correct state of > CDROM later when we try to retrieve domain configuration: if xenstore is > "empty", then CDROM is "empty"; otherwise use the information presented > in JSON. When you say "empty" do you mean literally that the xenstore nodes do not exist or that one of them contains the string "empty"? If, as I suspect, you mean the former then writing if xenstore nodes are not present then CDROM is "empty" would confuse me less. > + rc = libxl__cdrom_insert(ctx, domid, &empty, NULL); > + if (rc) > + goto out; > + > + /* Optimisation: don't insert empty disk twice, and skip > + * manipulating JSON. */ Do we not need to update the JSON in this case to reflect that it is now empty? Ian/