[PATCHv2 5/8] audit: rename remaining qemu audit functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* src/qemu/qemu_audit.h: The pattern qemuDomainXXXAudit is
inconsistent; prefer qemuAuditXXX instead.
* src/qemu/qemu_audit.c: Reflect the renames.
* src/qemu/qemu_driver.c: Likewise.
* src/qemu/qemu_hotplug.c: Likewise.
* src/qemu/qemu_process.c: Likewise.
* src/qemu/qemu_migration.c: Likewise.
---

v2: new patch

 src/qemu/qemu_audit.c     |   84 +++++++++++++++++++++------------------------
 src/qemu/qemu_audit.h     |   58 ++++++++++++++++--------------
 src/qemu/qemu_driver.c    |   25 ++++++-------
 src/qemu/qemu_hotplug.c   |   40 +++++++++++-----------
 src/qemu/qemu_migration.c |   14 ++++----
 src/qemu/qemu_process.c   |    6 ++--
 6 files changed, 112 insertions(+), 115 deletions(-)

diff --git a/src/qemu/qemu_audit.c b/src/qemu/qemu_audit.c
index 1965a20..705cab7 100644
--- a/src/qemu/qemu_audit.c
+++ b/src/qemu/qemu_audit.c
@@ -60,11 +60,10 @@ qemuAuditGetRdev(const char *path ATTRIBUTE_UNUSED)
 }
 #endif

-void qemuDomainDiskAudit(virDomainObjPtr vm,
-                         virDomainDiskDefPtr oldDef,
-                         virDomainDiskDefPtr newDef,
-                         const char *reason,
-                         bool success)
+void
+qemuAuditDisk(virDomainObjPtr vm,
+              virDomainDiskDefPtr oldDef, virDomainDiskDefPtr newDef,
+              const char *reason, bool success)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *vmname;
@@ -102,11 +101,10 @@ cleanup:
 }


-void qemuDomainNetAudit(virDomainObjPtr vm,
-                        virDomainNetDefPtr oldDef,
-                        virDomainNetDefPtr newDef,
-                        const char *reason,
-                        bool success)
+void
+qemuAuditNet(virDomainObjPtr vm,
+             virDomainNetDefPtr oldDef, virDomainNetDefPtr newDef,
+             const char *reason, bool success)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char newMacstr[VIR_MAC_STRING_BUFLEN];
@@ -174,7 +172,7 @@ cleanup:
 }

 /**
- * qemuDomainHostdevAudit:
+ * qemuAuditHostdev:
  * @vm: domain making a change in pass-through host device
  * @hostdev: device being attached or removed
  * @reason: one of "start", "attach", or "detach"
@@ -183,10 +181,8 @@ cleanup:
  * Log an audit message about an attempted device passthrough change.
  */
 void
-qemuDomainHostdevAudit(virDomainObjPtr vm,
-                       virDomainHostdevDefPtr hostdev,
-                       const char *reason,
-                       bool success)
+qemuAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
+                 const char *reason, bool success)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *vmname;
@@ -355,7 +351,7 @@ cleanup:
 }

 /**
- * qemuDomainResourceAudit:
+ * qemuAuditResource:
  * @vm: domain making an integer resource change
  * @resource: name of the resource: "mem" or "vcpu"
  * @oldval: the old value of the resource
@@ -366,12 +362,9 @@ cleanup:
  * Log an audit message about an attempted resource change.
  */
 static void
-qemuDomainResourceAudit(virDomainObjPtr vm,
-                        const char *resource,
-                        unsigned long long oldval,
-                        unsigned long long newval,
-                        const char *reason,
-                        bool success)
+qemuAuditResource(virDomainObjPtr vm, const char *resource,
+                  unsigned long long oldval, unsigned long long newval,
+                  const char *reason, bool success)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *vmname;
@@ -391,26 +384,24 @@ qemuDomainResourceAudit(virDomainObjPtr vm,
 }

 void
-qemuDomainMemoryAudit(virDomainObjPtr vm,
-                      unsigned long long oldmem, unsigned long long newmem,
-                      const char *reason, bool success)
+qemuAuditMemory(virDomainObjPtr vm,
+                unsigned long long oldmem, unsigned long long newmem,
+                const char *reason, bool success)
 {
-    return qemuDomainResourceAudit(vm, "mem", oldmem, newmem, reason, success);
+    return qemuAuditResource(vm, "mem", oldmem, newmem, reason, success);
 }

 void
