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

[libvirt] [PATCH] Avoid using "devname" as an identifier.



/usr/lib/stdlib.h in Mac OS X and probably also in BSD's
exports this symbol :(
---
 src/conf/domain_audit.c             |    8 +++---
 src/driver.h                        |    2 +-
 src/libvirt.c                       |   12 +++++-----
 src/lxc/lxc_controller.c            |    4 +-
 src/lxc/lxc_driver.c                |    6 ++--
 src/network/bridge_driver.c         |   14 ++++++------
 src/qemu/qemu_command.c             |   28 +++++++++++++-------------
 src/qemu/qemu_driver.c              |   14 ++++++------
 src/qemu/qemu_monitor.c             |   36 +++++++++++++++++-----------------
 src/qemu/qemu_monitor.h             |    8 +++---
 src/qemu/qemu_monitor_json.c        |   26 ++++++++++++------------
 src/qemu/qemu_monitor_json.h        |    8 +++---
 src/qemu/qemu_monitor_text.c        |   30 ++++++++++++++--------------
 src/qemu/qemu_monitor_text.h        |    8 +++---
 src/storage/storage_backend_disk.c  |   14 ++++++------
 src/storage/storage_backend_mpath.c |    8 +++---
 src/uml/uml_driver.c                |    8 +++---
 src/util/util.c                     |    6 ++--
 src/util/util.h                     |    2 +-
 src/xen/xen_driver.c                |    6 ++--
 tools/console.c                     |    4 +-
 tools/console.h                     |    2 +-
 22 files changed, 127 insertions(+), 127 deletions(-)

diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index 581be70..16937dc 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -202,7 +202,7 @@ virDomainAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef,
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char macstr[VIR_MAC_STRING_BUFLEN];
     char *vmname;
-    char *devname;
+    char *dev_name;
     char *rdev;
     const char *virt;

@@ -211,7 +211,7 @@ virDomainAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef,
     rdev = virDomainAuditGetRdev(device);

     if (!(vmname = virAuditEncode("vm", vmDef->name)) ||
-        !(devname = virAuditEncode("path", device))) {
+        !(dev_name = virAuditEncode("path", device))) {
         VIR_WARN("OOM while encoding audit message");
         goto cleanup;
     }
@@ -223,11 +223,11 @@ virDomainAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef,

     VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
               "virt=%s resrc=net reason=open %s uuid=%s net='%s' %s rdev=%s",
-              virt, vmname, uuidstr, macstr, devname, VIR_AUDIT_STR(rdev));
+              virt, vmname, uuidstr, macstr, dev_name, VIR_AUDIT_STR(rdev));

 cleanup:
     VIR_FREE(vmname);
-    VIR_FREE(devname);
+    VIR_FREE(dev_name);
     VIR_FREE(rdev);
 }

diff --git a/src/driver.h b/src/driver.h
index fc7a931..3792003 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -612,7 +612,7 @@ typedef virDomainPtr

 typedef int
     (*virDrvDomainOpenConsole)(virDomainPtr dom,
-                               const char *devname,
+                               const char *dev_name,
                                virStreamPtr st,
                                unsigned int flags);

