From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4LBv-0002XC-HY for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:41:11 -0400 Received: from [140.186.70.92] (port=48232 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4LBu-0002WR-18 for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4LBs-0008KW-B7 for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:41:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11962) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4LBs-0008KJ-26 for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:41:08 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3KLf7Jh022781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Apr 2010 17:41:07 -0400 From: Juan Quintela In-Reply-To: <1271797792-24571-1-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Tue, 20 Apr 2010 18:09:30 -0300") References: <1271797792-24571-1-git-send-email-lcapitulino@redhat.com> Date: Tue, 20 Apr 2010 23:41:05 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [RFC 00/22]: QMP: Convert savevm/loadvm/delvm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com Luiz Capitulino wrote: > Hi there, > > Libvirt has a new snapshot API which uses savevm, loadvm and delvm, so we > need to convert them to QMP. > > I thought this wouldn't be difficult, but while doing and testing this work > I hit a number of problems and had to made not so easy decisions. > > Most of the time, the problem is that the handler implementation is not > as consistent as it should be. Usually, this doesn't affect users very much > but the headache begins when you have to make this available under QMP. > > Here goes a list of macro issues/decisions. Details (and other small problems) > in the patches. > > 1. Multiple failures: do_delvm() and do_savevm() report errors in a > QTAILQ_FOREACH() loop and they don't return when an error happens. > > Although QMP will end up reporting only the first error, this is > considered a bug because handlers are not expected to continue > executing when an error happens. I haven't looked at all the error cases, but I think that part of the problem are devices like cdrom, that are by definition _non_ snapshotable (what an ugly word). > There are two solutions: > > 1) Return right away in the first error > 2) Identify fatal errors and only report those > > I don't know the implications of doing 1) and don't know how to > to do 2) (although do_loadvm() works this way). > > Can someone from the block layer help here? Use case: We want to save snapshot foo. It can be: - snapshot foo already exist in some device. What to do: - just fail and ask the user for other name - overwrite the name on the devices that already have it - any other good idea? if we just fail the save, then we tell the user: devices bar1 and bar2 already have that snapshot name. What to do? - force the user to use a different name (not such a bad idea) - ask the user to stop the vm and remove the snaphost from the ofended devices with qemu-img. High avalavility people don't like to be forced to stop machines. - delvm just ignore the devices that don't have the snapshot name (basically what we have now) - we add a delvm_force or del_device_vm operations.\ - any other great idea? Except where commented, I like the rest of the patches. The loadvm is a change that I don't agree with. The StateVM name is something that I can live with. Thanks, Juan.