Re: [Libvir] PATCH: Implement CDROM media change for QEMU/KVM driver

2007-10-15 Thread Richard W.M. Jones
+char *cmd; +char *reply; +/* XXX QEMU only supports a single CDROM for now */ +/*cmd = malloc(strlen(change ) + strlen(olddisk-dst) + 1 + strlen(newdisk-src) + 2);*/ +cmd = malloc(strlen(change ) + strlen(cdrom) + 1 + strlen(newdisk-src) + 2); +if (!cmd) { +

Re: [Libvir] PATCH: Fix const-ness for attach/detach device APIs

2007-10-15 Thread Richard W.M. Jones
Daniel P. Berrange wrote: virDomainAttachDevice and virDomainDetachDevice both take a char * for the XML description, but this is mistakenly not declared to be const. This patch fixes the public header files all the internal drivers. NB, yes this is in the public API, no it won't break any

Re: [Libvir] PATCH: Implement CDROM media change for QEMU/KVM driver

2007-10-15 Thread Richard W.M. Jones
Richard W.M. Jones wrote: +strcat(cmd, newdisk-src); Also, is quoting/escaping required? In a naive libvirt-based app, it's plausible that the string is provided by the user and could contain \n to send arbitrary commands to the qemu console. Rich. -- Emerging Technologies, Red Hat -

Re: [Libvir] Core dump while executing virsh in RHEL5 .

2007-10-15 Thread Daniel Veillard
On Mon, Oct 15, 2007 at 01:10:45PM +0100, Richard W.M. Jones wrote: Did this problem get fixed while I was away? What I'm seeing in Veerendra's valgrind log are the following suspicious messages, although the line numbers don't correspond to the earlier line numbers from gdb: yeah, I

Re: [Libvir] PATCH: Fix const-ness for attach/detach device APIs

2007-10-15 Thread Daniel Veillard
On Mon, Oct 15, 2007 at 12:49:34PM +0100, Richard W.M. Jones wrote: Daniel P. Berrange wrote: virDomainAttachDevice and virDomainDetachDevice both take a char * for the XML description, but this is mistakenly not declared to be const. This patch fixes the public header files all the internal

Re: [Libvir] Thoughts on remote storage support

2007-10-15 Thread Richard W.M. Jones
Tóth István wrote: Richard W.M. Jones wrote: For example, here are the domains and their images running on my Xen host at the moment. I got this by writing a simple script which parses the domain XML: fc6_0: /var/lib/xen/images/fc6_0.img - xvda /var/lib/xen/images/home.disk

Re: [Libvir] [PATCH] Topology fix for no cpus

2007-10-15 Thread Richard W.M. Jones
beth kon wrote: I was able to test on a 128-way NUMA box and found a bug. Nice :-) What does the topology XML look like for such a beast? Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street,

Re: [Libvir] remote access ?

2007-10-15 Thread Richard W.M. Jones
Mark Johnson wrote: [EMAIL PROTECTED] ~]# virsh connect xen+tcp://localhost libvir: Remote error : Connection refused error: Failed to connect to the hypervisor IME this usually happens because I forget to open the right port on the firewall (both incoming and outgoing ...) Rich. --

[Libvir] [PATCH] [REPOST] Remove virDomainRestart typedef from the public API

2007-10-15 Thread Richard W.M. Jones
... however it is still used internally by the test driver, so the typedef is moved into src/test.c. 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.

Re: [Libvir] remote access ?

2007-10-15 Thread Daniel Veillard
On Mon, Oct 15, 2007 at 09:26:26AM -0400, Mark Johnson wrote: On 10/15/07, Richard W.M. Jones [EMAIL PROTECTED] wrote: Mark Johnson wrote: [EMAIL PROTECTED] ~]# virsh connect xen+tcp://localhost libvir: Remote error : Connection refused error: Failed to connect to the hypervisor

Re: [Libvir] PATCH: Implement CDROM media change for QEMU/KVM driver

2007-10-15 Thread Jim Paris
Richard W.M. Jones wrote: +char *cmd; +char *reply; +/* XXX QEMU only supports a single CDROM for now */ +/*cmd = malloc(strlen(change ) + strlen(olddisk-dst) + 1 + strlen(newdisk-src) + 2);*/ +cmd = malloc(strlen(change ) + strlen(cdrom) + 1 + strlen(newdisk-src) +

Re: [Libvir] [PATCH] Enhanced stats for fullvirt domains

2007-10-15 Thread Richard W.M. Jones
Jim Meyering wrote: +/* In Xenstore, /local/domain/0/backend/vbd/domid/device/state, + * if available, must be XenbusStateConnected (= 4), otherwise there + * is no connected device. + */ +static int +check_bd_connected (xenUnifiedPrivatePtr priv, int device, int domid) +{ +char s[256], *rs;

Re: [Libvir] [PATCH] Enhanced stats for fullvirt domains

2007-10-15 Thread Jim Meyering
Richard W.M. Jones [EMAIL PROTECTED] wrote: ... That function should also check LEN (i.e., what if it's 0 or 1?). Otherwise, STREQ might read uninitialized memory. I've addressed that by doing something, hopefully the right thing, if len == 0. (We would expect len == 1). Yeah, you're right.

Re: [Libvir] remote access ?

2007-10-15 Thread Daniel P. Berrange
On Mon, Oct 15, 2007 at 04:37:22PM +0100, Richard W.M. Jones wrote: Daniel P. Berrange wrote: It is a bug in xend_internal.c if (strcasecmp (name, xen) == 0 || strncasecmp (name, xen:///, 7) == 0) { This needs to die be replaced with code calling the libxml URI parsing. I

Re: [Libvir] remote access ?

2007-10-15 Thread Daniel Veillard
On Mon, Oct 15, 2007 at 08:33:08PM +0100, Daniel P. Berrange wrote: On Mon, Oct 15, 2007 at 04:37:22PM +0100, Richard W.M. Jones wrote: Daniel P. Berrange wrote: It is a bug in xend_internal.c if (strcasecmp (name, xen) == 0 || strncasecmp (name, xen:///, 7) == 0) {