diff --git a/src/libvirt.c b/src/libvirt.c
index c32c7a6..66c2327 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -16312,13 +16312,13 @@ virDomainSnapshotFree(virDomainSnapshotPtr snapshot)
 /**
  * virDomainOpenConsole:
  * @dom: a domain object
- * @devname: the console, serial or parallel port device alias, or NULL
+ * @dev_name: the console, serial or parallel port device alias, or NULL
  * @st: a stream to associate with the console
  * @flags: unused, pass 0
  *
  * This opens the backend associated with a console, serial or
  * parallel port device on a guest, if the backend is supported.
- * If the @devname is omitted, then the first console or serial
+ * If the @dev_name is omitted, then the first console or serial
  * device is opened. The console is associated with the passed
  * in @st stream, which should have been opened in non-blocking
  * mode for bi-directional I/O.
@@ -16326,14 +16326,14 @@ virDomainSnapshotFree(virDomainSnapshotPtr snapshot)
  * returns 0 if the console was opened, -1 on error
  */
 int virDomainOpenConsole(virDomainPtr dom,
-                         const char *devname,
+                         const char *dev_name,
                          virStreamPtr st,
                          unsigned int flags)
 {
     virConnectPtr conn;

-    VIR_DOMAIN_DEBUG(dom, "devname=%s, st=%p, flags=%x",
-                     NULLSTR(devname), st, flags);
+    VIR_DOMAIN_DEBUG(dom, "dev_name=%s, st=%p, flags=%x",
+                     NULLSTR(dev_name), st, flags);

     virResetLastError();

@@ -16351,7 +16351,7 @@ int virDomainOpenConsole(virDomainPtr dom,

     if (conn->driver->domainOpenConsole) {
         int ret;
-        ret = conn->driver->domainOpenConsole(dom, devname, st, flags);
+        ret = conn->driver->domainOpenConsole(dom, dev_name, st, flags);
         if (ret < 0)
             goto error;
         return ret;
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 5028251..52d382e 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -67,7 +67,7 @@ struct cgroup_device_policy {
 };


-static int lxcGetLoopFD(char **devname)
+static int lxcGetLoopFD(char **dev_name)
 {
     int fd = -1;
     DIR *dh = NULL;
@@ -122,7 +122,7 @@ static int lxcGetLoopFD(char **devname)
 cleanup:
     if (fd != -1) {
         VIR_DEBUG("Got free loop device %s %d", looppath, fd);
-        *devname = looppath;
+        *dev_name = looppath;
     } else {
         VIR_DEBUG("No free loop devices available");
         VIR_FREE(looppath);
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 6b716c1..6cf7203 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2837,7 +2837,7 @@ cleanup:

 static int
 lxcDomainOpenConsole(virDomainPtr dom,
-                      const char *devname,
+                      const char *dev_name,
                       virStreamPtr st,
                       unsigned int flags)
 {
@@ -2864,7 +2864,7 @@ lxcDomainOpenConsole(virDomainPtr dom,
         goto cleanup;
     }

-    if (devname) {
+    if (dev_name) {
         /* XXX support device aliases in future */
         lxcError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                  _("Named device aliases are not supported"));
@@ -2884,7 +2884,7 @@ lxcDomainOpenConsole(virDomainPtr dom,

     if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
         lxcError(VIR_ERR_INTERNAL_ERROR,
-                 _("character device %s is not using a PTY"), devname);
+                 _("character device %s is not using a PTY"), dev_name);
         goto cleanup;
     }

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index cea8771..9960745 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3142,7 +3142,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
     virNetworkIpDefPtr ipdef;
     virSocketAddr addr;
     virSocketAddrPtr addrptr = NULL;
-    char *devname = NULL;
+    char *dev_name = NULL;

     *netaddr = NULL;
     networkDriverLock(driver);
@@ -3172,7 +3172,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
         break;

     case VIR_NETWORK_FORWARD_BRIDGE:
-        if ((devname = netdef->bridge))
+        if ((dev_name = netdef->bridge))
             break;
         /*
          * fall through if netdef->bridge wasn't set, since this is
@@ -3182,9 +3182,9 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
     case VIR_NETWORK_FORWARD_VEPA:
     case VIR_NETWORK_FORWARD_PASSTHROUGH:
         if ((netdef->nForwardIfs > 0) && netdef->forwardIfs)
-            devname = netdef->forwardIfs[0].dev;
+            dev_name = netdef->forwardIfs[0].dev;

-        if (!devname) {
+        if (!dev_name) {
             networkReportError(VIR_ERR_INTERNAL_ERROR,
                                _("network '%s' has no associated interface or bridge"),
                                netdef->name);
@@ -3192,11 +3192,11 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
         break;
     }

-    if (devname) {
-        if (ifaceGetIPAddress(devname, &addr)) {
+    if (dev_name) {
+        if (ifaceGetIPAddress(dev_name, &addr)) {
             virReportSystemError(errno,
                                  _("Failed to get IP address for '%s' (network '%s')"),
-                                 devname, netdef->name);
+                                 dev_name, netdef->name);
         } else {
             addrptr = &addr;
         }
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 153647a..5f0de40 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -422,20 +422,20 @@ int qemuDomainNetVLAN(virDomainNetDefPtr def)
 /* Names used before -drive existed */
 static int qemuAssignDeviceDiskAliasLegacy(virDomainDiskDefPtr disk)
 {
-    char *devname;
+    char *dev_name;

     if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
         STREQ(disk->dst, "hdc"))
-        devname = strdup("cdrom");
+        dev_name = strdup("cdrom");
     else
-        devname = strdup(disk->dst);
+        dev_name = strdup(disk->dst);

-    if (!devname) {
+    if (!dev_name) {
         virReportOOMError();
         return -1;
     }

-    disk->info.alias = devname;
+    disk->info.alias = dev_name;
     return 0;
 }

@@ -465,7 +465,7 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
 {
     int busid, devid;
     int ret;
-    char *devname;
+    char *dev_name;

     if (virDiskNameToBusDeviceIndex(disk, &busid, &devid) < 0) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -477,24 +477,24 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
     switch (disk->bus) {
     case VIR_DOMAIN_DISK_BUS_IDE:
         if (disk->device== VIR_DOMAIN_DISK_DEVICE_DISK)
-            ret = virAsprintf(&devname, "ide%d-hd%d", busid, devid);
+            ret = virAsprintf(&dev_name, "ide%d-hd%d", busid, devid);
         else
-            ret = virAsprintf(&devname, "ide%d-cd%d", busid, devid);
+            ret = virAsprintf(&dev_name, "ide%d-cd%d", busid, devid);
         break;
     case VIR_DOMAIN_DISK_BUS_SCSI:
         if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
-            ret = virAsprintf(&devname, "scsi%d-hd%d", busid, devid);
+            ret = virAsprintf(&dev_name, "scsi%d-hd%d", busid, devid);
         else
-            ret = virAsprintf(&devname, "scsi%d-cd%d", busid, devid);
+            ret = virAsprintf(&dev_name, "scsi%d-cd%d", busid, devid);
         break;
     case VIR_DOMAIN_DISK_BUS_FDC:
-        ret = virAsprintf(&devname, "floppy%d", devid);
+        ret = virAsprintf(&dev_name, "floppy%d", devid);
         break;
     case VIR_DOMAIN_DISK_BUS_VIRTIO:
-        ret = virAsprintf(&devname, "virtio%d", devid);
+        ret = virAsprintf(&dev_name, "virtio%d", devid);
         break;
     case VIR_DOMAIN_DISK_BUS_XEN:
-        ret = virAsprintf(&devname, "xenblk%d", devid);
+        ret = virAsprintf(&dev_name, "xenblk%d", devid);
         break;
     default:
         qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -508,7 +508,7 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
         return -1;
     }

-    disk->info.alias = devname;
+    disk->info.alias = dev_name;

     return 0;
 }
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d2626ff..c73b2ec 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10334,7 +10334,7 @@ cleanup:

 static int
 qemuDomainOpenConsole(virDomainPtr dom,
-                      const char *devname,
+                      const char *dev_name,
                       virStreamPtr st,
                       unsigned int flags)
 {
@@ -10362,16 +10362,16 @@ qemuDomainOpenConsole(virDomainPtr dom,
         goto cleanup;
     }

-    if (devname) {
+    if (dev_name) {
         if (vm->def->console &&
-            STREQ(devname, vm->def->console->info.alias))
+            STREQ(dev_name, vm->def->console->info.alias))
             chr = vm->def->console;
         for (i = 0 ; !chr && i < vm->def->nserials ; i++) {
-            if (STREQ(devname, vm->def->serials[i]->info.alias))
+            if (STREQ(dev_name, vm->def->serials[i]->info.alias))
                 chr = vm->def->serials[i];
         }
         for (i = 0 ; !chr && i < vm->def->nparallels ; i++) {
-            if (STREQ(devname, vm->def->parallels[i]->info.alias))
+            if (STREQ(dev_name, vm->def->parallels[i]->info.alias))
                 chr = vm->def->parallels[i];
         }
     } else {
@@ -10384,14 +10384,14 @@ qemuDomainOpenConsole(virDomainPtr dom,
     if (!chr) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
                         _("cannot find character device %s"),
-                        NULLSTR(devname));
+                        NULLSTR(dev_name));
         goto cleanup;
     }

     if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
                         _("character device %s is not using a PTY"),
-                        NULLSTR(devname));
+                        NULLSTR(dev_name));
         goto cleanup;
     }

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index fca8fa4..b4c43ae 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1217,7 +1217,7 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon,


 int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
-                                 const char *devname,
+                                 const char *dev_name,
                                  long long *rd_req,
                                  long long *rd_bytes,
                                  long long *rd_total_times,
@@ -1229,7 +1229,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
                                  long long *errs)
 {
     int ret;
-    VIR_DEBUG("mon=%p dev=%s", mon, devname);
+    VIR_DEBUG("mon=%p dev=%s", mon, dev_name);

     if (!mon) {
         qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -1238,7 +1238,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
     }

     if (mon->json)
-        ret = qemuMonitorJSONGetBlockStatsInfo(mon, devname,
+        ret = qemuMonitorJSONGetBlockStatsInfo(mon, dev_name,
                                                rd_req, rd_bytes,
                                                rd_total_times,
                                                wr_req, wr_bytes,
@@ -1247,7 +1247,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
                                                flush_total_times,
                                                errs);
     else
-        ret = qemuMonitorTextGetBlockStatsInfo(mon, devname,
+        ret = qemuMonitorTextGetBlockStatsInfo(mon, dev_name,
                                                rd_req, rd_bytes,
                                                rd_total_times,
                                                wr_req, wr_bytes,
@@ -1282,17 +1282,17 @@ int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon,
 }

 int qemuMonitorGetBlockExtent(qemuMonitorPtr mon,
-                              const char *devname,
+                              const char *dev_name,
                               unsigned long long *extent)
 {
     int ret;
-    VIR_DEBUG("mon=%p, fd=%d, devname=%p",
-          mon, mon->fd, devname);
+    VIR_DEBUG("mon=%p, fd=%d, dev_name=%p",
+          mon, mon->fd, dev_name);

     if (mon->json)
-        ret = qemuMonitorJSONGetBlockExtent(mon, devname, extent);
+        ret = qemuMonitorJSONGetBlockExtent(mon, dev_name, extent);
     else
-        ret = qemuMonitorTextGetBlockExtent(mon, devname, extent);
+        ret = qemuMonitorTextGetBlockExtent(mon, dev_name, extent);

     return ret;
 }
@@ -1439,11 +1439,11 @@ int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online)


 int qemuMonitorEjectMedia(qemuMonitorPtr mon,
-                          const char *devname,
+                          const char *dev_name,
                           bool force)
 {
     int ret;
-    VIR_DEBUG("mon=%p devname=%s force=%d", mon, devname, force);
+    VIR_DEBUG("mon=%p dev_name=%s force=%d", mon, dev_name, force);

     if (!mon) {
         qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -1452,21 +1452,21 @@ int qemuMonitorEjectMedia(qemuMonitorPtr mon,
     }

     if (mon->json)
-        ret = qemuMonitorJSONEjectMedia(mon, devname, force);
+        ret = qemuMonitorJSONEjectMedia(mon, dev_name, force);
     else
-        ret = qemuMonitorTextEjectMedia(mon, devname, force);
+        ret = qemuMonitorTextEjectMedia(mon, dev_name, force);
     return ret;
 }


 int qemuMonitorChangeMedia(qemuMonitorPtr mon,
-                           const char *devname,
+                           const char *dev_name,
                            const char *newmedia,
                            const char *format)
 {
     int ret;
-    VIR_DEBUG("mon=%p devname=%s newmedia=%s format=%s",
-          mon, devname, newmedia, format);
+    VIR_DEBUG("mon=%p dev_name=%s newmedia=%s format=%s",
+          mon, dev_name, newmedia, format);

     if (!mon) {
         qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -1475,9 +1475,9 @@ int qemuMonitorChangeMedia(qemuMonitorPtr mon,
     }

     if (mon->json)
-        ret = qemuMonitorJSONChangeMedia(mon, devname, newmedia, format);
+        ret = qemuMonitorJSONChangeMedia(mon, dev_name, newmedia, format);
     else
-        ret = qemuMonitorTextChangeMedia(mon, devname, newmedia, format);
+        ret = qemuMonitorTextChangeMedia(mon, dev_name, newmedia, format);
     return ret;
 }

diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 390eeff..477767f 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -213,7 +213,7 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
                               virDomainMemoryStatPtr stats,
                               unsigned int nr_stats);
 int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
-                                 const char *devname,
+                                 const char *dev_name,
                                  long long *rd_req,
                                  long long *rd_bytes,
                                  long long *rd_total_times,
@@ -227,7 +227,7 @@ int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon,
                                          int *nparams);

 int qemuMonitorGetBlockExtent(qemuMonitorPtr mon,
-                              const char *devname,
+                              const char *dev_name,
                               unsigned long long *extent);


@@ -250,10 +250,10 @@ int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online);
  * this when doing the QMP implementation
  */
 int qemuMonitorEjectMedia(qemuMonitorPtr mon,
-                          const char *devname,
+                          const char *dev_name,
                           bool force);
 int qemuMonitorChangeMedia(qemuMonitorPtr mon,
-                           const char *devname,
+                           const char *dev_name,
                            const char *newmedia,
                            const char *format);

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 3a81ec8..e38c2ed 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1338,7 +1338,7 @@ cleanup:


 int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
-                                     const char *devname,
+                                     const char *dev_name,
                                      long long *rd_req,
                                      long long *rd_bytes,
                                      long long *rd_total_times,
@@ -1405,12 +1405,12 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,

         /* New QEMU has separate names for host & guest side of the disk
          * and libvirt gives the host side a 'drive-' prefix. The passed
-         * in devname is the guest side though
+         * in dev_name is the guest side though
          */
         if (STRPREFIX(thisdev, QEMU_DRIVE_HOST_PREFIX))
             thisdev += strlen(QEMU_DRIVE_HOST_PREFIX);

-        if (STRNEQ(thisdev, devname))
+        if (STRNEQ(thisdev, dev_name))
             continue;

         found = 1;
@@ -1485,7 +1485,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,

     if (!found) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("cannot find statistics for device '%s'"), devname);
+                        _("cannot find statistics for device '%s'"), dev_name);
         goto cleanup;
     }
     ret = 0;
