]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuProcessHandleIOError: Rename local variables
authorPeter Krempa <pkrempa@redhat.com>
Mon, 27 Jan 2025 12:07:24 +0000 (13:07 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 4 Feb 2025 13:40:54 +0000 (14:40 +0100)
Prefix the helper variables used to supply data to the event by
'event'. Declare them with the default value of an empty string rather
than doing it later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_process.c

index c2a5361b79b7f07fac32d98d56cdb182a6a74761..aaf718e552d3680fc0f8e66fa919876882afd049 100644 (file)
@@ -833,8 +833,8 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
     virObjectEvent *ioErrorEvent = NULL;
     virObjectEvent *ioErrorEvent2 = NULL;
     virObjectEvent *lifecycleEvent = NULL;
-    const char *srcPath;
-    const char *devAlias;
+    const char *eventPath = "";
+    const char *eventAlias = "";
     virDomainDiskDef *disk;
 
     virObjectLock(vm);
@@ -848,15 +848,12 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
         disk = NULL;
 
     if (disk) {
-        srcPath = virDomainDiskGetSource(disk);
-        devAlias = disk->info.alias;
-    } else {
-        srcPath = "";
-        devAlias = "";
+        eventPath = virDomainDiskGetSource(disk);
+        eventAlias = disk->info.alias;
     }
 
-    ioErrorEvent = virDomainEventIOErrorNewFromObj(vm, srcPath, devAlias, action);
-    ioErrorEvent2 = virDomainEventIOErrorReasonNewFromObj(vm, srcPath, devAlias, action, reason);
+    ioErrorEvent = virDomainEventIOErrorNewFromObj(vm, eventPath, eventAlias, action);
+    ioErrorEvent2 = virDomainEventIOErrorReasonNewFromObj(vm, eventPath, eventAlias, action, reason);
 
     if (action == VIR_DOMAIN_EVENT_IO_ERROR_PAUSE &&
         virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {