mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: monitor: Refactor and fix monitor checking
Among all the monitor APIs some where checking if mon is NULL and some were not. Since it's possible to have mon equal to NULL in case a second call is attempted once entered the monitor. This requires that every single API checks for the monitor. This patch adds a macro that helps checking the state of the monitor and either refactors existing checking code to use the macro or adds it in case it was missing.
This commit is contained in:
parent
0c68ec7d78
commit
c44108522b
File diff suppressed because it is too large
Load Diff
@ -712,7 +712,7 @@ int qemuMonitorDiskSnapshot(qemuMonitorPtr mon,
|
||||
const char *format,
|
||||
bool reuse);
|
||||
int qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
int qemuMonitorDriveMirror(qemuMonitorPtr mon,
|
||||
const char *device,
|
||||
const char *file,
|
||||
@ -721,10 +721,10 @@ int qemuMonitorDriveMirror(qemuMonitorPtr mon,
|
||||
unsigned int granularity,
|
||||
unsigned long long buf_size,
|
||||
unsigned int flags)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
||||
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
||||
int qemuMonitorDrivePivot(qemuMonitorPtr mon,
|
||||
const char *device)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorBlockCommit(qemuMonitorPtr mon,
|
||||
const char *device,
|
||||
@ -732,15 +732,13 @@ int qemuMonitorBlockCommit(qemuMonitorPtr mon,
|
||||
const char *base,
|
||||
const char *backingName,
|
||||
unsigned long long bandwidth)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
||||
ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
|
||||
bool qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon);
|
||||
char *qemuMonitorDiskNameLookup(qemuMonitorPtr mon,
|
||||
const char *device,
|
||||
virStorageSourcePtr top,
|
||||
virStorageSourcePtr target)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
||||
ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
|
||||
|
||||
int qemuMonitorArbitraryCommand(qemuMonitorPtr mon,
|
||||
const char *cmd,
|
||||
@ -763,12 +761,12 @@ int qemuMonitorBlockStream(qemuMonitorPtr mon,
|
||||
const char *backingName,
|
||||
unsigned long long bandwidth,
|
||||
bool modern)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorBlockJobCancel(qemuMonitorPtr mon,
|
||||
const char *device,
|
||||
bool modern)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon,
|
||||
const char *device,
|
||||
@ -779,7 +777,7 @@ int qemuMonitorBlockJobInfo(qemuMonitorPtr mon,
|
||||
const char *device,
|
||||
virDomainBlockJobInfoPtr info,
|
||||
unsigned long long *bandwidth)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
||||
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
||||
|
||||
int qemuMonitorOpenGraphics(qemuMonitorPtr mon,
|
||||
const char *protocol,
|
||||
|
Loading…
x
Reference in New Issue
Block a user