@@ -1570,7 +1570,7 @@ cleanup:
 }

 int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,
-                                  const char *devname,
+                                  const char *dev_name,
                                   unsigned long long *extent)
 {
     int ret = -1;
@@ -1620,12 +1620,12 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,

         /* New QEMU has separate names for host & guest side of the disk
          * and libvirt gives the host side a 'drive-' prefix. The passed
-         * in devname is the guest side though
+         * in dev_name is the guest side though
          */
         if (STRPREFIX(thisdev, QEMU_DRIVE_HOST_PREFIX))
             thisdev += strlen(QEMU_DRIVE_HOST_PREFIX);

-        if (STRNEQ(thisdev, devname))
+        if (STRNEQ(thisdev, dev_name))
             continue;

         found = 1;
@@ -1653,7 +1653,7 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,

     if (!found) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("cannot find statistics for device '%s'"), devname);
+                        _("cannot find statistics for device '%s'"), dev_name);
         goto cleanup;
     }
     ret = 0;
@@ -1840,12 +1840,12 @@ cleanup:


 int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
-                              const char *devname,
+                              const char *dev_name,
                               bool force)
 {
     int ret;
     virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("eject",
-                                                     "s:device", devname,
+                                                     "s:device", dev_name,
                                                      "b:force", force ? 1 : 0,
                                                      NULL);
     virJSONValuePtr reply = NULL;
@@ -1864,7 +1864,7 @@ int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,


 int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon,
-                               const char *devname,
+                               const char *dev_name,
                                const char *newmedia,
                                const char *format)
 {
@@ -1872,13 +1872,13 @@ int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon,
     virJSONValuePtr cmd;
     if (format)
         cmd = qemuMonitorJSONMakeCommand("change",
-                                         "s:device", devname,
+                                         "s:device", dev_name,
                                          "s:target", newmedia,
                                          "s:arg", format,
                                          NULL);
     else
         cmd = qemuMonitorJSONMakeCommand("change",
-                                         "s:device", devname,
+                                         "s:device", dev_name,
                                          "s:target", newmedia,
                                          NULL);

diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index dfeba7e..673444f 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -61,7 +61,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
                                   virDomainMemoryStatPtr stats,
                                   unsigned int nr_stats);
 int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
