[PATCH 0/3] cimtest: Changes for live.full_hostname
by John Ferlan
Series of patches to close the loop on prior set of cimtest changes:
http://www.redhat.com/archives/libvirt-cim/2014-April/msg00002.html
Based primarily on feedback/investigation done as part of a prior
cimtest commit:
http://www.redhat.com/archives/libvirt-cim/2014-May/msg00012.html
Patch 1 of 3 modifies the full_hostname() call to use getfqdn() only. A
prior patch would attempt the gethostname() if something failed, but as
seen through the documentation of the in the above link - thats also a
fallback for getfqdn().
Patches 2&3 remove the check_sblim() usage. See the commit messages for
details.
John Ferlan (3):
live.full_hostname: Adjust mechanism to get FQDN
HostSystem: Remove call to check_sblim
XenKvmLib: Remove check_sblim()
lib/VirtLib/live.py | 6 +--
.../cimtest/ElementConforms/04_ectp_rev_errs.py | 2 +-
suites/libvirt-cim/cimtest/HostSystem/01_enum.py | 56 +++++++---------------
.../cimtest/HostSystem/03_hs_to_settdefcap.py | 2 +-
suites/libvirt-cim/lib/XenKvmLib/common_util.py | 28 -----------
suites/libvirt-cim/lib/XenKvmLib/vxml.py | 2 +-
6 files changed, 24 insertions(+), 72 deletions(-)
--
1.9.0
10 years, 4 months
[PATCH] libxutil: Fix memory device dumpCore field parsing
by Xu Wang
Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
libxkutil/device_parsing.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
index d654a6a..815feea 100644
--- a/libxkutil/device_parsing.c
+++ b/libxkutil/device_parsing.c
@@ -850,9 +850,9 @@ static int parse_mem_device(xmlNode *node, struct virt_device **vdevs)
else if (XSTREQ(node->name, "memory")) {
sscanf(content, "%" PRIu64, &mdev->maxsize);
tmpval = get_attr_value(node, "dumpCore");
- if (tmpval && XSTREQ(tmpval, "on")) {
+ if (tmpval && STREQC(tmpval, "on")) {
mdev->dumpCore = MEM_DUMP_CORE_ON;
- } else if (tmpval && XSTREQ(content, "off")) {
+ } else if (tmpval && STREQC(tmpval, "off")) {
mdev->dumpCore = MEM_DUMP_CORE_OFF;
} else {
mdev->dumpCore = MEM_DUMP_CORE_NOT_SET;
--
1.7.1
10 years, 4 months
[PATCH] Complete the support for dumpCore
by Xu Wang
Add API support for dumpCore field of Memory devices.
Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
libxkutil/device_parsing.c | 1 +
schema/ResourceAllocationSettingData.mof | 3 +++
src/Virt_RASD.c | 8 ++++++++
src/Virt_VirtualSystemManagementService.c | 11 +++++++++++
4 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
index f863cc5..d654a6a 100644
--- a/libxkutil/device_parsing.c
+++ b/libxkutil/device_parsing.c
@@ -1438,6 +1438,7 @@ struct virt_device *virt_device_dup(struct virt_device *_dev)
} else if (dev->type == CIM_RES_TYPE_MEM) {
dev->dev.mem.size = _dev->dev.mem.size;
dev->dev.mem.maxsize = _dev->dev.mem.maxsize;
+ dev->dev.mem.dumpCore = _dev->dev.mem.dumpCore;
} else if (dev->type == CIM_RES_TYPE_PROC) {
dev->dev.vcpu.quantity = _dev->dev.vcpu.quantity;
} else if (dev->type == CIM_RES_TYPE_EMU) {
diff --git a/schema/ResourceAllocationSettingData.mof b/schema/ResourceAllocationSettingData.mof
index 9c387f0..11a444f 100644
--- a/schema/ResourceAllocationSettingData.mof
+++ b/schema/ResourceAllocationSettingData.mof
@@ -229,6 +229,9 @@ class Xen_MemResourceAllocationSettingData : Xen_ResourceAllocationSettingData
]
class KVM_MemResourceAllocationSettingData : KVM_ResourceAllocationSettingData
{
+ [Description ("dumpCore could be set as 'on' or 'off'. "
+ "it also could be leave null.")]
+ boolean dumpCore;
};
[Description ("LXC virtual memory"),
diff --git a/src/Virt_RASD.c b/src/Virt_RASD.c
index 3c62c2d..691fff9 100644
--- a/src/Virt_RASD.c
+++ b/src/Virt_RASD.c
@@ -1044,6 +1044,14 @@ CMPIInstance *rasd_from_vdev(const CMPIBroker *broker,
(CMPIValue *)&dev->dev.mem.size, CMPI_uint64);
CMSetProperty(inst, "Limit",
(CMPIValue *)&dev->dev.mem.maxsize, CMPI_uint64);
+
+ if (dev->dev.mem.dumpCore != MEM_DUMP_CORE_NOT_SET) {
+ bool dumpCore = true;
+ if (dev->dev.mem.dumpCore == MEM_DUMP_CORE_OFF)
+ dumpCore = false;
+ CMSetProperty(inst, "dumpCore",
+ (CMPIValue *)&dumpCore, CMPI_boolean);
+ }
} else if (dev->type == CIM_RES_TYPE_PROC) {
set_proc_rasd_params(broker, ref, dev, host, inst);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c
index f673c38..f228a73 100644
--- a/src/Virt_VirtualSystemManagementService.c
+++ b/src/Virt_VirtualSystemManagementService.c
@@ -1236,6 +1236,17 @@ static const char *mem_rasd_to_vdev(CMPIInstance *inst,
const char *units;
CMPIrc ret;
int shift;
+ bool dumpCore;
+
+ ret = cu_get_bool_prop(inst, "dumpCore", &dumpCore);
+ if (ret != CMPI_RC_OK) {
+ dev->dev.mem.dumpCore = MEM_DUMP_CORE_NOT_SET;
+ } else {
+ if (dumpCore)
+ dev->dev.mem.dumpCore = MEM_DUMP_CORE_ON;
+ else
+ dev->dev.mem.dumpCore = MEM_DUMP_CORE_OFF;
+ }
ret = cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size);
if (ret != CMPI_RC_OK)
--
1.7.1
10 years, 4 months
[PATCH V2] Add disk device='lun' support
by Xu Wang
Besides 'disk', 'cdrom', 'floppy' and 'filesystem', there is one
more value 'lun' should be supported by value of device field in
the disk device. So this patch adds it into libvirt-cim. Now device
like <disk type='block' device='lun'> could be operated by class.
Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
schema/ResourceAllocationSettingData.mof | 8 ++++----
src/Virt_RASD.c | 3 +++
src/Virt_RASD.h | 1 +
src/Virt_SettingsDefineCapabilities.c | 3 ++-
src/Virt_VirtualSystemManagementService.c | 5 ++++-
5 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/schema/ResourceAllocationSettingData.mof b/schema/ResourceAllocationSettingData.mof
index 9c387f0..f78d423 100644
--- a/schema/ResourceAllocationSettingData.mof
+++ b/schema/ResourceAllocationSettingData.mof
@@ -10,8 +10,8 @@ class Xen_DiskResourceAllocationSettingData : Xen_ResourceAllocationSettingData
string VirtualDevice;
[Description ("Device emulation type"),
- ValueMap {"0", "1", "2"},
- Values {"Disk", "CDROM", "floppy"}]
+ ValueMap {"0", "1", "2", "4"},
+ Values {"Disk", "CDROM", "floppy", "lun"}]
uint16 EmulatedType;
[Description ("Bus type of the device")]
@@ -43,8 +43,8 @@ class KVM_DiskResourceAllocationSettingData : KVM_ResourceAllocationSettingData
string VirtualDevice;
[Description ("Device emulation type"),
- ValueMap {"0", "1", "2", "3"},
- Values {"Disk", "CDROM", "floppy", "filesystem"}]
+ ValueMap {"0", "1", "2", "3", "4"},
+ Values {"Disk", "CDROM", "floppy", "filesystem", "lun"}]
uint16 EmulatedType;
[Description ("Bus type of the device")]
diff --git a/src/Virt_RASD.c b/src/Virt_RASD.c
index 3c62c2d..761d053 100644
--- a/src/Virt_RASD.c
+++ b/src/Virt_RASD.c
@@ -444,6 +444,9 @@ static CMPIStatus set_disk_rasd_params(const CMPIBroker *broker,
else if ((dev->dev.disk.device != NULL) &&
STREQ(dev->dev.disk.device, "floppy"))
type = VIRT_DISK_TYPE_FLOPPY;
+ else if ((dev->dev.disk.device != NULL) &&
+ STREQ(dev->dev.disk.device, "lun"))
+ type = VIRT_DISK_TYPE_LUN;
else
type = VIRT_DISK_TYPE_DISK;
diff --git a/src/Virt_RASD.h b/src/Virt_RASD.h
index 400143f..49d7195 100644
--- a/src/Virt_RASD.h
+++ b/src/Virt_RASD.h
@@ -27,6 +27,7 @@
#define VIRT_DISK_TYPE_CDROM 1
#define VIRT_DISK_TYPE_FLOPPY 2
#define VIRT_DISK_TYPE_FS 3
+#define VIRT_DISK_TYPE_LUN 4
char *rasd_to_xml(CMPIInstance *rasd);
diff --git a/src/Virt_SettingsDefineCapabilities.c b/src/Virt_SettingsDefineCapabilities.c
index 756e46b..49986ff 100644
--- a/src/Virt_SettingsDefineCapabilities.c
+++ b/src/Virt_SettingsDefineCapabilities.c
@@ -1071,7 +1071,8 @@ static CMPIStatus set_disk_props(int type,
(CMPIValue *)"FV disk", CMPI_chars);
}
- if (emu_type == VIRT_DISK_TYPE_DISK) {
+ if (emu_type == VIRT_DISK_TYPE_DISK ||
+ emu_type == VIRT_DISK_TYPE_LUN) {
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&disk_size, CMPI_uint64);
} else if (emu_type == VIRT_DISK_TYPE_CDROM) {
diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c
index f673c38..c640360 100644
--- a/src/Virt_VirtualSystemManagementService.c
+++ b/src/Virt_VirtualSystemManagementService.c
@@ -1114,7 +1114,8 @@ static const char *disk_rasd_to_vdev(CMPIInstance *inst,
type = VIRT_DISK_TYPE_DISK;
if ((type == VIRT_DISK_TYPE_DISK) ||
- (type == VIRT_DISK_TYPE_FS)){
+ (type == VIRT_DISK_TYPE_FS) ||
+ (type == VIRT_DISK_TYPE_LUN)){
if (dev->dev.disk.disk_type == DISK_UNKNOWN) {
/* on success or fail caller should try free it */
rc = asprintf(p_error, "Device %s, Address %s, "
@@ -1149,6 +1150,8 @@ static const char *disk_rasd_to_vdev(CMPIInstance *inst,
dev->dev.disk.device = strdup("floppy");
else if (type == VIRT_DISK_TYPE_FS)
dev->dev.disk.device = strdup("filesystem");
+ else if (type == VIRT_DISK_TYPE_LUN)
+ dev->dev.disk.device = strdup("lun");
else
return "Invalid value for EmulatedType";
--
1.7.1
10 years, 4 months