-qemuDomainVcpuAudit(virDomainObjPtr vm,
-                    unsigned int oldvcpu, unsigned int newvcpu,
-                    const char *reason, bool success)
+qemuAuditVcpu(virDomainObjPtr vm,
+              unsigned int oldvcpu, unsigned int newvcpu,
+              const char *reason, bool success)
 {
-    return qemuDomainResourceAudit(vm, "vcpu", oldvcpu, newvcpu, reason,
-                                   success);
+    return qemuAuditResource(vm, "vcpu", oldvcpu, newvcpu, reason, success);
 }

-static void qemuDomainLifecycleAudit(virDomainObjPtr vm,
-                                     const char *op,
-                                     const char *reason,
-                                     bool success)
+static void
+qemuAuditLifecycle(virDomainObjPtr vm, const char *op,
+                   const char *reason, bool success)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *vmname;
@@ -429,39 +420,42 @@ static void qemuDomainLifecycleAudit(virDomainObjPtr vm,
 }


-void qemuDomainStartAudit(virDomainObjPtr vm, const char *reason, bool success)
+void
+qemuAuditDomainStart(virDomainObjPtr vm, const char *reason, bool success)
 {
     int i;

     for (i = 0 ; i < vm->def->ndisks ; i++) {
         virDomainDiskDefPtr disk = vm->def->disks[i];
         if (disk->src) /* Skips CDROM without media initially inserted */
-            qemuDomainDiskAudit(vm, NULL, disk, "start", true);
+            qemuAuditDisk(vm, NULL, disk, "start", true);
     }

     for (i = 0 ; i < vm->def->nnets ; i++) {
         virDomainNetDefPtr net = vm->def->nets[i];
-        qemuDomainNetAudit(vm, NULL, net, "start", true);
+        qemuAuditNet(vm, NULL, net, "start", true);
     }

     for (i = 0 ; i < vm->def->nhostdevs ; i++) {
         virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i];
-        qemuDomainHostdevAudit(vm, hostdev, "start", true);
+        qemuAuditHostdev(vm, hostdev, "start", true);
     }

-    qemuDomainMemoryAudit(vm, 0, vm->def->mem.cur_balloon, "start", true);
-    qemuDomainVcpuAudit(vm, 0, vm->def->vcpus, "start", true);
+    qemuAuditMemory(vm, 0, vm->def->mem.cur_balloon, "start", true);
+    qemuAuditVcpu(vm, 0, vm->def->vcpus, "start", true);

-    qemuDomainLifecycleAudit(vm, "start", reason, success);
+    qemuAuditLifecycle(vm, "start", reason, success);
 }


-void qemuDomainStopAudit(virDomainObjPtr vm, const char *reason)
+void
+qemuAuditDomainStop(virDomainObjPtr vm, const char *reason)
 {
-    qemuDomainLifecycleAudit(vm, "stop", reason, true);
+    qemuAuditLifecycle(vm, "stop", reason, true);
 }

-void qemuDomainSecurityLabelAudit(virDomainObjPtr vm, bool success)
+void
+qemuAuditSecurityLabel(virDomainObjPtr vm, bool success)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *vmname;
diff --git a/src/qemu/qemu_audit.h b/src/qemu/qemu_audit.h
index 9f08362..84874a2 100644
--- a/src/qemu/qemu_audit.h
+++ b/src/qemu/qemu_audit.h
@@ -27,27 +27,30 @@
 # include "domain_conf.h"
 # include "cgroup.h"

-void qemuDomainStartAudit(virDomainObjPtr vm, const char *reason, bool success);
-void qemuDomainStopAudit(virDomainObjPtr vm, const char *reason);
-void qemuDomainDiskAudit(virDomainObjPtr vm,
-                         virDomainDiskDefPtr oldDef,
-                         virDomainDiskDefPtr newDef,
-                         const char *reason,
-                         bool success);
-void qemuDomainNetAudit(virDomainObjPtr vm,
-                        virDomainNetDefPtr oldDef,
-                        virDomainNetDefPtr newDef,
-                        const char *reason,
-                        bool success);
+void qemuAuditDomainStart(virDomainObjPtr vm,
+                          const char *reason,
+                          bool success);
+void qemuAuditDomainStop(virDomainObjPtr vm,
+                         const char *reason);
+void qemuAuditDisk(virDomainObjPtr vm,
+                   virDomainDiskDefPtr oldDef,
+                   virDomainDiskDefPtr newDef,
+                   const char *reason,
+                   bool success);
+void qemuAuditNet(virDomainObjPtr vm,
+                  virDomainNetDefPtr oldDef,
+                  virDomainNetDefPtr newDef,
+                  const char *reason,
+                  bool success);
 void qemuAuditNetVhost(virDomainDefPtr vmDef,
                        virDomainNetDefPtr netDef,
                        const char *device,
                        const char *reason,
                        bool success);