-                                     const char *devname,
+                                     const char *dev_name,
                                      long long *rd_req,
                                      long long *rd_bytes,
                                      long long *rd_total_times,
@@ -74,7 +74,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
 int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon,
                                              int *nparams);
 int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,
-                                  const char *devname,
+                                  const char *dev_name,
                                   unsigned long long *extent);


@@ -92,10 +92,10 @@ int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
 int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, int online);

 int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
-                              const char *devname,
+                              const char *dev_name,
                               bool force);
 int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon,
-                               const char *devname,
+                               const char *dev_name,
                                const char *newmedia,
                                const char *format);

diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 0b50ba2..cedf582 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -751,7 +751,7 @@ int qemuMonitorTextGetMemoryStats(qemuMonitorPtr mon,


 int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
-                                     const char *devname,
+                                     const char *dev_name,
                                      long long *rd_req,
                                      long long *rd_bytes,
                                      long long *rd_total_times,
@@ -766,7 +766,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
     int ret = -1;
     char *dummy;
     const char *p, *eol;
-    int devnamelen = strlen(devname);
+    int devnamelen = strlen(dev_name);

     if (qemuMonitorHMPCommand (mon, "info blockstats", &info) < 0) {
         qemuReportError(VIR_ERR_OPERATION_FAILED,
@@ -808,12 +808,12 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
     while (*p) {
         /* New QEMU has separate names for host & guest side of the disk
          * and libvirt gives the host side a 'drive-' prefix. The passed
-         * in devname is the guest side though
+         * in dev_name is the guest side though
          */
         if (STRPREFIX(p, QEMU_DRIVE_HOST_PREFIX))
             p += strlen(QEMU_DRIVE_HOST_PREFIX);

-        if (STREQLEN (p, devname, devnamelen)
+        if (STREQLEN (p, dev_name, devnamelen)
             && p[devnamelen] == ':' && p[devnamelen+1] == ' ') {

             eol = strchr (p, '\n');
@@ -880,7 +880,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,

     /* If we reach here then the device was not found. */
     qemuReportError (VIR_ERR_INVALID_ARG,
-                     _("no stats found for device %s"), devname);
+                     _("no stats found for device %s"), dev_name);

  cleanup:
     VIR_FREE(info);
@@ -959,7 +959,7 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon,
 }

 int qemuMonitorTextGetBlockExtent(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
-                                  const char *devname ATTRIBUTE_UNUSED,
+                                  const char *dev_name ATTRIBUTE_UNUSED,
                                   unsigned long long *extent ATTRIBUTE_UNUSED)
 {
     qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -1163,21 +1163,21 @@ int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, int online)


 int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
-                              const char *devname,
+                              const char *dev_name,
                               bool force)
 {
     char *cmd = NULL;
     char *reply = NULL;
     int ret = -1;

-    if (virAsprintf(&cmd, "eject %s%s", force ? "-f " : "", devname) < 0) {
+    if (virAsprintf(&cmd, "eject %s%s", force ? "-f " : "", dev_name) < 0) {
         virReportOOMError();
         goto cleanup;
     }

     if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
         qemuReportError(VIR_ERR_OPERATION_FAILED,
-                        _("could not eject media on %s"), devname);
+                        _("could not eject media on %s"), dev_name);
         goto cleanup;
     }

@@ -1186,7 +1186,7 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
      * No message is printed on success it seems */
     if (c_strcasestr(reply, "device ")) {
         qemuReportError(VIR_ERR_OPERATION_FAILED,
-                        _("could not eject media on %s: %s"), devname, reply);
+                        _("could not eject media on %s: %s"), dev_name, reply);
         goto cleanup;
     }

@@ -1200,7 +1200,7 @@ cleanup:


 int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
-                               const char *devname,
+                               const char *dev_name,
                                const char *newmedia,
                                const char *format ATTRIBUTE_UNUSED)
 {
@@ -1214,14 +1214,14 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
         goto cleanup;
     }

-    if (virAsprintf(&cmd, "change %s \"%s\"", devname, safepath) < 0) {
+    if (virAsprintf(&cmd, "change %s \"%s\"", dev_name, safepath) < 0) {
         virReportOOMError();
         goto cleanup;
     }

     if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
         qemuReportError(VIR_ERR_OPERATION_FAILED,
-                        _("could not change media on %s"), devname);
+                        _("could not change media on %s"), dev_name);
         goto cleanup;
     }

