From patchwork Thu Jan 12 15:52:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9513519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB5B2601E5 for ; Thu, 12 Jan 2017 16:02:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB6C2285EB for ; Thu, 12 Jan 2017 16:02:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCCDA286D3; Thu, 12 Jan 2017 16:02:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 760CB285EB for ; Thu, 12 Jan 2017 16:02:52 +0000 (UTC) Received: from localhost ([::1]:34840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRhpz-0001Ge-Jc for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 Jan 2017 11:02:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRhgi-00016c-US for qemu-devel@nongnu.org; Thu, 12 Jan 2017 10:53:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRhge-0001SZ-EN for qemu-devel@nongnu.org; Thu, 12 Jan 2017 10:53:17 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:35675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRhge-0001SQ-9E for qemu-devel@nongnu.org; Thu, 12 Jan 2017 10:53:12 -0500 Received: by mail-pf0-x241.google.com with SMTP id f144so4072537pfa.2 for ; Thu, 12 Jan 2017 07:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wsSew5cmGMHYdskTeOEBVgjERGqJjLBwHV6E4XUuwrg=; b=B0j5fsxYAT0VCHNnr3NwLAzM1TJ1BehzRNOmb5a68M3aO6sWAtRllkvRrBQszXEgWs 1qUSXxbHPowLDDkyc28G2rywGs3du+jMpJ+1a1r1vEkNoVE/qGPStqIZ56bY0OzF6jY1 Ekc3j0b8vOMKTcYmUmHKq4jPI297x1fWP8YjCyTAzzaBvxs8FN+Tcs5iHO1DKASu942I TgC0cVgvZydIlOR5KcAWqhW5dkhS0IGrsayqYbN/0qikcIQZJk9/OCOiIKnYJNeRiNQH 6rcDFGeZC8oLVCde/X7vhANrM3Tsp/jVXtetxU27Les5gh7muo24NHfbbgrNuzwJIm7T hyrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wsSew5cmGMHYdskTeOEBVgjERGqJjLBwHV6E4XUuwrg=; b=I6GeYY/4A/blxCZuSRAxSmtyx7D8XGLraHjAn2nELtj0lxD7ZfBpq877nWa74boiPn yObICjKcV7Cuw2rlXhbpJN++Z/RIeL9Lstc2KfzxcfbY3oqEJDIfNNu6kMmHzZeFcj42 viwNv+cRMpoo1CK9iYSOX/Y6x6C+4u+CM3I+kBD0rAWcWpB9Fflr/ztThd0xvTN9cgjQ vBWmuAEJnXfo9oFwtiZsn+BXvN5BdXHW3kalaqMgtGKZwt62qfxoLILHDS61qU7X4hPK p9Q+VBgJdP7UIp2jwXnJ0b3Y3Wx0spcIZ9Yc+hV/0keK588Lwn3eEI5Fk/eT72iLLEAr 4/Uw== X-Gm-Message-State: AIkVDXJhYtnLElKtsDDX+zP9UDWgDvc3NSOGWreEYuYZOSV6kzL4KojgsPK11ccQ7ujAqw== X-Received: by 10.84.150.129 with SMTP id h1mr1262698plh.9.1484236391451; Thu, 12 Jan 2017 07:53:11 -0800 (PST) Received: from linux.local ([27.251.197.196]) by smtp.gmail.com with ESMTPSA id u124sm22810900pgb.6.2017.01.12.07.53.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 07:53:10 -0800 (PST) From: Ashijeet Acharya To: dgilbert@redhat.com Date: Thu, 12 Jan 2017 21:22:34 +0530 Message-Id: <1484236354-9640-5-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1484236354-9640-1-git-send-email-ashijeetacharya@gmail.com> References: <1484236354-9640-1-git-send-email-ashijeetacharya@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH v5 4/4] migration: Fail migration blocker for --only-migratable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, quintela@redhat.com, qemu-devel@nongnu.org, mst@redhat.com, armbru@redhat.com, groug@kaod.org, aneesh.kumar@linux.vnet.ibm.com, Ashijeet Acharya , marcandre.lureau@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP migrate_add_blocker should rightly fail if the '--only-migratable' option was specified and the device in use should not be able to perform the action which results in an unmigratable VM. Make migrate_add_blocker return -EACCES in this case. Signed-off-by: Ashijeet Acharya --- migration/migration.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index cca820e..054048d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1113,6 +1113,14 @@ static GSList *migration_blockers; int migrate_add_blocker(Error *reason, Error **errp) { + if (only_migratable) { + error_propagate(errp, reason); + error_prepend(errp, "disallowing migration blocker " + "(--only_migratable) for: "); + error_free(reason); + return -EACCES; + } + if (migration_is_idle(NULL)) { migration_blockers = g_slist_prepend(migration_blockers, reason); return 0;