# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1225900807 28800
# Node ID 20af5ae5b01c308d2cfab62899b2dbcb8d186567
# Parent 29c875cab8b808655c04d2f971c0d6c9a9f03dbd
Store and preserve keymap attribute for graphics device
This prevents us from discarding the keymap setting when we redefine a domain.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 29c875cab8b8 -r 20af5ae5b01c libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Tue Nov 04 13:10:46 2008 -0800
+++ b/libxkutil/device_parsing.c Wed Nov 05 08:00:07 2008 -0800
@@ -76,6 +76,7 @@
free(dev->type);
free(dev->port);
free(dev->host);
+ free(dev->keymap);
}
void cleanup_virt_device(struct virt_device *dev)
@@ -440,6 +441,7 @@
gdev->type = get_attr_value(node, "type");
gdev->port = get_attr_value(node, "port");
gdev->host = get_attr_value(node, "listen");
+ gdev->keymap = get_attr_value(node, "keymap");
if ((gdev->type == NULL) || (gdev->port == NULL))
goto err;
@@ -628,6 +630,7 @@
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);
}
return dev;
diff -r 29c875cab8b8 -r 20af5ae5b01c libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Tue Nov 04 13:10:46 2008 -0800
+++ b/libxkutil/device_parsing.h Wed Nov 05 08:00:07 2008 -0800
@@ -63,6 +63,7 @@
char *type;
char *port;
char *host;
+ char *keymap;
};
struct virt_device {
diff -r 29c875cab8b8 -r 20af5ae5b01c libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Tue Nov 04 13:10:46 2008 -0800
+++ b/libxkutil/xmlgen.c Wed Nov 05 08:00:07 2008 -0800
@@ -342,9 +342,12 @@
struct graphics_device *graphics = &dev->dev.graphics;
ret = asprintf(&_xml,
- "<graphics type='%s'
port='%s'/>\n",
+ "<graphics type='%s' port='%s' "
+ "listen='%s' keymap='%s'/>\n",
graphics->type,
- graphics->port);
+ graphics->port,
+ graphics->host != NULL ? graphics->host :
"127.0.0.1",
+ graphics->keymap != NULL ? graphics->keymap :
"en-us");
if (ret == -1)
return false;
else
Show replies by date
Dan Smith wrote:
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1225900807 28800
# Node ID 20af5ae5b01c308d2cfab62899b2dbcb8d186567
# Parent 29c875cab8b808655c04d2f971c0d6c9a9f03dbd
Store and preserve keymap attribute for graphics device
This prevents us from discarding the keymap setting when we redefine a domain.
DefineSystem() doesn't check to see if the guest already exists. In
create_system(), before calling get_reference_domain(), there should be
such a check. If the domain exists, we should get the domain struct and
then update the struct accordingly.
Otherwise, we drop the existing graphics device settings.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com
KR> DefineSystem() doesn't check to see if the guest already exists.
Hmm, I think it used to because I remember having to undefine a guest
while testing it.
KR> In create_system(), before calling get_reference_domain(), there
KR> should be such a check. If the domain exists, we should get the
KR> domain struct and then update the struct accordingly.
That seems like a different issue to me than the one that this patch
addresses.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
Dan Smith wrote:
KR> DefineSystem() doesn't check to see if the guest already
exists.
Hmm, I think it used to because I remember having to undefine a guest
while testing it.
KR> In create_system(), before calling get_reference_domain(), there
KR> should be such a check. If the domain exists, we should get the
KR> domain struct and then update the struct accordingly.
That seems like a different issue to me than the one that this patch
addresses.
That's a fair point. I can follow up with it after this patch goes in.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com
Dan Smith wrote:
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1225900807 28800
# Node ID 20af5ae5b01c308d2cfab62899b2dbcb8d186567
# Parent 29c875cab8b808655c04d2f971c0d6c9a9f03dbd
Store and preserve keymap attribute for graphics device
This prevents us from discarding the keymap setting when we redefine a domain.
+1
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com