@@ -1230,14 +1230,14 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
      * No message is printed on success it seems */
     if (c_strcasestr(reply, "device ")) {
         qemuReportError(VIR_ERR_OPERATION_FAILED,
-                        _("could not change media on %s: %s"), devname, reply);
+                        _("could not change media on %s: %s"), dev_name, reply);
         goto cleanup;
     }

     /* Could not open message indicates bad filename */
     if (strstr(reply, "Could not open ")) {
         qemuReportError(VIR_ERR_OPERATION_FAILED,
-                        _("could not change media on %s: %s"), devname, reply);
+                        _("could not change media on %s: %s"), dev_name, reply);
         goto cleanup;
     }

diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h
index 7cc3172..4651a17 100644
--- a/src/qemu/qemu_monitor_text.h
+++ b/src/qemu/qemu_monitor_text.h
@@ -58,7 +58,7 @@ int qemuMonitorTextGetMemoryStats(qemuMonitorPtr mon,
                                   virDomainMemoryStatPtr stats,
                                   unsigned int nr_stats);
 int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
-                                     const char *devname,
+                                     const char *dev_name,
                                      long long *rd_req,
                                      long long *rd_bytes,
                                      long long *rd_total_times,
@@ -71,7 +71,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
 int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon,
                                              int *nparams);
 int qemuMonitorTextGetBlockExtent(qemuMonitorPtr mon,
-                                  const char *devname,
+                                  const char *dev_name,
                                   unsigned long long *extent);

 int qemuMonitorTextSetVNCPassword(qemuMonitorPtr mon,
@@ -88,10 +88,10 @@ int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
 int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, int online);

 int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
