We no longer need it as we use the more modern job events. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_monitor.c | 14 ------ src/qemu/qemu_monitor.h | 12 ----- src/qemu/qemu_monitor_json.c | 90 ------------------------------------ 3 files changed, 116 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index b575eaae06..a58aa5622f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1255,20 +1255,6 @@ qemuMonitorEmitPMSuspendDisk(qemuMonitor *mon) } -void -qemuMonitorEmitBlockJob(qemuMonitor *mon, - const char *diskAlias, - int type, - int status, - const char *error) -{ - VIR_DEBUG("mon=%p", mon); - - QEMU_MONITOR_CALLBACK(mon, domainBlockJob, mon->vm, - diskAlias, type, status, error); -} - - void qemuMonitorEmitJobStatusChange(qemuMonitor *mon, const char *jobname, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 916a86f423..0e3640c1da 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -222,12 +222,6 @@ typedef void (*qemuMonitorDomainGraphicsCallback)(qemuMonitor *mon, const char *authScheme, const char *x509dname, const char *saslUsername); -typedef void (*qemuMonitorDomainBlockJobCallback)(qemuMonitor *mon, - virDomainObj *vm, - const char *diskAlias, - int type, - int status, - const char *error); typedef void (*qemuMonitorDomainJobStatusChangeCallback)(qemuMonitor *mon, virDomainObj *vm, const char *jobname, @@ -381,7 +375,6 @@ struct _qemuMonitorCallbacks { qemuMonitorDomainWatchdogCallback domainWatchdog; qemuMonitorDomainIOErrorCallback domainIOError; qemuMonitorDomainGraphicsCallback domainGraphics; - qemuMonitorDomainBlockJobCallback domainBlockJob; qemuMonitorDomainJobStatusChangeCallback jobStatusChange; qemuMonitorDomainTrayChangeCallback domainTrayChange; qemuMonitorDomainPMWakeupCallback domainPMWakeup; @@ -476,11 +469,6 @@ void qemuMonitorEmitTrayChange(qemuMonitor *mon, int reason); void qemuMonitorEmitPMWakeup(qemuMonitor *mon); void qemuMonitorEmitPMSuspend(qemuMonitor *mon); -void qemuMonitorEmitBlockJob(qemuMonitor *mon, - const char *diskAlias, - int type, - int status, - const char *error); void qemuMonitorEmitJobStatusChange(qemuMonitor *mon, const char *jobname, qemuMonitorJobStatus status); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 8cda6f36b7..4584786872 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -65,9 +65,6 @@ static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon, virJSONValue static void qemuMonitorJSONHandleTrayChange(qemuMonitor *mon, virJSONValue *data); static void qemuMonitorJSONHandlePMWakeup(qemuMonitor *mon, virJSONValue *data); static void qemuMonitorJSONHandlePMSuspend(qemuMonitor *mon, virJSONValue *data); -static void qemuMonitorJSONHandleBlockJobCompleted(qemuMonitor *mon, virJSONValue *data); -static void qemuMonitorJSONHandleBlockJobCanceled(qemuMonitor *mon, virJSONValue *data); -static void qemuMonitorJSONHandleBlockJobReady(qemuMonitor *mon, virJSONValue *data); static void qemuMonitorJSONHandleJobStatusChange(qemuMonitor *mon, virJSONValue *data); static void qemuMonitorJSONHandleBalloonChange(qemuMonitor *mon, virJSONValue *data); static void qemuMonitorJSONHandlePMSuspendDisk(qemuMonitor *mon, virJSONValue *data); @@ -97,9 +94,6 @@ static qemuEventHandler eventHandlers[] = { { "ACPI_DEVICE_OST", qemuMonitorJSONHandleAcpiOstInfo, }, { "BALLOON_CHANGE", qemuMonitorJSONHandleBalloonChange, }, { "BLOCK_IO_ERROR", qemuMonitorJSONHandleIOError, }, - { "BLOCK_JOB_CANCELLED", qemuMonitorJSONHandleBlockJobCanceled, }, - { "BLOCK_JOB_COMPLETED", qemuMonitorJSONHandleBlockJobCompleted, }, - { "BLOCK_JOB_READY", qemuMonitorJSONHandleBlockJobReady, }, { "BLOCK_WRITE_THRESHOLD", qemuMonitorJSONHandleBlockThreshold, }, { "DEVICE_DELETED", qemuMonitorJSONHandleDeviceDeleted, }, { "DEVICE_TRAY_MOVED", qemuMonitorJSONHandleTrayChange, }, @@ -895,67 +889,6 @@ static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon, virJSONValue qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT); } -static void -qemuMonitorJSONHandleBlockJobImpl(qemuMonitor *mon, - virJSONValue *data, - int event) -{ - const char *device; - const char *type_str; - const char *error = NULL; - int type = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; - unsigned long long offset, len; - - if ((device = virJSONValueObjectGetString(data, "device")) == NULL) { - VIR_WARN("missing device in block job event"); - goto out; - } - - if (virJSONValueObjectGetNumberUlong(data, "offset", &offset) < 0) { - VIR_WARN("missing offset in block job event"); - goto out; - } - - if (virJSONValueObjectGetNumberUlong(data, "len", &len) < 0) { - VIR_WARN("missing len in block job event"); - goto out; - } - - if ((type_str = virJSONValueObjectGetString(data, "type")) == NULL) { - VIR_WARN("missing type in block job event"); - goto out; - } - - if (STREQ(type_str, "stream")) - type = VIR_DOMAIN_BLOCK_JOB_TYPE_PULL; - else if (STREQ(type_str, "commit")) - type = VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT; - else if (STREQ(type_str, "mirror")) - type = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY; - else if (STREQ(type_str, "backup")) - type = VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP; - - switch ((virConnectDomainEventBlockJobStatus) event) { - case VIR_DOMAIN_BLOCK_JOB_COMPLETED: - error = virJSONValueObjectGetString(data, "error"); - /* Make sure the whole device has been processed */ - if (offset != len || error) - event = VIR_DOMAIN_BLOCK_JOB_FAILED; - break; - case VIR_DOMAIN_BLOCK_JOB_CANCELED: - case VIR_DOMAIN_BLOCK_JOB_READY: - break; - case VIR_DOMAIN_BLOCK_JOB_FAILED: - case VIR_DOMAIN_BLOCK_JOB_LAST: - VIR_DEBUG("should not get here"); - break; - } - - out: - qemuMonitorEmitBlockJob(mon, device, type, event, error); -} - - static void qemuMonitorJSONHandleJobStatusChange(qemuMonitor *mon, virJSONValue *data) @@ -1024,29 +957,6 @@ qemuMonitorJSONHandlePMSuspend(qemuMonitor *mon, qemuMonitorEmitPMSuspend(mon); } -static void -qemuMonitorJSONHandleBlockJobCompleted(qemuMonitor *mon, - virJSONValue *data) -{ - qemuMonitorJSONHandleBlockJobImpl(mon, data, - VIR_DOMAIN_BLOCK_JOB_COMPLETED); -} - -static void -qemuMonitorJSONHandleBlockJobCanceled(qemuMonitor *mon, - virJSONValue *data) -{ - qemuMonitorJSONHandleBlockJobImpl(mon, data, - VIR_DOMAIN_BLOCK_JOB_CANCELED); -} - -static void -qemuMonitorJSONHandleBlockJobReady(qemuMonitor *mon, - virJSONValue *data) -{ - qemuMonitorJSONHandleBlockJobImpl(mon, data, - VIR_DOMAIN_BLOCK_JOB_READY); -} static void qemuMonitorJSONHandleBalloonChange(qemuMonitor *mon, -- 2.36.1