mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
Add virDomainAbortJobFlags public API
The original virDomainAbortJob did not support flags. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
cf3842ef08
commit
57762f8527
@ -4099,6 +4099,9 @@ int virDomainGetJobStats(virDomainPtr domain,
|
||||
unsigned int flags);
|
||||
int virDomainAbortJob(virDomainPtr dom);
|
||||
|
||||
int virDomainAbortJobFlags(virDomainPtr dom,
|
||||
unsigned int flags);
|
||||
|
||||
/**
|
||||
* virDomainJobOperation:
|
||||
*
|
||||
|
@ -746,6 +746,10 @@ typedef int
|
||||
typedef int
|
||||
(*virDrvDomainAbortJob)(virDomainPtr domain);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainAbortJobFlags)(virDomainPtr domain,
|
||||
unsigned int flags);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainMigrateGetMaxDowntime)(virDomainPtr domain,
|
||||
unsigned long long *downtime,
|
||||
@ -1590,6 +1594,7 @@ struct _virHypervisorDriver {
|
||||
virDrvDomainGetJobInfo domainGetJobInfo;
|
||||
virDrvDomainGetJobStats domainGetJobStats;
|
||||
virDrvDomainAbortJob domainAbortJob;
|
||||
virDrvDomainAbortJobFlags domainAbortJobFlags;
|
||||
virDrvDomainMigrateGetMaxDowntime domainMigrateGetMaxDowntime;
|
||||
virDrvDomainMigrateSetMaxDowntime domainMigrateSetMaxDowntime;
|
||||
virDrvDomainMigrateGetCompressionCache domainMigrateGetCompressionCache;
|
||||
|
@ -9470,6 +9470,51 @@ virDomainAbortJob(virDomainPtr domain)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virDomainAbortJobFlags:
|
||||
* @domain: a domain object
|
||||
* @flags: extra flags; not used yet, callers should always pass 0
|
||||
*
|
||||
* Requests that the current background job be aborted at the
|
||||
* soonest opportunity. In case the job is a migration in a post-copy mode,
|
||||
* this function will report an error (see virDomainMigrateStartPostCopy for
|
||||
* more details).
|
||||
*
|
||||
* Returns 0 in case of success and -1 in case of failure.
|
||||
*
|
||||
* Since: 8.5.0
|
||||
*/
|
||||
int
|
||||
virDomainAbortJobFlags(virDomainPtr domain,
|
||||
unsigned int flags)
|
||||
{
|
||||
virConnectPtr conn;
|
||||
|
||||
VIR_DOMAIN_DEBUG(domain);
|
||||
|
||||
virResetLastError();
|
||||
|
||||
virCheckDomainReturn(domain, -1);
|
||||
conn = domain->conn;
|
||||
|
||||
virCheckReadOnlyGoto(conn->flags, error);
|
||||
|
||||
if (conn->driver->domainAbortJobFlags) {
|
||||
int ret;
|
||||
ret = conn->driver->domainAbortJobFlags(domain, flags);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
return ret;
|
||||
}
|
||||
|
||||
virReportUnsupportedError();
|
||||
|
||||
error:
|
||||
virDispatchError(conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virDomainMigrateSetMaxDowntime:
|
||||
* @domain: a domain object
|
||||
|
@ -922,4 +922,9 @@ LIBVIRT_8.4.0 {
|
||||
virDomainRestoreParams;
|
||||
} LIBVIRT_8.0.0;
|
||||
|
||||
LIBVIRT_8.5.0 {
|
||||
global:
|
||||
virDomainAbortJobFlags;
|
||||
} LIBVIRT_8.4.0;
|
||||
|
||||
# .... define new API here using predicted next version number ....
|
||||
|
@ -8534,6 +8534,7 @@ static virHypervisorDriver hypervisor_driver = {
|
||||
.domainGetJobInfo = remoteDomainGetJobInfo, /* 0.7.7 */
|
||||
.domainGetJobStats = remoteDomainGetJobStats, /* 1.0.3 */
|
||||
.domainAbortJob = remoteDomainAbortJob, /* 0.7.7 */
|
||||
.domainAbortJobFlags = remoteDomainAbortJobFlags, /* 8.5.0 */
|
||||
.domainMigrateGetMaxDowntime = remoteDomainMigrateGetMaxDowntime, /* 3.7.0 */
|
||||
.domainMigrateSetMaxDowntime = remoteDomainMigrateSetMaxDowntime, /* 0.8.0 */
|
||||
.domainMigrateGetCompressionCache = remoteDomainMigrateGetCompressionCache, /* 1.0.3 */
|
||||
|
@ -2492,6 +2492,12 @@ struct remote_domain_abort_job_args {
|
||||
};
|
||||
|
||||
|
||||
struct remote_domain_abort_job_flags_args {
|
||||
remote_nonnull_domain dom;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
|
||||
struct remote_domain_migrate_get_max_downtime_args {
|
||||
remote_nonnull_domain dom;
|
||||
unsigned int flags;
|
||||
@ -6947,5 +6953,11 @@ enum remote_procedure {
|
||||
* @acl: domain:start
|
||||
* @acl: domain:write
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_RESTORE_PARAMS = 441
|
||||
REMOTE_PROC_DOMAIN_RESTORE_PARAMS = 441,
|
||||
|
||||
/**
|
||||
* @generate: both
|
||||
* @acl: domain:write
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_ABORT_JOB_FLAGS = 442
|
||||
};
|
||||
|
@ -1869,6 +1869,10 @@ struct remote_domain_get_job_stats_ret {
|
||||
struct remote_domain_abort_job_args {
|
||||
remote_nonnull_domain dom;
|
||||
};
|
||||
struct remote_domain_abort_job_flags_args {
|
||||
remote_nonnull_domain dom;
|
||||
u_int flags;
|
||||
};
|
||||
struct remote_domain_migrate_get_max_downtime_args {
|
||||
remote_nonnull_domain dom;
|
||||
u_int flags;
|
||||
@ -3706,4 +3710,5 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_SET_LAUNCH_SECURITY_STATE = 439,
|
||||
REMOTE_PROC_DOMAIN_SAVE_PARAMS = 440,
|
||||
REMOTE_PROC_DOMAIN_RESTORE_PARAMS = 441,
|
||||
REMOTE_PROC_DOMAIN_ABORT_JOB_FLAGS = 442,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user