From nobody Mon Feb 9 10:32:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 162929629066233.5733190269176; Wed, 18 Aug 2021 07:18:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-5uF-hGK6NvmOAUnrRqzgmw-1; Wed, 18 Aug 2021 10:18:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E7B992502; Wed, 18 Aug 2021 14:17:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFFF75C1A3; Wed, 18 Aug 2021 14:17:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B95D2182188C; Wed, 18 Aug 2021 14:17:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17IEHnGZ008888 for ; Wed, 18 Aug 2021 10:17:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2801F2077FDC; Wed, 18 Aug 2021 14:17:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 22A262077FDE for ; Wed, 18 Aug 2021 14:17:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68D5E1801386 for ; Wed, 18 Aug 2021 14:17:46 +0000 (UTC) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-89-1r56qy5bNM--tGm4qeoSxA-1; Wed, 18 Aug 2021 10:17:44 -0400 Received: by mail-pg1-f182.google.com with SMTP id k14so2384464pga.13 for ; Wed, 18 Aug 2021 07:17:43 -0700 (PDT) Received: from localhost ([38.94.109.214]) by smtp.gmail.com with ESMTPSA id z13sm5311950pjd.44.2021.08.18.07.17.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 07:17:42 -0700 (PDT) X-MC-Unique: 5uF-hGK6NvmOAUnrRqzgmw-1 X-MC-Unique: 1r56qy5bNM--tGm4qeoSxA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tlY/hZgD+O2e5/fmu+JBdH3G/XSzdRjWjJFqNixJLVc=; b=JgzdF8+KGCgWAzAs18aWjTNZk9J2wiu08XCv81d6B+P5UVh3NDaosTlDHL+CT6/5dQ 1KcWhYLdEvy0jvOi4/KVX4LLwVyCj0Ut8uCNCH5GYDkqH6fJOnSyGSEfRlEhOEZ6NVHV dDa+jtAkhiloJBXVw2TMjjEdSmpNG7H2hIZCV+CSkfZ4GBZgJQoPJohXaBcSpy10gzWd cilIA1f1I7uoSWEWyvuzL6m0bDKSs4Tr+j1bStPZS/fDqKFQcc2tW7tpcGcScES6pa4R Jne+h+2JI8hkXKl1Jvw7OAjGGklGL5w/giFIIN7c7McT4e5msn8yaiK/cUJykz+NNTSN 0x9A== X-Gm-Message-State: AOAM530j+vIBraqNL4+/OJszLdn2JdLyP2tCOroJsRUyMy9rU7XT68mU bRaHQ4JzwdyZaro3LnHQvyCOw9Ol+pyL9JMGXMA= X-Google-Smtp-Source: ABdhPJyYGg6fv8JPG9Ew1k8OaVHH383T8DsLWZDsbwGHLXUnhdgE/9KB0QNpgGyuLnJCnJzEbIgRYQ== X-Received: by 2002:a65:508a:: with SMTP id r10mr9173199pgp.96.1629296262544; Wed, 18 Aug 2021 07:17:42 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v3 3/5] test_driver: Implement virDomainAbortJob Date: Wed, 18 Aug 2021 22:17:27 +0800 Message-Id: <20210818141729.191578-4-lukedyue@gmail.com> In-Reply-To: <20210818141729.191578-1-lukedyue@gmail.com> References: <20210818141729.191578-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1629296292823100003 Content-Type: text/plain; charset="utf-8" As we are using jobState to store dummy job type, so just change it to VIR_DOMAIN_JOB_CANCELLED when try to abort a job. Signed-off-by: Luke Yue --- src/test/test_driver.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 9899976966..35350edda9 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2889,6 +2889,34 @@ testDomainGetJobStats(virDomainPtr domain, return ret; } =20 +static int +testDomainAbortJob(virDomainPtr dom) +{ + virDomainObj *vm; + int ret =3D -1; + testDomainObjPrivate *priv; + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainObjCheckActive(vm) < 0) + goto cleanup; + + priv =3D vm->privateData; + + if (priv->jobState =3D=3D VIR_DOMAIN_JOB_NONE) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("no job is active on the domain")); + } else { + priv->jobState =3D VIR_DOMAIN_JOB_CANCELLED; + ret =3D 0; + } + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + static int testDomainGetLaunchSecurityInfo(virDomainPtr domain G_GNUC_UNUSED, virTypedParameterPtr *params G_GNUC_UNUSED, @@ -9792,6 +9820,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainSetLifecycleAction =3D testDomainSetLifecycleAction, /* 5.7.0 */ .domainGetJobInfo =3D testDomainGetJobInfo, /* 7.7.0 */ .domainGetJobStats =3D testDomainGetJobStats, /* 7.7.0 */ + .domainAbortJob =3D testDomainAbortJob, /* 7.7.0 */ =20 .domainSnapshotNum =3D testDomainSnapshotNum, /* 1.1.4 */ .domainSnapshotListNames =3D testDomainSnapshotListNames, /* 1.1.4 */ --=20 2.32.0