-void qemuDomainHostdevAudit(virDomainObjPtr vm,
-                            virDomainHostdevDefPtr def,
-                            const char *reason,
-                            bool success);
+void qemuAuditHostdev(virDomainObjPtr vm,
+                      virDomainHostdevDefPtr def,
+                      const char *reason,
+                      bool success);
 void qemuAuditCgroup(virDomainObjPtr vm,
                      virCgroupPtr group,
                      const char *reason,
@@ -64,16 +67,17 @@ void qemuAuditCgroupPath(virDomainObjPtr vm,
                          const char *reason,
                          const char *path,
                          int rc);
-void qemuDomainMemoryAudit(virDomainObjPtr vm,
-                           unsigned long long oldmem,
-                           unsigned long long newmem,
-                           const char *reason,
-                           bool success);
-void qemuDomainVcpuAudit(virDomainObjPtr vm,
-                         unsigned int oldvcpu,
-                         unsigned int newvcpu,
-                         const char *reason,
-                         bool success);
-void qemuDomainSecurityLabelAudit(virDomainObjPtr vm, bool success);
+void qemuAuditMemory(virDomainObjPtr vm,
+                     unsigned long long oldmem,
+                     unsigned long long newmem,
+                     const char *reason,
+                     bool success);
+void qemuAuditVcpu(virDomainObjPtr vm,
+                   unsigned int oldvcpu,
+                   unsigned int newvcpu,
+                   const char *reason,
+                   bool success);
+void qemuAuditSecurityLabel(virDomainObjPtr vm,
+                            bool success);

 #endif /* __QEMU_AUDIT_H__ */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0f7b5ec..1981cdf 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1266,7 +1266,7 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
     if (qemuProcessStart(conn, driver, vm, NULL,
                          (flags & VIR_DOMAIN_START_PAUSED) != 0,
                          -1, NULL, VIR_VM_OP_CREATE) < 0) {
-        qemuDomainStartAudit(vm, "booted", false);
+        qemuAuditDomainStart(vm, "booted", false);
         if (qemuDomainObjEndJob(vm) > 0)
             virDomainRemoveInactive(&driver->domains,
                                     vm);
@@ -1277,7 +1277,7 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
     event = virDomainEventNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STARTED,
                                      VIR_DOMAIN_EVENT_STARTED_BOOTED);
-    qemuDomainStartAudit(vm, "booted", true);
+    qemuAuditDomainStart(vm, "booted", true);

     dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
     if (dom) dom->id = vm->def->id;
@@ -1492,7 +1492,7 @@ static int qemudDomainDestroy(virDomainPtr dom) {
     event = virDomainEventNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
-    qemuDomainStopAudit(vm, "destroyed");
+    qemuAuditDomainStop(vm, "destroyed");

     if (!vm->persistent) {
         if (qemuDomainObjEndJob(vm) > 0)
@@ -1604,8 +1604,7 @@ static int qemudDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
     qemuDomainObjEnterMonitor(vm);
     r = qemuMonitorSetBalloon(priv->mon, newmem);
     qemuDomainObjExitMonitor(vm);
-    qemuDomainMemoryAudit(vm, vm->def->mem.cur_balloon, newmem, "update",
-                          r == 1);
+    qemuAuditMemory(vm, vm->def->mem.cur_balloon, newmem, "update", r == 1);
     if (r < 0)
         goto endjob;

@@ -2024,7 +2023,7 @@ static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom,

     /* Shut it down */
     qemuProcessStop(driver, vm, 0);
-    qemuDomainStopAudit(vm, "saved");
+    qemuAuditDomainStop(vm, "saved");
     event = virDomainEventNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_SAVED);
@@ -2420,7 +2419,7 @@ static int qemudDomainCoreDump(virDomainPtr dom,
 endjob:
     if ((ret == 0) && (flags & VIR_DUMP_CRASH)) {
         qemuProcessStop(driver, vm, 0);
-        qemuDomainStopAudit(vm, "crashed");
+        qemuAuditDomainStop(vm, "crashed");
         event = virDomainEventNewFromObj(vm,
                                          VIR_DOMAIN_EVENT_STOPPED,
                                          VIR_DOMAIN_EVENT_STOPPED_CRASHED);
@@ -2552,7 +2551,7 @@ static int qemudDomainHotplugVcpus(virDomainObjPtr vm, unsigned int nvcpus)

 cleanup:
     qemuDomainObjExitMonitor(vm);
-    qemuDomainVcpuAudit(vm, oldvcpus, nvcpus, "update", rc == 1);
+    qemuAuditVcpu(vm, oldvcpus, nvcpus, "update", rc == 1);
     return ret;

 unsupported:
@@ -3330,14 +3329,14 @@ qemudDomainSaveImageStartVM(virConnectPtr conn,
     *read_pid = -1;

     if (ret < 0) {
-        qemuDomainStartAudit(vm, "restored", false);
+        qemuAuditDomainStart(vm, "restored", false);
         goto out;
     }

     event = virDomainEventNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STARTED,
                                      VIR_DOMAIN_EVENT_STARTED_RESTORED);
-    qemuDomainStartAudit(vm, "restored", true);
+    qemuAuditDomainStart(vm, "restored", true);
     if (event)
         qemuDomainEventQueue(driver, event);

@@ -3675,7 +3674,7 @@ static int qemudDomainObjStart(virConnectPtr conn,

     ret = qemuProcessStart(conn, driver, vm, NULL, start_paused, -1, NULL,
                            VIR_VM_OP_CREATE);
-    qemuDomainStartAudit(vm, "booted", ret >= 0);
+    qemuAuditDomainStart(vm, "booted", ret >= 0);
     if (ret >= 0) {
         virDomainEventPtr event =
             virDomainEventNewFromObj(vm,
@@ -6358,7 +6357,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,

             rc = qemuProcessStart(snapshot->domain->conn, driver, vm, NULL,
                                   false, -1, NULL, VIR_VM_OP_CREATE);
-            qemuDomainStartAudit(vm, "from-snapshot", rc >= 0);
+            qemuAuditDomainStart(vm, "from-snapshot", rc >= 0);
             if (qemuDomainSnapshotSetCurrentInactive(vm, driver->snapshotDir) < 0)
                 goto endjob;
             if (rc < 0)
@@ -6391,7 +6390,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,

         if (virDomainObjIsActive(vm)) {
             qemuProcessStop(driver, vm, 0);
-            qemuDomainStopAudit(vm, "from-snapshot");
+            qemuAuditDomainStop(vm, "from-snapshot");
             event = virDomainEventNewFromObj(vm,
                                              VIR_DOMAIN_EVENT_STOPPED,
                                              VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9991031..7895062 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -108,7 +108,7 @@ int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainDiskAudit(vm, origdisk, disk, "update", ret >= 0);
+    qemuAuditDisk(vm, origdisk, disk, "update", ret >= 0);

     if (ret < 0)
         goto error;
@@ -203,7 +203,7 @@ int qemuDomainAttachPciDiskDevice(struct qemud_driver *driver,
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainDiskAudit(vm, NULL, disk, "attach", ret >= 0);
+    qemuAuditDisk(vm, NULL, disk, "attach", ret >= 0);

     if (ret < 0)
         goto error;
@@ -435,7 +435,7 @@ int qemuDomainAttachSCSIDisk(struct qemud_driver *driver,
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainDiskAudit(vm, NULL, disk, "attach", ret >= 0);
+    qemuAuditDisk(vm, NULL, disk, "attach", ret >= 0);

     if (ret < 0)
         goto error;
@@ -518,7 +518,7 @@ int qemuDomainAttachUsbMassstorageDevice(struct qemud_driver *driver,
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainDiskAudit(vm, NULL, disk, "attach", ret >= 0);
+    qemuAuditDisk(vm, NULL, disk, "attach", ret >= 0);

     if (ret < 0)
         goto error;
@@ -653,13 +653,13 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
         qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
         if (qemuMonitorAddNetdev(priv->mon, netstr) < 0) {
             qemuDomainObjExitMonitorWithDriver(driver, vm);
-            qemuDomainNetAudit(vm, NULL, net, "attach", false);
+            qemuAuditNet(vm, NULL, net, "attach", false);
             goto try_tapfd_close;
         }
     } else {
         if (qemuMonitorAddHostNetwork(priv->mon, netstr) < 0) {
             qemuDomainObjExitMonitorWithDriver(driver, vm);
-            qemuDomainNetAudit(vm, NULL, net, "attach", false);
+            qemuAuditNet(vm, NULL, net, "attach", false);
             goto try_tapfd_close;
         }
     }
@@ -685,14 +685,14 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
     if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
         if (qemuMonitorAddDevice(priv->mon, nicstr) < 0) {
             qemuDomainObjExitMonitorWithDriver(driver, vm);
-            qemuDomainNetAudit(vm, NULL, net, "attach", false);
+            qemuAuditNet(vm, NULL, net, "attach", false);
             goto try_remove;
         }
     } else {
         if (qemuMonitorAddPCINetwork(priv->mon, nicstr,
                                      &guestAddr) < 0) {
             qemuDomainObjExitMonitorWithDriver(driver, vm);
-            qemuDomainNetAudit(vm, NULL, net, "attach", false);
+            qemuAuditNet(vm, NULL, net, "attach", false);
             goto try_remove;
         }
         net->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
@@ -700,7 +700,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainNetAudit(vm, NULL, net, "attach", true);
+    qemuAuditNet(vm, NULL, net, "attach", true);

     ret = 0;

@@ -842,7 +842,7 @@ int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
         hostdev->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
         memcpy(&hostdev->info.addr.pci, &guestAddr, sizeof(guestAddr));
     }
-    qemuDomainHostdevAudit(vm, hostdev, "attach", ret == 0);
+    qemuAuditHostdev(vm, hostdev, "attach", ret == 0);
     if (ret < 0)
         goto error;

@@ -919,7 +919,7 @@ int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
                                            hostdev->source.subsys.u.usb.bus,
                                            hostdev->source.subsys.u.usb.device);
     qemuDomainObjExitMonitorWithDriver(driver, vm);
-    qemuDomainHostdevAudit(vm, hostdev, "attach", ret == 0);
+    qemuAuditHostdev(vm, hostdev, "attach", ret == 0);
     if (ret < 0)
         goto error;

@@ -1194,7 +1194,7 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,

     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainDiskAudit(vm, detach, NULL, "detach", ret >= 0);
+    qemuAuditDisk(vm, detach, NULL, "detach", ret >= 0);

     if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE) &&
         qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
@@ -1277,7 +1277,7 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver,

     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainDiskAudit(vm, detach, NULL, "detach", ret >= 0);
+    qemuAuditDisk(vm, detach, NULL, "detach", ret >= 0);

     virDomainDiskRemove(vm->def, i);

@@ -1486,14 +1486,14 @@ int qemuDomainDetachNetDevice(struct qemud_driver *driver,
     if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
         if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
             qemuDomainObjExitMonitor(vm);
-            qemuDomainNetAudit(vm, detach, NULL, "detach", false);
+            qemuAuditNet(vm, detach, NULL, "detach", false);
             goto cleanup;
         }
     } else {
         if (qemuMonitorRemovePCIDevice(priv->mon,
                                        &detach->info.addr.pci) < 0) {
             qemuDomainObjExitMonitorWithDriver(driver, vm);
-            qemuDomainNetAudit(vm, detach, NULL, "detach", false);
+            qemuAuditNet(vm, detach, NULL, "detach", false);
             goto cleanup;
         }
     }
@@ -1502,19 +1502,19 @@ int qemuDomainDetachNetDevice(struct qemud_driver *driver,
         qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
         if (qemuMonitorRemoveNetdev(priv->mon, hostnet_name) < 0) {
             qemuDomainObjExitMonitorWithDriver(driver, vm);
-            qemuDomainNetAudit(vm, detach, NULL, "detach", false);
+            qemuAuditNet(vm, detach, NULL, "detach", false);
             goto cleanup;
         }
     } else {
         if (qemuMonitorRemoveHostNetwork(priv->mon, vlan, hostnet_name) < 0) {
             qemuDomainObjExitMonitorWithDriver(driver, vm);
-            qemuDomainNetAudit(vm, detach, NULL, "detach", false);
+            qemuAuditNet(vm, detach, NULL, "detach", false);
             goto cleanup;
         }
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    qemuDomainNetAudit(vm, detach, NULL, "detach", true);
+    qemuAuditNet(vm, detach, NULL, "detach", true);

     if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE) &&
         qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
@@ -1615,7 +1615,7 @@ int qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
         ret = qemuMonitorRemovePCIDevice(priv->mon, &detach->info.addr.pci);
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);
-    qemuDomainHostdevAudit(vm, detach, "detach", ret == 0);
+    qemuAuditHostdev(vm, detach, "detach", ret == 0);
     if (ret < 0)
         return -1;

@@ -1714,7 +1714,7 @@ int qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
     qemuDomainObjEnterMonitorWithDriver(driver, vm);
     ret = qemuMonitorDelDevice(priv->mon, detach->info.alias);
     qemuDomainObjExitMonitorWithDriver(driver, vm);
-    qemuDomainHostdevAudit(vm, detach, "detach", ret == 0);
+    qemuAuditHostdev(vm, detach, "detach", ret == 0);
     if (ret < 0)
         return -1;

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 822cb18..8ce6e17 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -324,7 +324,7 @@ qemuMigrationPrepareTunnel(struct qemud_driver *driver,
                                    -1, NULL, VIR_VM_OP_MIGRATE_IN_START);
     VIR_FREE(migrateFrom);
     if (internalret < 0) {
-        qemuDomainStartAudit(vm, "migrated", false);
+        qemuAuditDomainStart(vm, "migrated", false);
         /* Note that we don't set an error here because qemuProcessStart
          * should have already done that.
          */
@@ -338,7 +338,7 @@ qemuMigrationPrepareTunnel(struct qemud_driver *driver,
     if (virFDStreamConnectUNIX(st,
                                unixfile,
                                false) < 0) {
-        qemuDomainStartAudit(vm, "migrated", false);
+        qemuAuditDomainStart(vm, "migrated", false);
         qemuProcessStop(driver, vm, 0);
         if (!vm->persistent) {
             if (qemuDomainObjEndJob(vm) > 0)
@@ -351,7 +351,7 @@ qemuMigrationPrepareTunnel(struct qemud_driver *driver,
         goto endjob;
     }

-    qemuDomainStartAudit(vm, "migrated", true);
+    qemuAuditDomainStart(vm, "migrated", true);

     event = virDomainEventNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STARTED,
@@ -532,7 +532,7 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
     snprintf (migrateFrom, sizeof (migrateFrom), "tcp:0.0.0.0:%d", this_port);
     if (qemuProcessStart(dconn, driver, vm, migrateFrom, true,
                          -1, NULL, VIR_VM_OP_MIGRATE_IN_START) < 0) {
-        qemuDomainStartAudit(vm, "migrated", false);
+        qemuAuditDomainStart(vm, "migrated", false);
         /* Note that we don't set an error here because qemuProcessStart
          * should have already done that.
          */
@@ -544,7 +544,7 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
         goto endjob;
     }

-    qemuDomainStartAudit(vm, "migrated", true);
+    qemuAuditDomainStart(vm, "migrated", true);
     event = virDomainEventNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STARTED,
                                      VIR_DOMAIN_EVENT_STARTED_MIGRATED);
@@ -1089,7 +1089,7 @@ int qemuMigrationPerform(struct qemud_driver *driver,

     /* Clean up the source domain. */
     qemuProcessStop(driver, vm, 1);
-    qemuDomainStopAudit(vm, "migrated");
+    qemuAuditDomainStop(vm, "migrated");
     resume = 0;

     event = virDomainEventNewFromObj(vm,
@@ -1268,7 +1268,7 @@ qemuMigrationFinish(struct qemud_driver *driver,
         }
     } else {
         qemuProcessStop(driver, vm, 1);
-        qemuDomainStopAudit(vm, "failed");
+        qemuAuditDomainStop(vm, "failed");
         event = virDomainEventNewFromObj(vm,
                                          VIR_DOMAIN_EVENT_STOPPED,
                                          VIR_DOMAIN_EVENT_STOPPED_FAILED);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ee1b4c4..d3b0691 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -131,7 +131,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
                                      VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);

     qemuProcessStop(driver, vm, 0);
-    qemuDomainStopAudit(vm, hasError ? "failed" : "shutdown");
+    qemuAuditDomainStop(vm, hasError ? "failed" : "shutdown");

     if (!vm->persistent)
         virDomainRemoveInactive(&driver->domains, vm);
@@ -1935,10 +1935,10 @@ int qemuProcessStart(virConnectPtr conn,
        then generate a security label for isolation */
     VIR_DEBUG0("Generating domain security label (if required)");
     if (virSecurityManagerGenLabel(driver->securityManager, vm) < 0) {
-        qemuDomainSecurityLabelAudit(vm, false);
+        qemuAuditSecurityLabel(vm, false);
         goto cleanup;
     }
-    qemuDomainSecurityLabelAudit(vm, true);
+    qemuAuditSecurityLabel(vm, true);

     VIR_DEBUG0("Generating setting domain security labels (if required)");
     if (virSecurityManagerSetAllLabel(driver->securityManager,
-- 
1.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]