-                              const char *devname,
+                              const char *dev_name,
                               bool force);
 int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
-                               const char *devname,
+                               const char *dev_name,
                                const char *newmedia,
                                const char *format);

diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index c08a10b..80f9dd1 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -649,7 +649,7 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
 {
     char *part_num = NULL;
     char *devpath = NULL;
-    char *devname, *srcname;
+    char *dev_name, *srcname;
     virCommandPtr cmd = NULL;
     bool isDevMapperDevice;
     int rc = -1;
@@ -663,26 +663,26 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
         goto cleanup;
     }

-    devname = basename(devpath);
+    dev_name = basename(devpath);
     srcname = basename(pool->def->source.devices[0].path);
-    VIR_DEBUG("devname=%s, srcname=%s", devname, srcname);
+    VIR_DEBUG("dev_name=%s, srcname=%s", dev_name, srcname);

     isDevMapperDevice = virIsDevMapperDevice(devpath);

-    if (!isDevMapperDevice && !STRPREFIX(devname, srcname)) {
+    if (!isDevMapperDevice && !STRPREFIX(dev_name, srcname)) {
         virStorageReportError(VIR_ERR_INTERNAL_ERROR,
                               _("Volume path '%s' did not start with parent "
-                                "pool source device name."), devname);
+                                "pool source device name."), dev_name);
         goto cleanup;
     }

     if (!isDevMapperDevice) {
-        part_num = devname + strlen(srcname);
+        part_num = dev_name + strlen(srcname);

         if (*part_num == 0) {
             virStorageReportError(VIR_ERR_INTERNAL_ERROR,
                                   _("cannot parse partition number from target "
-                                    "'%s'"), devname);
+                                    "'%s'"), dev_name);
             goto cleanup;
         }

diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c
index f2e1419..4f3add3 100644
--- a/src/storage/storage_backend_mpath.c
+++ b/src/storage/storage_backend_mpath.c
@@ -125,7 +125,7 @@ cleanup:


 static int
-virStorageBackendIsMultipath(const char *devname)
+virStorageBackendIsMultipath(const char *dev_name)
 {
     int ret = 0;
     struct dm_task *dmt = NULL;
@@ -140,7 +140,7 @@ virStorageBackendIsMultipath(const char *devname)
         goto out;
     }

-    if (dm_task_set_name(dmt, devname) == 0) {
+    if (dm_task_set_name(dmt, dev_name) == 0) {
         ret = -1;
         goto out;
     }
@@ -172,7 +172,7 @@ out:


 static int
-virStorageBackendGetMinorNumber(const char *devname, uint32_t *minor)
+virStorageBackendGetMinorNumber(const char *dev_name, uint32_t *minor)
 {
     int ret = -1;
     struct dm_task *dmt;
@@ -182,7 +182,7 @@ virStorageBackendGetMinorNumber(const char *devname, uint32_t *minor)
         goto out;
     }

-    if (!dm_task_set_name(dmt, devname)) {
+    if (!dm_task_set_name(dmt, dev_name)) {
         goto out;
     }

diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 32f09d2..2b7219a 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -2235,7 +2235,7 @@ cleanup:

 static int
 umlDomainOpenConsole(virDomainPtr dom,
-                     const char *devname,
+                     const char *dev_name,
                      virStreamPtr st,
                      unsigned int flags)
 {
@@ -2262,7 +2262,7 @@ umlDomainOpenConsole(virDomainPtr dom,
         goto cleanup;
     }

-    if (devname) {
+    if (dev_name) {
         /* XXX support device aliases in future */
         umlReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                        _("Named device aliases are not supported"));
@@ -2276,13 +2276,13 @@ umlDomainOpenConsole(virDomainPtr dom,

     if (!chr) {
         umlReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("cannot find character device %s"), devname);
+                        _("cannot find character device %s"), dev_name);
         goto cleanup;
     }

     if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
         umlReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("character device %s is not using a PTY"), devname);
+                        _("character device %s is not using a PTY"), dev_name);
         goto cleanup;
     }

