[PATCH] (#3) add sdl frame buffer support
by Wayne Xia
# HG changeset patch
# User Wayne Xia <xiawenc(a)linux.vnet.ibm.com>
# Date 1311670971 -28800
# Node ID d0bb7e93d02d3bd55d9b984165db0265c9865462
# Parent 792db1a6ead075375fad4a7d22143a0f978b5e48
(#3) add sdl frame buffer support.
Now libvirt still supports sdl frame buffer, and it may take three
parameters: display,xauth,fullscreen. This patch enable the libvirt-cim
to accept these configuration and pass them in XML define to let
libvirt know about it. Exposed interface could be found in the file
ResourceAllocationSettingData.mof.
https://bugzilla.linux.ibm.com/show_bug.cgi?id=71347
Signed-off-by: Wayne Xia (Wayne) <xiawenc(a)linux.vnet.ibm.com>
diff -r 792db1a6ead0 -r d0bb7e93d02d libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Jul 25 19:39:08 2011 +0800
+++ b/libxkutil/device_parsing.c Tue Jul 26 17:02:51 2011 +0800
@@ -538,6 +538,11 @@
if (gdev->dev.vnc.port == NULL || gdev->dev.vnc.host == NULL)
goto err;
}
+ else if (STREQC(gdev->type, "sdl")) {
+ gdev->dev.sdl.display = get_attr_value(node, "display");
+ gdev->dev.sdl.xauth = get_attr_value(node, "xauth");
+ gdev->dev.sdl.fullscreen = get_attr_value(node, "fullscreen");
+ }
else if (STREQC(gdev->type, "pty")) {
if (node->name == NULL)
goto err;
diff -r 792db1a6ead0 -r d0bb7e93d02d libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Mon Jul 25 19:39:08 2011 +0800
+++ b/libxkutil/xmlgen.c Tue Jul 26 17:02:51 2011 +0800
@@ -421,8 +421,21 @@
xmlNewProp(tmp, BAD_CAST "type", BAD_CAST dev->type);
- if (STREQC(dev->type, "sdl"))
- return NULL;
+ if (STREQC(dev->type, "sdl")) {
+ if (dev->dev.sdl.display) {
+ xmlNewProp(tmp, BAD_CAST "display",
+ BAD_CAST dev->dev.sdl.display);
+ }
+ if (dev->dev.sdl.xauth) {
+ xmlNewProp(tmp, BAD_CAST "xauth",
+ BAD_CAST dev->dev.sdl.xauth);
+ }
+ if (dev->dev.sdl.fullscreen) {
+ xmlNewProp(tmp, BAD_CAST "fullscreen",
+ BAD_CAST dev->dev.sdl.fullscreen);
+ }
+ return NULL;
+ }
if (dev->dev.vnc.port) {
xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->dev.vnc.port);
diff -r 792db1a6ead0 -r d0bb7e93d02d schema/ResourceAllocationSettingData.mof
--- a/schema/ResourceAllocationSettingData.mof Mon Jul 25 19:39:08 2011 +0800
+++ b/schema/ResourceAllocationSettingData.mof Tue Jul 26 17:02:51 2011 +0800
@@ -219,7 +219,9 @@
[Description ("If ResourceSubType is 'vnc', this is a VNC Address. "
"IPv4 in a.b.c.d:port or IPv6 in [ip]:port format. If ResourceSubType "
"is 'console', this is a character device path in "
- "path:port format (e.g., '/dev/pts/3:0'\)")]
+ "path:port format (e.g., '/dev/pts/3:0'\) "
+ "if ResourceSubType is 'sdl', this is a combination of its params as "
+ "xauth:display (e.g., '/root/.Xauthority::0'\)")]
string Address;
[Description ("Keyboard keymapping")]
@@ -228,7 +230,8 @@
[Description ("VNC password")]
string Password;
- [Description ("Is IPv6 only addressing is to be used")]
+ [Description ("Is IPv6 only addressing is to be used."
+ "if ResourceSubType is 'sdl', this means whether sdl is fullscreen")]
boolean IsIPv6Only;
};
diff -r 792db1a6ead0 -r d0bb7e93d02d src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Jul 25 19:39:08 2011 +0800
+++ b/src/Virt_VirtualSystemManagementService.c Tue Jul 26 17:02:51 2011 +0800
@@ -1060,6 +1060,52 @@
return ret;
}
+static int parse_sdl_address(const char *id,
+ char **display,
+ char **xauth)
+{
+ int ret;
+ char *tmp_display = NULL;
+ char *tmp_xauth = NULL;
+
+ CU_DEBUG("Entering parse_sdl_address, address is %s", id);
+
+ ret = sscanf(id, "%a[^:]:%as", &tmp_xauth, &tmp_display);
+
+ if (ret <= 0) {
+ ret = sscanf(id, ":%as", &tmp_display);
+ if (ret <= 0) {
+ if (STREQC(id, ":")) {
+ /* do nothing, it is empty */
+ }
+ else {
+ ret = 0;
+ goto out;
+ }
+ }
+ }
+
+ if (display) {
+ if (tmp_display == NULL)
+ *display = NULL;
+ else
+ *display = strdup(tmp_display);
+ }
+ if (xauth) {
+ if (tmp_xauth == NULL)
+ *xauth = NULL;
+ else
+ *xauth = strdup(tmp_xauth);
+ }
+ ret = 1;
+
+ out:
+ CU_DEBUG("Exiting parse_sdl_address, display is %s, xauth is %s",
+ *display, *xauth);
+
+ return ret;
+}
+
static int parse_vnc_address(const char *id,
char **ip,
char **port)
@@ -1163,6 +1209,30 @@
msg = "GraphicsRASD field Address not valid";
goto out;
}
+ }
+ else if (STREQC(dev->dev.graphics.type, "sdl")) {
+ if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {
+ CU_DEBUG("sdl graphics Address empty, using default");
+ dev->dev.graphics.dev.sdl.display = NULL;
+ dev->dev.graphics.dev.sdl.xauth = NULL;
+ }
+ else {
+ ret = parse_sdl_address(val,
+ &dev->dev.graphics.dev.sdl.display,
+ &dev->dev.graphics.dev.sdl.xauth);
+ if (ret != 1) {
+ msg = "GraphicsRASD sdl Address not valid";
+ goto out;
+ }
+ }
+ dev->dev.graphics.dev.sdl.fullscreen = NULL;
+ if (cu_get_bool_prop(inst, "IsIPV6Only", &ipv6) ==
+ CMPI_RC_OK) {
+ if (ipv6)
+ dev->dev.graphics.dev.sdl.fullscreen = strdup("yes");
+ else
+ dev->dev.graphics.dev.sdl.fullscreen = strdup("no");
+ }
} else {
CU_DEBUG("Unsupported graphics type %s",
dev->dev.graphics.type);
@@ -1171,7 +1241,8 @@
}
free(dev->id);
- if (STREQC(dev->dev.graphics.type, "vnc"))
+ if ((STREQC(dev->dev.graphics.type, "vnc"))||
+ (STREQC(dev->dev.graphics.type, "sdl")))
ret = asprintf(&dev->id, "%s", dev->dev.graphics.type);
else
ret = asprintf(&dev->id, "%s:%s",
13 years
[PATCH] bug fix: KVM_MemResourceAllocationSettingData does not conform to profile
by Wayne Xia
# HG changeset patch
# User Wayne Xia <xiawenc(a)linux.vnet.ibm.com>
# Date 1311231387 -28800
# Node ID 677867c3d2a16a97591bde2828808f9f39b859a7
# Parent 3c90a88a5199a4ed931a4a76097cff8f55deae41
changed a bit to make it conform to CIM profile
According to the discuss and profile, the reserved property means the
memory actually allocated to support the VM running, and the unit
should be byte*2^10. This patch added some code to retrieve VM's state,
and the report the memory status according to that.
https://bugzilla.linux.ibm.com/show_bug.cgi?id=72759
Signed-off-by: Wayne Xia <xiawenc(a)linux.vnet.ibm.com>
diff -r 3c90a88a5199 -r 677867c3d2a1 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Jul 18 11:13:40 2011 -0300
+++ b/libxkutil/device_parsing.c Thu Jul 21 14:56:27 2011 +0800
@@ -792,6 +792,7 @@
} 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.reserved = _dev->dev.mem.reserved;
} else if (dev->type == CIM_RES_TYPE_PROC) {
dev->dev.vcpu.quantity = _dev->dev.vcpu.quantity;
} else if (dev->type == CIM_RES_TYPE_EMU) {
@@ -885,8 +886,22 @@
if (xml == NULL)
return 0;
- if (type == CIM_RES_TYPE_MEM)
+ if (type == CIM_RES_TYPE_MEM) {
ret = _get_mem_device(xml, list);
+ if (*list != NULL) {
+ virDomainInfo dom_info;
+ if (virDomainGetInfo(dom, &dom_info) == 0) {
+ (*list)->dev.mem.reserved = dom_info.memory;
+ if (dom_info.state == 5) { /* VM not active */
+ (*list)->dev.mem.reserved = 0;
+ }
+ }
+ else {
+ CU_DEBUG("failed to get dom state for mem");
+ ret = -1;
+ }
+ }
+ }
else if (type == CIM_RES_TYPE_PROC)
ret = _get_proc_device(xml, list);
else
diff -r 3c90a88a5199 -r 677867c3d2a1 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Mon Jul 18 11:13:40 2011 -0300
+++ b/libxkutil/device_parsing.h Thu Jul 21 14:56:27 2011 +0800
@@ -71,6 +71,7 @@
struct mem_device {
uint64_t size;
uint64_t maxsize;
+ uint64_t reserved;
};
struct vcpu_device {
diff -r 3c90a88a5199 -r 677867c3d2a1 src/Virt_RASD.c
--- a/src/Virt_RASD.c Mon Jul 18 11:13:40 2011 -0300
+++ b/src/Virt_RASD.c Thu Jul 21 14:56:27 2011 +0800
@@ -576,14 +576,14 @@
inst);
} else if (dev->type == CIM_RES_TYPE_MEM) {
- const char *units = "KiloBytes";
+ const char *units = "byte*2^10";
CMSetProperty(inst, "AllocationUnits",
(CMPIValue *)units, CMPI_chars);
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&dev->dev.mem.size,
CMPI_uint64);
CMSetProperty(inst, "Reservation",
- (CMPIValue *)&dev->dev.mem.size,
CMPI_uint64);
+ (CMPIValue *)&dev->dev.mem.reserved,
CMPI_uint64);
CMSetProperty(inst, "Limit",
(CMPIValue *)&dev->dev.mem.maxsize,
CMPI_uint64);
} else if (dev->type == CIM_RES_TYPE_PROC) {
13 years, 1 month
[PATCH] New entry "poolid" was not getting DUPed
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1311797923 25200
# Node ID 5dc300d4dfd7b9741a6086e4e5b8da632bcdcd2d
# Parent 0f42cab9c45c53cc13407b16418399ed8ed4a026
New entry "poolid" was not getting DUPed.
A recent patch added support for network poolid,
but missed to add DUP for it. This patch fixes the
issue.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 0f42cab9c45c -r 5dc300d4dfd7 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Jul 25 13:14:22 2011 -0700
+++ b/libxkutil/device_parsing.c Wed Jul 27 13:18:43 2011 -0700
@@ -775,6 +775,7 @@
DUP_FIELD(dev, _dev, dev.net.type);
DUP_FIELD(dev, _dev, dev.net.source);
DUP_FIELD(dev, _dev, dev.net.model);
+ DUP_FIELD(dev, _dev, dev.net.poolid);
DUP_FIELD(dev, _dev, dev.net.device);
DUP_FIELD(dev, _dev, dev.net.net_mode);
DUP_FIELD(dev, _dev, dev.net.filter_ref);
13 years, 1 month
[PATCH] [TEST] Reduce the length of bridge name
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1311878184 25200
# Node ID 8c23ed99a218f1d1eea5c662b2fa3c211fe6d531
# Parent 3bc1a0fc5683d705c022014364cacf6d5860ba28
[TEST] Reduce the length of bridge name.
Lately I have seen this
(VirtualSystemManagementService - 06_addresource.py) test
fails with following error -
# virsh -c qemu:///system net-create /home/net.xml
error: Failed to create network from /home/net.xml
error: cannot create dummy tap device 'testbridge55-nic' to set mac address on bridge 'testbridge55': Invalid argument
Reducing the size of bridge name fixed this issue. I looked on
the net but could not find more info on when this behaviour
changed in libvirt.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 3bc1a0fc5683 -r 8c23ed99a218 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Jul 12 16:02:27 2011 -0300
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Thu Jul 28 11:36:24 2011 -0700
@@ -58,7 +58,7 @@
# vxml.NetXML
-default_bridge_name = 'testbridge'
+default_bridge_name = 'testbr'
default_network_name = 'cimtest-networkpool'
default_net_type = 'network'
13 years, 1 month
[PATCH] [TEST] Update RASDIndication test to use "vnc" instead of "graphics"
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1311864875 25200
# Node ID 3c23103a2ca19d6cf66d84a7d87f4dd93e2d609f
# Parent 3bc1a0fc5683d705c022014364cacf6d5860ba28
[TEST] Update RASDIndication test to use "vnc" instead of "graphics"
Graphics RASDs now include support for serial/consoel devices, which
includes support for unqiue InstanceIDs. This patch updates the test
to look for <vm_name>/vnc where is used to just look for graphics
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 3bc1a0fc5683 -r 3c23103a2ca1 suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py
--- a/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py Tue Jul 12 16:02:27 2011 -0300
+++ b/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py Thu Jul 28 07:54:35 2011 -0700
@@ -108,7 +108,7 @@
elif ind_name == 'delete':
cn = 'GraphicsResourceAllocationSettingData'
- inst_id = '%s/%s' % (test_dom, "graphics")
+ inst_id = '%s/%s' % (test_dom, "vnc")
classname = get_typed_class(virt, cn)
nrasd = get_rasd_rec(virt, cn, s_sysname, inst_id)
13 years, 1 month
[PATCH] (#3) made the graphic structure as union
by Wayne Xia
# HG changeset patch
# User Wayne Xia <xiawenc(a)linux.vnet.ibm.com>
# Date 1311593948 -28800
# Node ID 792db1a6ead075375fad4a7d22143a0f978b5e48
# Parent 0f42cab9c45c53cc13407b16418399ed8ed4a026
(#3) made the graphic structure as union
These change were made to allow SDL device properties added more clearly
Signed-off-by: Wayne Xia (Wayne) <xiawenc(a)linux.vnet.ibm.com>
diff -r 0f42cab9c45c -r 792db1a6ead0 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Jul 25 13:14:22 2011 -0700
+++ b/libxkutil/device_parsing.c Mon Jul 25 19:39:08 2011 +0800
@@ -91,10 +91,10 @@
static void cleanup_graphics_device(struct graphics_device *dev)
{
free(dev->type);
- free(dev->port);
- free(dev->host);
- free(dev->keymap);
- free(dev->passwd);
+ free(dev->dev.vnc.port);
+ free(dev->dev.vnc.host);
+ free(dev->dev.vnc.keymap);
+ free(dev->dev.vnc.passwd);
}
static void cleanup_input_device(struct input_device *dev)
@@ -530,12 +530,12 @@
CU_DEBUG("graphics device type = %s", gdev->type);
if (STREQC(gdev->type, "vnc")) {
- gdev->port = get_attr_value(node, "port");
- gdev->host = get_attr_value(node, "listen");
- gdev->keymap = get_attr_value(node, "keymap");
- gdev->passwd = get_attr_value(node, "passwd");
+ gdev->dev.vnc.port = get_attr_value(node, "port");
+ gdev->dev.vnc.host = get_attr_value(node, "listen");
+ gdev->dev.vnc.keymap = get_attr_value(node, "keymap");
+ gdev->dev.vnc.passwd = get_attr_value(node, "passwd");
- if (gdev->port == NULL || gdev->host == NULL)
+ if (gdev->dev.vnc.port == NULL || gdev->dev.vnc.host == NULL)
goto err;
}
else if (STREQC(gdev->type, "pty")) {
@@ -550,9 +550,9 @@
for (child = node->children; child != NULL;
child = child->next) {
if (XSTREQ(child->name, "source"))
- gdev->host = get_attr_value(child, "path");
+ gdev->dev.vnc.host = get_attr_value(child, "path");
else if (XSTREQ(child->name, "target"))
- gdev->port = get_attr_value(child, "port");
+ gdev->dev.vnc.port = get_attr_value(child, "port");
}
}
else {
@@ -565,7 +565,7 @@
if (STREQC(gdev->type, "vnc"))
ret = asprintf(&vdev->id, "%s", gdev->type);
else
- ret = asprintf(&vdev->id, "%s:%s", gdev->type, gdev->port);
+ ret = asprintf(&vdev->id, "%s:%s", gdev->type, gdev->dev.vnc.port);
if (ret == -1) {
CU_DEBUG("Failed to create graphics is string");
@@ -806,10 +806,10 @@
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
DUP_FIELD(dev, _dev, dev.graphics.type);
- DUP_FIELD(dev, _dev, dev.graphics.port);
- DUP_FIELD(dev, _dev, dev.graphics.host);
- DUP_FIELD(dev, _dev, dev.graphics.keymap);
- DUP_FIELD(dev, _dev, dev.graphics.passwd);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.host);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.port);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.keymap);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.passwd);
} else if (dev->type == CIM_RES_TYPE_INPUT) {
DUP_FIELD(dev, _dev, dev.input.type);
DUP_FIELD(dev, _dev, dev.input.bus);
diff -r 0f42cab9c45c -r 792db1a6ead0 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Mon Jul 25 13:14:22 2011 -0700
+++ b/libxkutil/device_parsing.h Mon Jul 25 19:39:08 2011 +0800
@@ -84,14 +84,28 @@
char *path;
};
-struct graphics_device {
- char *type;
+//vnc_device must be larger or equal than sdl_device
+struct vnc_device {
char *port;
char *host;
char *keymap;
char *passwd;
};
+struct sdl_device {
+ char *display;
+ char *xauth;
+ char *fullscreen;
+};
+
+struct graphics_device {
+ char *type;
+ union {
+ struct vnc_device vnc;
+ struct sdl_device sdl;
+ } dev;
+};
+
struct input_device {
char *type;
char *bus;
diff -r 0f42cab9c45c -r 792db1a6ead0 libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Mon Jul 25 13:14:22 2011 -0700
+++ b/libxkutil/xml_parse_test.c Mon Jul 25 19:39:08 2011 +0800
@@ -116,7 +116,7 @@
FILE *d)
{
print_value(d, "Graphics Type", dev->dev.graphics.type);
- print_value(d, "Graphics Port", dev->dev.graphics.port);
+ print_value(d, "Graphics Port", dev->dev.graphics.dev.vnc.port);
}
static void print_devices(struct domain *dominfo,
diff -r 0f42cab9c45c -r 792db1a6ead0 libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Mon Jul 25 13:14:22 2011 -0700
+++ b/libxkutil/xmlgen.c Mon Jul 25 19:39:08 2011 +0800
@@ -424,22 +424,22 @@
if (STREQC(dev->type, "sdl"))
return NULL;
- if (dev->port) {
- xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port);
- if (STREQC(dev->port, "-1"))
+ if (dev->dev.vnc.port) {
+ xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->dev.vnc.port);
+ if (STREQC(dev->dev.vnc.port, "-1"))
xmlNewProp(tmp, BAD_CAST "autoport", BAD_CAST "yes");
else
xmlNewProp(tmp, BAD_CAST "autoport", BAD_CAST "no");
}
- if (dev->host)
- xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->host);
+ if (dev->dev.vnc.host)
+ xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->dev.vnc.host);
- if (dev->passwd)
- xmlNewProp(tmp, BAD_CAST "passwd", BAD_CAST dev->passwd);
+ if (dev->dev.vnc.passwd)
+ xmlNewProp(tmp, BAD_CAST "passwd", BAD_CAST dev->dev.vnc.passwd);
- if (dev->keymap)
- xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST dev->keymap);
+ if (dev->dev.vnc.keymap)
+ xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST dev->dev.vnc.keymap);
return NULL;
}
@@ -459,16 +459,16 @@
tmp = xmlNewChild(pty, NULL, BAD_CAST "source", NULL);
if (tmp == NULL)
return XML_ERROR;
-
- if(dev->host)
- xmlNewProp(tmp, BAD_CAST "path", BAD_CAST dev->host);
+
+ if(dev->dev.vnc.host)
+ xmlNewProp(tmp, BAD_CAST "path", BAD_CAST dev->dev.vnc.host);
tmp = xmlNewChild(pty, NULL, BAD_CAST "target", NULL);
if (tmp == NULL)
return XML_ERROR;
-
- if(dev->port)
- xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port);
+
+ if(dev->dev.vnc.port)
+ xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->dev.vnc.port);
return NULL;
}
diff -r 0f42cab9c45c -r 792db1a6ead0 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Mon Jul 25 13:14:22 2011 -0700
+++ b/src/Virt_ComputerSystem.c Mon Jul 25 19:39:08 2011 +0800
@@ -104,7 +104,7 @@
"Virtual System (Console on %s://%s:%s)",
domain->dev_graphics[0].dev.graphics.type,
host,
- domain->dev_graphics[0].dev.graphics.port);
+ domain->dev_graphics[0].dev.graphics.dev.vnc.port);
else
ret = asprintf(&cap,
"Virtual System (No console)");
diff -r 0f42cab9c45c -r 792db1a6ead0 src/Virt_Device.c
--- a/src/Virt_Device.c Mon Jul 25 13:14:22 2011 -0700
+++ b/src/Virt_Device.c Mon Jul 25 19:39:08 2011 +0800
@@ -194,8 +194,8 @@
else
rc = asprintf(&vp_str, "%s/%s:%s",
dev->type,
- dev->host,
- dev->port);
+ dev->dev.vnc.host,
+ dev->dev.vnc.port);
if (rc == -1)
return 0;
diff -r 0f42cab9c45c -r 792db1a6ead0 src/Virt_KVMRedirectionSAP.c
--- a/src/Virt_KVMRedirectionSAP.c Mon Jul 25 13:14:22 2011 -0700
+++ b/src/Virt_KVMRedirectionSAP.c Mon Jul 25 19:39:08 2011 +0800
@@ -366,7 +366,7 @@
continue;
}
- ret = sscanf(dominfo->dev_graphics->dev.graphics.port,
+ ret = sscanf(dominfo->dev_graphics->dev.graphics.dev.vnc.port,
"%d",
&lport);
if (ret != 1) {
diff -r 0f42cab9c45c -r 792db1a6ead0 src/Virt_RASD.c
--- a/src/Virt_RASD.c Mon Jul 25 13:14:22 2011 -0700
+++ b/src/Virt_RASD.c Mon Jul 25 19:39:08 2011 +0800
@@ -481,9 +481,9 @@
rc = asprintf(&addr_str, "%s", dev->dev.graphics.type);
else {
rc = asprintf(&addr_str,
- "%s:%s",
- dev->dev.graphics.host,
- dev->dev.graphics.port);
+ "%s:%s",
+ dev->dev.graphics.dev.vnc.host,
+ dev->dev.graphics.dev.vnc.port);
}
CU_DEBUG("graphics Address = %s", addr_str);
@@ -496,7 +496,7 @@
if (STREQC(dev->dev.graphics.type, "vnc")) {
CMSetProperty(inst, "KeyMap",
- (CMPIValue *)dev->dev.graphics.keymap, CMPI_chars);
+ (CMPIValue *)dev->dev.graphics.dev.vnc.keymap, CMPI_chars);
conn = connect_by_classname(_BROKER, classname, &s);
if (conn == NULL)
@@ -511,7 +511,8 @@
goto out;
}
- if (dev->dev.graphics.passwd && strlen(dev->dev.graphics.passwd)) {
+ if (dev->dev.graphics.dev.vnc.passwd &&
+ strlen(dev->dev.graphics.dev.vnc.passwd)) {
CU_DEBUG("has password");
CMSetProperty(inst, "Password",
(CMPIValue *)"********", CMPI_chars);
diff -r 0f42cab9c45c -r 792db1a6ead0 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Jul 25 13:14:22 2011 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Mon Jul 25 19:39:08 2011 +0800
@@ -370,10 +370,10 @@
}
domain->dev_graphics->dev.graphics.type = strdup("vnc");
- domain->dev_graphics->dev.graphics.port = strdup("-1");
- domain->dev_graphics->dev.graphics.host = strdup("127.0.0.1");
- domain->dev_graphics->dev.graphics.keymap = strdup("en-us");
- domain->dev_graphics->dev.graphics.passwd = NULL;
+ domain->dev_graphics->dev.graphics.dev.vnc.port = strdup("-1");
+ domain->dev_graphics->dev.graphics.dev.vnc.host = strdup("127.0.0.1");
+ domain->dev_graphics->dev.graphics.dev.vnc.keymap = strdup("en-us");
+ domain->dev_graphics->dev.graphics.dev.vnc.passwd = NULL;
domain->dev_graphics_ct = 1;
return true;
@@ -1129,24 +1129,24 @@
}
ret = parse_vnc_address(val,
- &dev->dev.graphics.host,
- &dev->dev.graphics.port);
+ &dev->dev.graphics.dev.vnc.host,
+ &dev->dev.graphics.dev.vnc.port);
if (ret != 1) {
msg = "GraphicsRASD field Address not valid";
goto out;
}
if (cu_get_str_prop(inst, "KeyMap", &val) != CMPI_RC_OK)
- dev->dev.graphics.keymap = strdup("en-us");
+ dev->dev.graphics.dev.vnc.keymap = strdup("en-us");
else
- dev->dev.graphics.keymap = strdup(val);
+ dev->dev.graphics.dev.vnc.keymap = strdup(val);
if (cu_get_str_prop(inst, "Password", &val) != CMPI_RC_OK) {
CU_DEBUG("vnc password is not set");
- dev->dev.graphics.passwd = NULL;
+ dev->dev.graphics.dev.vnc.passwd = NULL;
} else {
CU_DEBUG("vnc password is set");
- dev->dev.graphics.passwd = strdup(val);
+ dev->dev.graphics.dev.vnc.passwd = strdup(val);
}
}
else if (STREQC(dev->dev.graphics.type, "console") ||
@@ -1157,8 +1157,8 @@
}
ret = parse_console_address(val,
- &dev->dev.graphics.host,
- &dev->dev.graphics.port);
+ &dev->dev.graphics.dev.vnc.host,
+ &dev->dev.graphics.dev.vnc.port);
if (ret != 1) {
msg = "GraphicsRASD field Address not valid";
goto out;
@@ -1175,7 +1175,7 @@
ret = asprintf(&dev->id, "%s", dev->dev.graphics.type);
else
ret = asprintf(&dev->id, "%s:%s",
- dev->dev.graphics.type, dev->dev.graphics.port);
+ dev->dev.graphics.type, dev->dev.graphics.dev.vnc.port);
if (ret == -1) {
msg = "Failed to create graphics is string";
13 years, 1 month
[PATCH] Fix connection leak introduced in patch 1119
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1311624862 25200
# Node ID 87404863f9a402eb1a59ff717d93caa75c50b29c
# Parent 7cb42b369d3776c9d727402ba0198eea573d0d40
Fix connection leak introduced in patch 1119.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 7cb42b369d37 -r 87404863f9a4 src/Virt_RASD.c
--- a/src/Virt_RASD.c Wed Jul 20 06:43:06 2011 -0700
+++ b/src/Virt_RASD.c Mon Jul 25 13:14:22 2011 -0700
@@ -349,6 +349,9 @@
(CMPIValue *)dev->dev.disk.cache,
CMPI_chars);
+ virStoragePoolFree(pool);
+ virStorageVolFree(vol);
+ virConnectClose(conn);
return s;
}
13 years, 1 month
Release of libvirt-cim-0.5.14
by Chip Vincent
I'm happy announce the release of libvirt-cim-0.5.14.
The new release is available at:
ftp://libvirt.org/libvirt-cim/libvirt-cim-0.5.14.tar.gz
libvirt-cim-0.5.14:
* Fix crash when creating ACL filter lists (Chip Vincent)
* Remove has_vnc_passwd key from infostore (Eduardo Lima)
* Set PoolID for CIM_DiskResourceAlloca... (Sharad Mishra)
* libxkutil: More meaningful log message (Eduardo Lima)
* Add source host and directory for netfs diskpool (Sharad Mishra)
* Set PoolID for CIM_NetResourceAllocationSettingData (Sharad Mishra)
* libxkutil: Handle vnc password when ret... (Eduardo Lima)
* Conditionally compile ACL APIs (Chip Vincent)
* SwitchService will show the nic connected to VSI... (Sharad Mishra)
* Make libconfig requirement optional (Eduardo Lima)
* libvirt-cim.spec: Use %config(noreplace)... (Eduardo Lima)
* Minor fix for MemoryPool.AllocationUnits (Chip Vincent)
* Adjust FilterList.registration file permission (Chip Vincent)
--
Chip Vincent
Open Virtualization
IBM Linux Technology Center
cvincent(a)linux.vnet.ibm.com
13 years, 1 month
[PATCH v2 1/2] Add SDL graphic device support
by Wayne Xia
# HG changeset patch
# User Wayne Xia <xiawenc(a)linux.vnet.ibm.com>
# Date 1311156234 -28800
# Node ID 0c52e4f6c421cc2e168197a82a9333d4ce369655
# Parent 3c90a88a5199a4ed931a4a76097cff8f55deae41
made the graphic structure as union
These change were made to allow SDL device properties added more
clearly, the graphic_device structure now contains a union
Signed-off-by: Wayne Xia (Wayne) <xiawenc(a)linux.vnet.ibm.com>
diff -r 3c90a88a5199 -r 0c52e4f6c421 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Jul 18 11:13:40 2011 -0300
+++ b/libxkutil/device_parsing.c Wed Jul 20 18:03:54 2011 +0800
@@ -91,10 +91,10 @@
static void cleanup_graphics_device(struct graphics_device *dev)
{
free(dev->type);
- free(dev->port);
- free(dev->host);
- free(dev->keymap);
- free(dev->passwd);
+ free(dev->dev.vnc.port);
+ free(dev->dev.vnc.host);
+ free(dev->dev.vnc.keymap);
+ free(dev->dev.vnc.passwd);
}
static void cleanup_input_device(struct input_device *dev)
@@ -522,12 +522,12 @@
CU_DEBUG("graphics device type = %s", gdev->type);
if (STREQC(gdev->type, "vnc")) {
- gdev->port = get_attr_value(node, "port");
- gdev->host = get_attr_value(node, "listen");
- gdev->keymap = get_attr_value(node, "keymap");
- gdev->passwd = get_attr_value(node, "passwd");
+ gdev->dev.vnc.port = get_attr_value(node, "port");
+ gdev->dev.vnc.host = get_attr_value(node, "listen");
+ gdev->dev.vnc.keymap = get_attr_value(node, "keymap");
+ gdev->dev.vnc.passwd = get_attr_value(node, "passwd");
- if (gdev->port == NULL || gdev->host == NULL)
+ if (gdev->dev.vnc.port == NULL || gdev->dev.vnc.host ==
NULL)
goto err;
}
else if (STREQC(gdev->type, "pty")) {
@@ -542,9 +542,9 @@
for (child = node->children; child != NULL;
child = child->next) {
if (XSTREQ(child->name, "source"))
- gdev->host = get_attr_value(child, "path");
+ gdev->dev.vnc.host =
get_attr_value(child, "path");
else if (XSTREQ(child->name, "target"))
- gdev->port = get_attr_value(child, "port");
+ gdev->dev.vnc.port =
get_attr_value(child, "port");
}
}
else {
@@ -557,7 +557,7 @@
if (STREQC(gdev->type, "vnc"))
ret = asprintf(&vdev->id, "%s", gdev->type);
else
- ret = asprintf(&vdev->id, "%s:%s", gdev->type, gdev->port);
+ ret = asprintf(&vdev->id, "%s:%s", gdev->type,
gdev->dev.vnc.port);
if (ret == -1) {
CU_DEBUG("Failed to create graphics is string");
@@ -798,9 +798,10 @@
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
DUP_FIELD(dev, _dev, dev.graphics.type);
- DUP_FIELD(dev, _dev, dev.graphics.port);
- DUP_FIELD(dev, _dev, dev.graphics.host);
- DUP_FIELD(dev, _dev, dev.graphics.keymap);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.host);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.port);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.keymap);
+ DUP_FIELD(dev, _dev, dev.graphics.dev.vnc.passwd);
} else if (dev->type == CIM_RES_TYPE_INPUT) {
DUP_FIELD(dev, _dev, dev.input.type);
DUP_FIELD(dev, _dev, dev.input.bus);
diff -r 3c90a88a5199 -r 0c52e4f6c421 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Mon Jul 18 11:13:40 2011 -0300
+++ b/libxkutil/device_parsing.h Wed Jul 20 18:03:54 2011 +0800
@@ -83,14 +83,28 @@
char *path;
};
-struct graphics_device {
- char *type;
+//vnc_device must be larger or equal than sdl_device
+struct vnc_device {
char *port;
char *host;
char *keymap;
char *passwd;
};
+struct sdl_device {
+ char *display;
+ char *xauth;
+ char *fullscreen;
+};
+
+struct graphics_device {
+ char *type;
+ union {
+ struct vnc_device vnc;
+ struct sdl_device sdl;
+ } dev;
+};
+
struct input_device {
char *type;
char *bus;
diff -r 3c90a88a5199 -r 0c52e4f6c421 libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Mon Jul 18 11:13:40 2011 -0300
+++ b/libxkutil/xml_parse_test.c Wed Jul 20 18:03:54 2011 +0800
@@ -116,7 +116,7 @@
FILE *d)
{
print_value(d, "Graphics Type", dev->dev.graphics.type);
- print_value(d, "Graphics Port", dev->dev.graphics.port);
+ print_value(d, "Graphics Port", dev->dev.graphics.dev.vnc.port);
}
static void print_devices(struct domain *dominfo,
diff -r 3c90a88a5199 -r 0c52e4f6c421 libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Mon Jul 18 11:13:40 2011 -0300
+++ b/libxkutil/xmlgen.c Wed Jul 20 18:03:54 2011 +0800
@@ -424,22 +424,22 @@
if (STREQC(dev->type, "sdl"))
return NULL;
- if (dev->port) {
- xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port);
- if (STREQC(dev->port, "-1"))
+ if (dev->dev.vnc.port) {
+ xmlNewProp(tmp, BAD_CAST "port", BAD_CAST
dev->dev.vnc.port);
+ if (STREQC(dev->dev.vnc.port, "-1"))
xmlNewProp(tmp, BAD_CAST "autoport", BAD_CAST
"yes");
else
xmlNewProp(tmp, BAD_CAST "autoport", BAD_CAST
"no");
}
- if (dev->host)
- xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->host);
+ if (dev->dev.vnc.host)
+ xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST
dev->dev.vnc.host);
- if (dev->passwd)
- xmlNewProp(tmp, BAD_CAST "passwd", BAD_CAST dev->passwd);
+ if (dev->dev.vnc.passwd)
+ xmlNewProp(tmp, BAD_CAST "passwd", BAD_CAST
dev->dev.vnc.passwd);
- if (dev->keymap)
- xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST dev->keymap);
+ if (dev->dev.vnc.keymap)
+ xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST
dev->dev.vnc.keymap);
return NULL;
}
@@ -460,15 +460,15 @@
if (tmp == NULL)
return XML_ERROR;
- if(dev->host)
- xmlNewProp(tmp, BAD_CAST "path", BAD_CAST dev->host);
+ if(dev->dev.vnc.host)
+ xmlNewProp(tmp, BAD_CAST "path", BAD_CAST
dev->dev.vnc.host);
tmp = xmlNewChild(pty, NULL, BAD_CAST "target", NULL);
if (tmp == NULL)
return XML_ERROR;
- if(dev->port)
- xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port);
+ if(dev->dev.vnc.port)
+ xmlNewProp(tmp, BAD_CAST "port", BAD_CAST
dev->dev.vnc.port);
return NULL;
}
diff -r 3c90a88a5199 -r 0c52e4f6c421 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Mon Jul 18 11:13:40 2011 -0300
+++ b/src/Virt_ComputerSystem.c Wed Jul 20 18:03:54 2011 +0800
@@ -104,7 +104,7 @@
"Virtual System (Console on %s://%s:%s)",
domain->dev_graphics[0].dev.graphics.type,
host,
- domain->dev_graphics[0].dev.graphics.port);
+
domain->dev_graphics[0].dev.graphics.dev.vnc.port);
else
ret = asprintf(&cap,
"Virtual System (No console)");
diff -r 3c90a88a5199 -r 0c52e4f6c421 src/Virt_Device.c
--- a/src/Virt_Device.c Mon Jul 18 11:13:40 2011 -0300
+++ b/src/Virt_Device.c Wed Jul 20 18:03:54 2011 +0800
@@ -194,8 +194,8 @@
else
rc = asprintf(&vp_str, "%s/%s:%s",
dev->type,
- dev->host,
- dev->port);
+ dev->dev.vnc.host,
+ dev->dev.vnc.port);
if (rc == -1)
return 0;
diff -r 3c90a88a5199 -r 0c52e4f6c421 src/Virt_KVMRedirectionSAP.c
--- a/src/Virt_KVMRedirectionSAP.c Mon Jul 18 11:13:40 2011 -0300
+++ b/src/Virt_KVMRedirectionSAP.c Wed Jul 20 18:03:54 2011 +0800
@@ -366,7 +366,7 @@
continue;
}
- ret = sscanf(dominfo->dev_graphics->dev.graphics.port,
+ ret =
sscanf(dominfo->dev_graphics->dev.graphics.dev.vnc.port,
"%d",
&lport);
if (ret != 1) {
diff -r 3c90a88a5199 -r 0c52e4f6c421 src/Virt_RASD.c
--- a/src/Virt_RASD.c Mon Jul 18 11:13:40 2011 -0300
+++ b/src/Virt_RASD.c Wed Jul 20 18:03:54 2011 +0800
@@ -425,8 +425,8 @@
else {
rc = asprintf(&addr_str,
"%s:%s",
- dev->dev.graphics.host,
- dev->dev.graphics.port);
+ dev->dev.graphics.dev.vnc.host,
+ dev->dev.graphics.dev.vnc.port);
}
CU_DEBUG("graphics Address = %s", addr_str);
@@ -439,7 +439,7 @@
if (STREQC(dev->dev.graphics.type, "vnc")) {
CMSetProperty(inst, "KeyMap",
- (CMPIValue *)dev->dev.graphics.keymap,
CMPI_chars);
+ (CMPIValue
*)dev->dev.graphics.dev.vnc.keymap, CMPI_chars);
conn = connect_by_classname(_BROKER, classname, &s);
if (conn == NULL)
diff -r 3c90a88a5199 -r 0c52e4f6c421
src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Jul 18 11:13:40 2011
-0300
+++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 20 18:03:54 2011
+0800
@@ -370,9 +370,9 @@
}
domain->dev_graphics->dev.graphics.type = strdup("vnc");
- domain->dev_graphics->dev.graphics.port = strdup("-1");
- domain->dev_graphics->dev.graphics.host = strdup("127.0.0.1");
- domain->dev_graphics->dev.graphics.keymap = strdup("en-us");
+ domain->dev_graphics->dev.graphics.dev.vnc.port = strdup("-1");
+ domain->dev_graphics->dev.graphics.dev.vnc.host =
strdup("127.0.0.1");
+ domain->dev_graphics->dev.graphics.dev.vnc.keymap =
strdup("en-us");
domain->dev_graphics_ct = 1;
return true;
@@ -1128,24 +1128,24 @@
}
ret = parse_vnc_address(val,
- &dev->dev.graphics.host,
- &dev->dev.graphics.port);
+ &dev->dev.graphics.dev.vnc.host,
+ &dev->dev.graphics.dev.vnc.port);
if (ret != 1) {
msg = "GraphicsRASD field Address not valid";
goto out;
}
if (cu_get_str_prop(inst, "KeyMap", &val) != CMPI_RC_OK)
- dev->dev.graphics.keymap = strdup("en-us");
+ dev->dev.graphics.dev.vnc.keymap = strdup("en-us");
else
- dev->dev.graphics.keymap = strdup(val);
+ dev->dev.graphics.dev.vnc.keymap = strdup(val);
if (cu_get_str_prop(inst, "Password", &val) !=
CMPI_RC_OK) {
CU_DEBUG("vnc password is not set");
- dev->dev.graphics.passwd = NULL;
+ dev->dev.graphics.dev.vnc.passwd = NULL;
} else {
CU_DEBUG("vnc password is set");
- dev->dev.graphics.passwd = strdup(val);
+ dev->dev.graphics.dev.vnc.passwd = strdup(val);
}
}
else if (STREQC(dev->dev.graphics.type, "console") ||
@@ -1156,8 +1156,8 @@
}
ret = parse_console_address(val,
- &dev->dev.graphics.host,
- &dev->dev.graphics.port);
+ &dev->dev.graphics.dev.vnc.host,
+ &dev->dev.graphics.dev.vnc.port);
if (ret != 1) {
msg = "GraphicsRASD field Address not valid";
goto out;
@@ -1174,7 +1174,7 @@
ret = asprintf(&dev->id, "%s", dev->dev.graphics.type);
else
ret = asprintf(&dev->id, "%s:%s",
- dev->dev.graphics.type,
dev->dev.graphics.port);
+ dev->dev.graphics.type,
dev->dev.graphics.dev.vnc.port);
if (ret == -1) {
msg = "Failed to create graphics is string";
@@ -1545,7 +1545,7 @@
dev = dominfo->dev_graphics;
if(dev != NULL){
- if (dev->dev.graphics.passwd != NULL)
+ if (dev->dev.graphics.dev.vnc.passwd != NULL)
infostore_set_bool(ctx, "has_vnc_passwd", true);
else
infostore_set_bool(ctx, "has_vnc_passwd", false);
13 years, 1 month