Projects
Eulaceura:Factory
libvirt
_service:obs_scm:hotpatch-introduce-hotpatch-as...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:hotpatch-introduce-hotpatch-async-job-flag.patch of Package libvirt
From 180e19162083fb74e9e9cbc676ce42611bb2e496 Mon Sep 17 00:00:00 2001 From: AlexChen <alex.chen@huawei.com> Date: Tue, 19 Oct 2021 22:41:24 +0800 Subject: [PATCH] hotpatch: introduce hotpatch async job flag Signed-off-by: Hao Wang <wanghao232@huawei.com> Signed-off-by: Bihong Yu <yubihong@huawei.com> Signed-off-by: AlexChen <alex.chen@huawei.com> --- include/libvirt/libvirt-domain.h | 1 + src/conf/virdomainjob.c | 1 + src/conf/virdomainjob.h | 1 + src/qemu/qemu_domainjob.c | 2 ++ src/qemu/qemu_driver.c | 14 +++++++++++++- src/qemu/qemu_migration.c | 2 ++ src/qemu/qemu_process.c | 1 + tools/virsh-domain.c | 1 + 8 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index e786ecfab2..96e62deac3 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -4201,6 +4201,7 @@ typedef enum { VIR_DOMAIN_JOB_OPERATION_DUMP = 8, /* (Since: 3.3.0) */ VIR_DOMAIN_JOB_OPERATION_BACKUP = 9, /* (Since: 6.0.0) */ VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_DELETE = 10, /* (Since: 9.0.0) */ + VIR_DOMAIN_JOB_OPERATION_HOTPATCH = 11, /* (Since: 6.2.0) */ # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_JOB_OPERATION_LAST /* (Since: 3.3.0) */ diff --git a/src/conf/virdomainjob.c b/src/conf/virdomainjob.c index 38f08f1d18..d21fc653a0 100644 --- a/src/conf/virdomainjob.c +++ b/src/conf/virdomainjob.c @@ -51,6 +51,7 @@ VIR_ENUM_IMPL(virDomainAsyncJob, "snapshot", "start", "backup", + "hotpatch", ); virDomainJobData * diff --git a/src/conf/virdomainjob.h b/src/conf/virdomainjob.h index 0d62bab287..d0f632edad 100644 --- a/src/conf/virdomainjob.h +++ b/src/conf/virdomainjob.h @@ -75,6 +75,7 @@ typedef enum { VIR_ASYNC_JOB_SNAPSHOT, VIR_ASYNC_JOB_START, VIR_ASYNC_JOB_BACKUP, + VIR_ASYNC_JOB_HOTPATCH, VIR_ASYNC_JOB_LAST } virDomainAsyncJob; diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 245e51f14b..c9753c4f2b 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -56,6 +56,7 @@ qemuDomainAsyncJobPhaseToString(virDomainAsyncJob job, case VIR_ASYNC_JOB_START: case VIR_ASYNC_JOB_NONE: case VIR_ASYNC_JOB_BACKUP: + case VIR_ASYNC_JOB_HOTPATCH: G_GNUC_FALLTHROUGH; case VIR_ASYNC_JOB_LAST: break; @@ -82,6 +83,7 @@ qemuDomainAsyncJobPhaseFromString(virDomainAsyncJob job, case VIR_ASYNC_JOB_START: case VIR_ASYNC_JOB_NONE: case VIR_ASYNC_JOB_BACKUP: + case VIR_ASYNC_JOB_HOTPATCH: G_GNUC_FALLTHROUGH; case VIR_ASYNC_JOB_LAST: break; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3dd82d6f12..31917ef591 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12251,6 +12251,8 @@ qemuDomainAbortJobFlags(virDomainPtr dom, qemuBackupJobCancelBlockjobs(vm, priv->backup, true, VIR_ASYNC_JOB_NONE); ret = 0; break; + case VIR_ASYNC_JOB_HOTPATCH: + break; case VIR_ASYNC_JOB_LAST: default: @@ -19942,7 +19944,8 @@ qemuDomainHotpatchManage(virDomainPtr domain, const char *id, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; + virQEMUDriver *driver = domain->conn->privateData; char *ret = NULL; size_t len; @@ -19951,6 +19954,12 @@ qemuDomainHotpatchManage(virDomainPtr domain, if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; + if (VirDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_HOTPATCH, + VIR_DOMAIN_JOB_OPERATION_HOTPATCH, 0) < 0) + goto cleanup; + + qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_DEFAULT_MASK); + switch (action) { case VIR_DOMAIN_HOTPATCH_APPLY: ret = qemuDomainHotpatchApply(vm, patch); @@ -19977,6 +19986,9 @@ qemuDomainHotpatchManage(virDomainPtr domain, if (len > 0) ret[len - 1] = '\0'; + endjob: + qemuDomainObjEndAsyncJob(driver, vm); + cleanup: virDomainObjEndAPI(&vm); return ret; diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index f9c34b72e8..73395ce3b2 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1846,6 +1846,8 @@ qemuMigrationJobName(virDomainObj *vm) return _("start"); case VIR_ASYNC_JOB_BACKUP: return _("backup"); + case VIR_ASYNC_JOB_HOTPATCH: + return _("hotpatch job"); case VIR_ASYNC_JOB_NONE: case VIR_ASYNC_JOB_LAST: default: diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index fc05b4b24f..318f9f6182 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3758,6 +3758,7 @@ qemuProcessRecoverJob(virQEMUDriver *driver, JOB_MASK(VIR_JOB_MODIFY))); break; + case VIR_ASYNC_JOB_HOTPATCH: case VIR_ASYNC_JOB_NONE: case VIR_ASYNC_JOB_LAST: break; diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 66f933dead..9d22e219f7 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6152,6 +6152,7 @@ VIR_ENUM_IMPL(virshDomainJobOperation, N_("Dump"), N_("Backup"), N_("Snapshot delete"), + N_("Hotpatch"), ); static const char * -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2