[Libvir] Re: libvirt on mingw
by Richard W.M. Jones
Brecht Sanders wrote:
> Hi,
> I saw on the following link:
> http://www.mail-archive.com/libvir-list@redhat.com/msg04103.html
> that you are also trying to compile libvirt on win32.
> I'm also attempting to do this, and I guess I got stuck at the same
> point your post was about.
> Have you in the mean time found an XDR implementation that compiles on
> MinGW and that implements xdr_u_quad_t?
> If you did, can you please tell me where to find it?
You'll find the answer to this question and more if you look through the
libvir-list archives for the current month:
https://www.redhat.com/archives/libvir-list/2008-January/thread.html
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 4 months
[Libvir] [PATCH] Fix USB device name mis-conversion from S-Expr to XML
by Hiroyuki Kaguchi
"tablet" and "mouse" are set as a value of the
/local/domain/<domid>/image/hvm/usbdevice,
but libvirt expects "usbdevice" and "usbmouse" as a value.
This causes the following.
If a USB device is attached by virt-manager,
the USB device is not seen from virt-manager.
This patch fixes expected value of libvirt
Thanks,
Hiroyuki Kaguchi
Index: xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.162
diff -u -r1.162 xend_internal.c
--- xend_internal.c 21 Jan 2008 16:29:10 -0000 1.162
+++ xend_internal.c 23 Jan 2008 00:37:02 -0000
@@ -1743,11 +1743,9 @@
node = cur->u.s.car;
if (sexpr_lookup(node, "usbdevice")) {
tmp = sexpr_node(node, "usbdevice");
- if (tmp && *tmp) {
- if (!strcmp(tmp, "usbtablet"))
- virBufferAdd(&buf, " <input type='tablet'
bus='usb'/>\n", 37);
- else if (!strcmp(tmp, "usbmouse"))
- virBufferAdd(&buf, " <input type='mouse'
bus='usb'/>\n", 36);
+ if (!strcmp(tmp, "tablet") ||
+ !strcmp(tmp, "mouse")) {
+ virBufferVSprintf(&buf, " <input type='%s'
bus='usb'/>\n", tmp);
}
}
}
16 years, 4 months
[Libvir] [PATCH] Add xen and hvm guest types to test drive caps
by Cole Robinson
The attached patch adds xen and hvm guest types to the test driver's
capabilities. It was currently set to offer only a 'linux' type which
doesn't seem to follow the conventions of the other drivers, so I
removed that. Please yell if I'm wrong :)
Thanks,
Cole
diff --git a/src/test.c b/src/test.c
index f401d7d..9b2ca56 100644
--- a/src/test.c
+++ b/src/test.c
@@ -984,6 +984,8 @@ static char *testGetCapabilities (virConnectPtr conn)
char *xml;
int cell1[] = { 0, 2, 4, 6, 8, 10, 12, 14 };
int cell2[] = { 1, 3, 5, 7, 9, 11, 13, 15 };
+ const char *guest_types[] = { "hvm", "xen" };
+ int num_guest_types = 2, i;
if ((caps = virCapabilitiesNew(TEST_MODEL, 0, 0)) == NULL)
goto no_memory;
@@ -998,29 +1000,33 @@ static char *testGetCapabilities (virConnectPtr conn)
if (virCapabilitiesAddHostNUMACell(caps, 1, 8, cell2) < 0)
goto no_memory;
- if ((guest = virCapabilitiesAddGuest(caps,
- "linux",
- TEST_MODEL,
- TEST_MODEL_WORDSIZE,
- NULL,
- NULL,
- 0,
- NULL)) == NULL)
- goto no_memory;
-
- if (virCapabilitiesAddGuestDomain(guest,
- "test",
- NULL,
- NULL,
- 0,
- NULL) == NULL)
- goto no_memory;
-
-
- if (virCapabilitiesAddGuestFeature(guest, "pae", 1, 1) == NULL)
- goto no_memory;
- if (virCapabilitiesAddGuestFeature(guest ,"nonpae", 1, 1) == NULL)
- goto no_memory;
+ for (i = 0; i < num_guest_types; ++i) {
+
+ if ((guest = virCapabilitiesAddGuest(caps,
+ guest_types[i],
+ TEST_MODEL,
+ TEST_MODEL_WORDSIZE,
+ NULL,
+ NULL,
+ 0,
+ NULL)) == NULL)
+ goto no_memory;
+
+ if (virCapabilitiesAddGuestDomain(guest,
+ "test",
+ NULL,
+ NULL,
+ 0,
+ NULL) == NULL)
+ goto no_memory;
+
+ if (strcmp(guest_types[i], "xen")) {
+ if (virCapabilitiesAddGuestFeature(guest, "pae", 1, 1) == NULL)
+ goto no_memory;
+ if (virCapabilitiesAddGuestFeature(guest ,"nonpae", 1, 1) == NULL)
+ goto no_memory;
+ }
+ }
if ((xml = virCapabilitiesFormatXML(caps)) == NULL)
goto no_memory;
16 years, 6 months
[Libvir] uuid of newly created domain
by Vadim Zaliva
Hi!
I am running into interesting problem with UUID. I am using Ruby
bindings, but I think the
problem is not specific to Ruby. I am doing roughly the following:
dom = c.define_domain_xml(xml)
dom1 = c.ookup_domain_by_uuid(dom.uuid)
and I got an error that domain with given UUID is not found.
If I print UUID of newly defined domain and compare it with output
of 'dominfo' command in virsh I can see that it differs.
Could anybody shed some light on why UUID returned by
define_domain_xml()
is invalid?
Sincerely,
Vadim
--
"La perfection est atteinte non quand il ne reste rien a ajouter, mais
quand il ne reste rien a enlever." (Antoine de Saint-Exupery)
16 years, 7 months
[Libvir] Lxc driver patch
by Daniel Veillard
Patch against CVS version, it tries to avoid 2 issues:
- problem with global data settings when loading of the driver got
interrupted. Check more NULLs and reset to NULL, i was getting crashes
when running the regression tests and the /etc/libvirtd/lxc was not
accessible.
- avoid trying to open the driver if not running as root, that's not
a problem in normal case because the daemon runs as root, but
when running 'make check' as a normal user libvirtd is run as an
user and compiling the lxc driver in would break the regression tests
Dave could you double-check this, hopefully it has no side effect ?
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
16 years, 7 months
[Libvir] [PATCH] lxc: start domain
by Dave Leskovec
This is a repost of patch four in the last series I posted. It contains the
start container support. I've made some changes corresponding to Dan B's patch
moving the lxc driver under libvirtd. I removed the isolation forks and cleaned
up the status handling and PID storing.
Thanks!
--
Best Regards,
Dave Leskovec
IBM Linux Technology Center
Open Virtualization
16 years, 7 months
Re: [Libvir] [PATCH] deep copy dom structure
by Richard W.M. Jones
On Fri, Mar 28, 2008 at 04:39:31PM +0100, Guido Guenther wrote:
> ---
> src/virterror.c | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/src/virterror.c b/src/virterror.c
> index 1463129..49f3b89 100644
> --- a/src/virterror.c
> +++ b/src/virterror.c
> @@ -115,6 +115,11 @@ virResetError(virErrorPtr err)
> free(err->str1);
> free(err->str2);
> free(err->str3);
> + if(err->dom) {
> + if(err->dom->name)
> + free(err->dom->name);
> + free(err->dom);
> + }
> memset(err, 0, sizeof(virError));
> }
>
> @@ -383,6 +388,15 @@ __virRaiseError(virConnectPtr conn, virDomainPtr dom, virNetworkPtr net,
> virResetError(to);
> to->conn = conn;
> to->dom = dom;
> + if (dom) {
> + if (!(to->dom = malloc(sizeof(virDomain)))) {
> + fprintf(stderr, "cannot allocate memory in %s", __FUNCTION__);
> + } else {
> + to->dom->name = strdup(dom->name);
> + memcpy (to->dom->uuid, dom->uuid, VIR_UUID_BUFLEN);
> + to->dom->id = dom->id;
> + }
> + }
> to->net = net;
> to->domain = domain;
> to->code = code;
What problem are you trying to solve?
The 'conn', 'dom' and 'net' fields in a virterror can't be accessed
safely, particularly from a garbage-collected language. The only safe
thing one could do with them is a physical equality test on the
pointer against an existing conn/dom/net pointer.
But the solution isn't to copy the dom object, since in a GC-d
language someone could grab a handle to the copied dom which would
have a different lifetime from the error object. If anything the
solution would be to remove those fields from the error object since
they are highly unlikely to be useful in any real world application.
We can't do this because of backwards compatibility promises but we
should instead deprecate them.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
16 years, 7 months
[Libvir] ruby binding patch
by Vadim Zaliva
I have attempted to add following methods to Domain class:
1. vcpus=
2. memory=
This is my first patch to libvirt-ruby, and I will appreciate your
feedback.
My next goal is to add binding for virDomainPinVcpu() method.
Sincerely,
Vadim
16 years, 7 months
[Libvir] [PATCH/RFC] remote driver uses already freed dom
by Guido Günther
Hi,
when trying to undefine a running qemu domain the domain name gets
corrupted:
$ ./virsh undefine system1
Name: /�em1
libvir: QEMU error /�em1: internal error cannot delete active domain
error: Failed to undefine domain system1
the reaseon is that in qemud/remote.c the domain is freed after failure:
remoteDispatchDomainUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
...
{
...
if (virDomainUndefine (dom) == -1) {
virDomainFree(dom);
return -1;
}
...
}
This doesn't work out since remoteDispatchClient accesses the dom
structure that was stored in the virtErrorPtr structure to report the
error back to the client (This is just an example and hits any error
path of functions in remote_dispatch_proc_switch.h that reference dom).
There are two possible solutions I see: move the virtDomainFree down to
the bottom of remoteDispatchClient or deep copy the dom structure in
virDefaultErrorFunc. A patch for the later is attached since similar
things seem to be possible in other drivers too.
-- Guido
16 years, 7 months