From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E4FDC433ED for ; Fri, 16 Apr 2021 16:04:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8EF0611C2 for ; Fri, 16 Apr 2021 16:04:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8EF0611C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXQxf-0007ga-Vw for qemu-devel@archiver.kernel.org; Fri, 16 Apr 2021 12:04:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXQjz-0003qt-TZ for qemu-devel@nongnu.org; Fri, 16 Apr 2021 11:50:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXQjw-0000fc-3v for qemu-devel@nongnu.org; Fri, 16 Apr 2021 11:50:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618588238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iIYnna/LDMNW3KvRq2hk7iXZEnHUkA5+xN/dTfEW8VQ=; b=jMGbVcrqRCrVOwjhCYW2thBVm+OCpmIwnCQmNBcDrf9eVfR2xUrAUN/Bf6jbBMtkNMYJwW EbiVhdwB8/RO56QmHFN0TeKicMabIasy9L5UV5ArzcHsutNgNXxOnCDrz5iOSGBOfXa0lA nSYA6Xe//ka+rdX0kpRICZp7MkPt5ik= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-10-WNbIhYIzNgCoMzHlL67R3A-1; Fri, 16 Apr 2021 11:50:37 -0400 X-MC-Unique: WNbIhYIzNgCoMzHlL67R3A-1 Received: by mail-vk1-f197.google.com with SMTP id k186-20020a1fa1c30000b02901deb88f03ecso2694569vke.11 for ; Fri, 16 Apr 2021 08:50:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iIYnna/LDMNW3KvRq2hk7iXZEnHUkA5+xN/dTfEW8VQ=; b=YbAJ5CSfk8lkroKTItfo97Clh0RDamd65WLKdKviyVsnksOQgKQiLnY4cVAeHc5tQs PaL2LouAbw3y+pXQUtPHyn3E+iS6PRXpLLFSazvHhpXCZBL7a+sj0DezFkD7Ti5oj/G5 nbwN164lIWni8gaKZ2krIiWaEqKPMowW2Skz8jl7AGQxgvi0+OP5WCG35JWUufbv2Scy LqUJf9RSsjt7toqDpoC1n9yLa7wn6he+YhmBvxcOAuaDpCSduSgMznWU8yaLZi091N/a DchAZ4A0uPLZEkhf0sTUHYH3JgyCIFEtkyING4uOeFFY7aVD5lY1/KoFH1pAyYhMbZGi OxQA== X-Gm-Message-State: AOAM533M+EM1SE7o/QDzKWrmUBIpeFf24y9QkLlsaa7j8twOYvG9O8P5 yeL3bm6vuWWnmcrBs/pOO3Kh60tL1ILQBmGN3QyccOwJZZzXCqFN8ZKO5ly+XII4gs5JNAYSUMw Z2M9Rc8e8sFAqrdqFdGz7iwf80iyadgs= X-Received: by 2002:a67:1744:: with SMTP id 65mr7361344vsx.50.1618588236912; Fri, 16 Apr 2021 08:50:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzthsuKcqfQCuKYaGW8N4cWIF9NVRhd9dFnX2lFbjIPnM6acW7yFdqcInH9vrPCw7qvYLMm9n8rgbJPLNeTs9c= X-Received: by 2002:a67:1744:: with SMTP id 65mr7361329vsx.50.1618588236773; Fri, 16 Apr 2021 08:50:36 -0700 (PDT) MIME-Version: 1.0 References: <20210415215141.1865467-1-crosa@redhat.com> <20210415215141.1865467-5-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-5-crosa@redhat.com> From: Willian Rampazzo Date: Fri, 16 Apr 2021 12:50:11 -0300 Message-ID: Subject: Re: [PATCH 4/8] tests/acceptance/migration.py: cancel test if migration is not supported To: Cleber Rosa Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=wrampazz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=170.10.133.124; envelope-from=wrampazz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , Cornelia Huck , qemu-devel , Wainer dos Santos Moschetta , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , Auger Eric , "open list:S390 Virtio-ccw" , Thomas Huth , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Thu, Apr 15, 2021 at 6:52 PM Cleber Rosa wrote: > > FIXME: check if there's a way to query migration support before > actually requesting migration. > > Some targets/machines contain devices that do not support migration. > Let's acknowledge that and cancel the test as early as possible. > > Signed-off-by: Cleber Rosa > --- > tests/acceptance/migration.py | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py > index 792639cb69..25ee55f36a 100644 > --- a/tests/acceptance/migration.py > +++ b/tests/acceptance/migration.py > @@ -53,7 +53,11 @@ def do_migrate(self, dest_uri, src_uri=None): > source_vm = self.get_vm() > source_vm.add_args('-nodefaults') > source_vm.launch() > - source_vm.qmp('migrate', uri=src_uri) > + response = source_vm.qmp('migrate', uri=src_uri) > + if 'error' in response: > + if 'desc' in response['error']: > + msg = response['error']['desc'] > + self.cancel('Migration does not seem to be supported: %s' % msg) I agree with Phil that a generic function would be reusable when needed, but as it is not needed yet, this looks good to me: Reviewed-by: Willian Rampazzo