diff --git a/src/util/util.c b/src/util/util.c
index 9556bdb..1ff287d 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -2455,11 +2455,11 @@ virTimeMs(unsigned long long *ms)

 #if HAVE_LIBDEVMAPPER_H
 bool
-virIsDevMapperDevice(const char *devname)
+virIsDevMapperDevice(const char *dev_name)
 {
     struct stat buf;

-    if (!stat(devname, &buf) &&
+    if (!stat(dev_name, &buf) &&
         S_ISBLK(buf.st_mode) &&
         dm_is_dm_major(major(buf.st_rdev)))
             return true;
@@ -2467,7 +2467,7 @@ virIsDevMapperDevice(const char *devname)
     return false;
 }
 #else
-bool virIsDevMapperDevice(const char *devname ATTRIBUTE_UNUSED)
+bool virIsDevMapperDevice(const char *dev_name ATTRIBUTE_UNUSED)
 {
     return false;
 }
diff --git a/src/util/util.h b/src/util/util.h
index 908ba7b..c55e852 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -255,7 +255,7 @@ char *virTimestamp(void);

 int virTimeMs(unsigned long long *ms) ATTRIBUTE_NONNULL(1);

-bool virIsDevMapperDevice(const char *devname) ATTRIBUTE_NONNULL(1);
+bool virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);

 int virEmitXMLWarning(int fd,
                       const char *name,
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 2c66143..9c96fca 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -2119,7 +2119,7 @@ out:

 static int
 xenUnifiedDomainOpenConsole(virDomainPtr dom,
-                            const char *devname,
+                            const char *dev_name,
                             virStreamPtr st,
                             unsigned int flags)
 {
@@ -2135,7 +2135,7 @@ xenUnifiedDomainOpenConsole(virDomainPtr dom,
         goto cleanup;
     }

-    if (devname) {
+    if (dev_name) {
         /* XXX support device aliases in future */
         xenUnifiedError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                         _("Named device aliases are not supported"));
@@ -2159,7 +2159,7 @@ xenUnifiedDomainOpenConsole(virDomainPtr dom,

     if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
         xenUnifiedError(VIR_ERR_INTERNAL_ERROR,
-                        _("character device %s is not using a PTY"), devname);
+                        _("character device %s is not using a PTY"), dev_name);
         goto cleanup;
     }

diff --git a/tools/console.c b/tools/console.c
index 82ef537..0f85bc7 100644
--- a/tools/console.c
+++ b/tools/console.c
@@ -278,7 +278,7 @@ virConsoleEventOnStdout(int watch ATTRIBUTE_UNUSED,
 }


-int vshRunConsole(virDomainPtr dom, const char *devname)
+int vshRunConsole(virDomainPtr dom, const char *dev_name)
 {
     int ret = -1;
     struct termios ttyattr, rawattr;
@@ -331,7 +331,7 @@ int vshRunConsole(virDomainPtr dom, const char *devname)
     if (!con->st)
         goto cleanup;

-    if (virDomainOpenConsole(dom, devname, con->st, 0) < 0)
+    if (virDomainOpenConsole(dom, dev_name, con->st, 0) < 0)
         goto cleanup;

     con->stdinWatch = virEventAddHandle(STDIN_FILENO,
diff --git a/tools/console.h b/tools/console.h
index 580268d..9b05ff1 100644
--- a/tools/console.h
+++ b/tools/console.h
@@ -25,7 +25,7 @@

 # ifndef WIN32

-int vshRunConsole(virDomainPtr dom, const char *devname);
+int vshRunConsole(virDomainPtr dom, const char *dev_name);

 # endif /* !WIN32 */

-- 
1.7.3.4


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