Re: [PATCH v2 4/9] qemu: Make QEMU_DRIVE_HOST_PREFIX more private

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

 



On Tue, Jul 19, 2016 at 10:30:47AM -0400, John Ferlan wrote:
Move QEMU_DRIVE_HOST_PREFIX into the qemu_alias.c to disuade future

s/disuade/dissuade/

disuade is the Spanish spelling. I know that because I had to look it up
in the dictionary anyway.

callers from using it. Create qemuAliasDeviceDiskDriveSkipPrefix in
order to handle the current consumers that desire to check if an alias
has the drive- prefix and "get beyond it" in order to get the disk alias.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
src/qemu/qemu_alias.c        | 17 +++++++++++++++++
src/qemu/qemu_alias.h        |  4 ++--
src/qemu/qemu_domain.c       |  3 +--
src/qemu/qemu_monitor_json.c |  6 ++----
src/qemu/qemu_monitor_text.c |  8 +++-----
src/qemu/qemu_process.c      |  3 +--
6 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c
index 70cd9f1..d80537b 100644
--- a/src/qemu/qemu_alias.c
+++ b/src/qemu/qemu_alias.c
@@ -29,6 +29,8 @@
#include "virstring.h"
#include "network/bridge_driver.h"

+#define QEMU_DRIVE_HOST_PREFIX "drive-"
+
#define VIR_FROM_THIS VIR_FROM_QEMU

VIR_LOG_INIT("qemu.qemu_alias");
@@ -188,6 +190,21 @@ qemuAssignDeviceDiskDriveAlias(const char *srcalias)
}


+/* qemuAliasDeviceDiskDriveSkipPrefix:
+ * @dev_name: Pointer to a const char string
+ *
+ * If the QEMU_DRIVE_HOST_PREFIX exists in the input string, then
+ * increment the pointer and return it
+ */
+const char *
+qemuAliasDeviceDiskDriveSkipPrefix(const char *dev_name)

I think you can drop the Device without hurting readability.

Jan

--
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]