On 12/11/2012 07:53 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Introduce a 'virArch' enum for CPU architectures. Include
data type providing wordsize and endianness, and APIs to
query this info and convert to/from enum and string form.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
+/**
+ * virArchFromString:
+ * @archstr: the CPU architecture string
+ *
+ * Return the architecture matching @archstr,
+ * defaulting to VIR_ARCH_I686 if unidentified
Really?
+ */
+virArch virArchFromString(const char *archstr)
+{
+ size_t i;
+ for (i = 1 ; i < VIR_ARCH_LAST ; i++) {
+ if (STREQ(virArchData[i].name, archstr))
+ return i;
+ }
+
+ VIR_DEBUG("Unknown arch %s", archstr);
+ return VIR_ARCH_NONE;
Looks like you return NONE instead.
Other than the mixed-up comment, looks good to go after 1.0.1.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org