[libvirt] [PATCH 0/6] Support VNC password changes on running guests v2
by Daniel P. Berrange
This patch introduces a new virDomainUpdateDeviceFlags() API to allow
the configuration of a device to be changed on the fly. It ports the
existing CDROM media change code in all drivers to use this new API
(keeps old support too). It then adds VNC password change support
in the QEMU driver using this new API
v2: Fix feedback from first posting
14 years, 9 months
Re: [libvirt] [Qemu-devel] Re: Supporting hypervisor specific APIs in libvirt
by Anthony Liguori
On 03/24/2010 07:25 AM, Paul Brook wrote:
>> I can't quite see what such a libqemu would buy us compared to straight
>> QMP.
>>
>> Talking QMP should be easy, provided you got a suitable JSON library.
>>
> I agree. My undesranding is this was one of the large motivations behind using
> JSON: It's a common protocol that already has convenient bindings in most
> languages. If it's hard[1] for third parties to bind QMP to their favourite
> language/framework then IMHO we've done it wrong.
>
You can't have convenient bindings to an RPC in C because it doesn't
support dynamic dispatch. With most types of RPC, you have an IDL
description and a code generator.
But regardless of that, there are advantages to us providing a libqemu.
The biggest one is that we can standardize transport implementations
that include discovery mechanisms.
If the core of libqemu provided an extensible transport interface, and a
generic QMP request/completion mechanism, in a Python binding, you would
never use the IDL generated wrappers but instead use dynamic dispatch to
invoke arbitrary QMP requests.
But the advantage is that if libvirt provided an API for a QMP transport
encapsulated in their secure protocol, then provided the plumbed that
API through their Python interface, you could use it for free in Python
without having to reinvent the wheel.
Regards,
Anthony Liguori
> Paul
>
> [1] Hard compared to any other sane RPC mechanism. Some languages make
> everything hard :-)
>
14 years, 9 months
[libvirt] [PATCH] build: suppress distracting build output
by Jim Meyering
While building "make check", I saw this scroll by (too quickly
to see what it was), but it was different enough from the rest that...
CCLD libvirt.la
CCLD libvirt_test.la
make check-local
make[3]: Entering directory `/home/j/w/co/libvirt/src'
if test -x '/usr/bin/augparse'; then \
'/usr/bin/augparse' -I ./qemu \
./qemu/test_libvirtd_qemu.aug; \
fi
if test -x '/usr/bin/augparse'; then \
'/usr/bin/augparse' -I ./lxc \
./lxc/test_libvirtd_lxc.aug; \
fi
CC libvirtd-event.o
CC libvirtd-libvirtd.o
I scrolled back to investigate.
Not a problem, but let's eliminate the distraction.
Here's a patch.
With it, instead of the above "if test..." lines, you'll see this
single line:
GEN augeas-check
>From 84eb6effdd0241a8bae196d4b77d873aea7fd3db Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 24 Mar 2010 09:39:54 +0100
Subject: [PATCH] build: suppress distracting build output
* src/Makefile.am (augeas-check): New target, just to give the existing
rule a name. At the same time, prefix the commands with $(AM_V_GEN),
to avoid unexpected build output with V=0 which is the default.
---
src/Makefile.am | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 0aa3443..5f6b325 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -766,15 +766,18 @@ EXTRA_DIST += \
$(SECRET_DRIVER_SOURCES) \
$(VBOX_DRIVER_EXTRA_DIST)
-check-local:
+check-local: augeas-check
+
+.PHONY: augeas-check
+augeas-check:
if WITH_QEMU
- if test -x '$(AUGPARSE)'; then \
+ $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/qemu \
$(srcdir)/qemu/test_libvirtd_qemu.aug; \
fi
endif
if WITH_LXC
- if test -x '$(AUGPARSE)'; then \
+ $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/lxc \
$(srcdir)/lxc/test_libvirtd_lxc.aug; \
fi
--
1.7.0.3.435.g097f4
14 years, 9 months
[libvirt] [PATCH] vbox: Fix segfault on empty device source
by Matthias Bolte
<source file=''/> results in def->disks[i]->src == NULL. But
vboxDomainDefineXML didn't check def->disks[i]->src for NULL
and expected it to be a valid string.
Add checks for def->disks[i]->src != NULL to fix the segfault.
---
src/vbox/vbox_tmpl.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 1765d63..fefed1f 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -3519,7 +3519,8 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
DEBUG("disk(%d) shared: %s", i, def->disks[i]->shared ? "True" : "False");
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
- if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE) {
+ if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE &&
+ def->disks[i]->src != NULL) {
IDVDDrive *dvdDrive = NULL;
/* Currently CDROM/DVD Drive is always IDE
* Secondary Master so neglecting the following
@@ -3801,7 +3802,8 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
DEBUG("disk(%d) readonly: %s", i, def->disks[i]->readonly ? "True" : "False");
DEBUG("disk(%d) shared: %s", i, def->disks[i]->shared ? "True" : "False");
- if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE) {
+ if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE &&
+ def->disks[i]->src != NULL) {
IMedium *medium = NULL;
PRUnichar *mediumUUID = NULL;
PRUnichar *mediumFileUtf16 = NULL;
--
1.6.3.3
14 years, 9 months
[libvirt] error: internal error canonical hostname pointed to localhost, but this is not allowed
by Kenneth Nagin
When trying to migrate a VM the destination libvirtd
virGetHostnameLocalhost throws an internal error.
I issue this command from the source host.
> virsh migrate rel-vm1 qemu+tls://croton/system
error: internal error canonical hostname pointed to localhost, but this is
not allowed
The destination host throws the error:
14:14:57.914: debug : virDomainMigratePrepare2:3740 : dconn=0xed17e0,
cookie=0x7f983a352d68, cookielen=0x7f983a352d74, uri_in=(null),
uri_out=0xe8c360,flags=0, dname=(null), bandwidth=0, dom_xml=<domain
type='kvm' id='1'>
<name>rel-vm1</name>
<uuid>c0c98fc9-8cd6-e246-a06e-b5ce37c4f05e</uuid>
<memory>262144</memory>
<currentMemory>262144</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc-0.11'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<source file='/share/images/nagin/rel-vm1/rel-vm1.img'/>
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x1'/>
</controller>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
</video>
</devices>
</domain>
14:14:57.914: error : virGetHostnameLocalhost:2372 : internal error
canonical hostname pointed to localhost, but this is not allowed
libvir: error : internal error canonical hostname pointed to localhost, but
this is not allowed
14:14:57.914: debug : remoteSerializeError:141 : prog=536903814 ver=1
proc=108 type=1 serial=3, msg=internal error canonical hostname pointed to
localhost, but this is not allowed
The libvirt version is the tip of git:
[root@croton rel-vm1]# virsh version
Compiled against library: libvir 0.7.7
Using library: libvir 0.7.7
Using API: QEMU 0.7.7
Running hypervisor: QEMU 0.12.1
Changing qemudDomainMigratePrepare2 call to virGetHostnameLocalhost
from: if ((hostname = virGetHostnameLocalhost(0)) == NULL)
to: if ((hostname = virGetHostnameLocalhost(1)) == NULL)
seems to fix the problem.
But maybe this is only masking a another problem.
--Kenneth Nagin
14 years, 9 months
[libvirt] ANNOUNCE: virt-manager 0.8.4 and virtinst 0.500.3
by Cole Robinson
I'm happy to announce two new releases:
virt-manager 0.8.4: virt-manager is a desktop application for managing
KVM and Xen virtual machines via libvirt.
virtinst 0.500.3: virtinst is a collection of command line tools for
provisioning libvirt virtual machines, including virt-install and
virt-clone.
The releases can be downloaded from:
http://virt-manager.org/download.html
The direct download links are:
http://virt-manager.org/download/sources/virt-manager/virt-manager-0.8.4....
http://virt-manager.org/download/sources/virtinst/virtinst-0.500.3.tar.gz
The virt-manager release includes:
- Import install option: create a VM using an existing OS image
- Support multiple boot devices and boot order
- Watchdog device support
- Enable setting a human readable VM description.
- Option to manually specify a bridge name, if bridge isn't detected by
virt-manager
The virtinst release includes:
- virt-install: New --watchdog option: configure a virtual watchdog dev
- virt-install: New --soundhw option: More flexible sound configuration
deprecates --sound, though back compat is maintained
- virt-install: New --security option: configure VM security driver
- virt-install: New --description option: set a human readable desc
- Better OS defaults: Use <video> VGA and <sound> AC97 if supported
Thanks to everyone who has contributed to this release through testing,
bug reporting, submitting patches, and otherwise sending in feedback!
Thanks,
Cole
14 years, 9 months
[libvirt] Two issues regarding TFTP support in virtual networks...
by Darryl L. Pierce
The first is just a wiki fix: the wiki says this functionality is
available as of 0.7.1 of libvirt. The code though is only in the 0.7.2
tag and later. So the wiki should say 0.7.2 instead.
The second regards how I'm using it and what I'm doing wrong. I'm
creating a virtual network and pointing it to a temporary directory
where I've run livecd-iso-to-pxeboot to setup an ISO file for PXE
booting. So the network XML looks like this:
(mcpierce@mcpierce-desktop:node-image)$ sudo virsh net-dumpxml testbr541
<network>
<name>testbr541</name>
<uuid>f389317f-8420-7516-df9d-756b7deb3d37</uuid>
<forward mode='nat'/>
<bridge name='testbr541' stp='on' delay='0' />
<ip address='192.168.31.1' netmask='255.255.255.0'>
<tftp root='/tmp/tmp.3B8opJfBXw/tftpboot/' />
<dhcp>
<range start='192.168.31.100' end='192.168.31.199' />
</dhcp>
</ip>
</network>
When I start up the VM, I see it get an IP address within the range
specified, but it never pxeboots the ISO image.
To what directory should the root attribute be pointed?
--
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
14 years, 9 months
Re: [libvirt] [Qemu-devel] Re: Supporting hypervisor specific APIs in libvirt
by Markus Armbruster
Paul Brook <paul(a)codesourcery.com> writes:
>> > IMO the no_user flag is a bug, and should not exist.
>>
>> Sorry, what's that?
>
> Usually an indication that a device has been incorrectly or inproperly
> converted to the qdev interface.
Can also be an indication that the device can't support multiple
instances. For instance:
commit 39a51dfda835a75c0ebbfd92705b96e4de77f795
Author: Markus Armbruster <armbru(a)redhat.com>
Date: Tue Oct 27 13:52:13 2009 +0100
qdev: Tag isa-fdc, PIIX3 IDE and PIIX4 IDE as no-user
These devices are created automatically, and attempting to create
another one with -device fails with "qemu: hardware error:
register_ioport_write: invalid opaque".
Signed-off-by: Markus Armbruster <armbru(a)redhat.com>
Signed-off-by: Anthony Liguori <aliguori(a)us.ibm.com>
With no-user, we at least fail with a decent error message.
I don't think it's fair to demand that a qdev conversion must relax
restrictions that haven't otherwise bothered us to be correct and
proper. We'll relax them if and when they bother us enough to make
somebody send a decent patch.
And yes, there are better ways to disallow multiple instances of a
device than declaring it no-user. Patches welcome.
14 years, 9 months
[libvirt] [RFC]: Snapshot API
by Chris Lalancette
Hello,
As some of you know, I've been working on a new snapshot API.
This API is heavily based on DanB's earlier API proposed here:
https://www.redhat.com/archives/libvir-list/2010-January/msg00626.html
I've made some modifications to make it more libvirt-ish, and to add a
couple of features I think it lacked. The full documentation is below.
Any comments are appreciated.
/* NOTE: struct _virDomainSnapshot is a private structure, ala
* struct _virDomain.
*/
typedef struct _virDomainSnapshot virDomainSnapshot;
/* Take a snapshot of the current VM state */
virDomainSnapshotPtr virDomainSnapshotCreateXML(virDomainPtr domain,
const char *xmlDesc,
unsigned int flags);
/* Dump the XML of a snapshot */
/* NOTE: see below for proposed XML */
char *virDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
unsigned int flags);
/* Return the number of snapshots for this domain */
int virDomainSnapshotNum(virDomainPtr domain, unsigned int flags);
/* Get the names of all snapshots for this domain */
int virDomainListSnapshotNames(virDomainPtr domain, char **names, int nameslen,
unsigned int flags);
/* Get a handle to a named snapshot */
virDomainSnapshotPtr virDomainSnapshotLookupByName(virDomainPtr domain,
const char *name,
unsigned int flags);
/* Set this snapshot as the current one for a domain, to be
* used next time domain is started */
int virDomainSnapshotActivate(virDomainSnapshotPtr snapshot,
unsigned int flags);
/* Deactivate a snapshot - with no flags, the snapshot is not used anymore,
* but also not removed. With a MERGE flag, it merges the snapshot into
* the base image. With a DISCARD flag, it deletes the snapshot. MERGE
* and DISCARD are mutually-exclusive. Note that this operation can
* generally only happen when the domain is shut down, though this is
* hypervisor-specific */
typedef enum {
VIR_DOMAIN_SNAPSHOT_DEACTIVATE_MERGE,
VIR_DOMAIN_SNAPSHOT_DEACTIVATE_DISCARD,
} virDomainSnapshotDeactivate;
int virDomainSnapshotDeactivate(virDomainSnapshotPtr snapshot,
unsigned int flags);
int virDomainSnapshotFree(virDomainSnapshotPtr snapshot);
NOTE: During snapshot creation, *none* of the fields are required. That is,
you can call virDomainSnapshotCreateXML() with an XML of "<domainsnapshot/>".
In this case, the individual driver will make up a <name> for you, the
<creationdate> will be set to the current time+date, <description> will be
empty, <state> will be "off", <compression> will be empty, and <parent> will
be empty. If you do want to specify some fields during
virDomainSnapshotCreateXML(), note that the only ones that are settable are
<name>, <description>, <compression>, and <parent>; the rest are ignored,
and filled in by the driver when the snapshot is actually created.
NOTE: <parent> is used to create "trees" of snapshots, and may or may not be
supported by individual hypervisor implementations. If <parent> is specified
and the underlying hypervisor does not support it, an error will be thrown.
NOTE: <compression> is used to compress snapshots, and may or may not be
supported by individual hypervisor implementations. If <compression> is
specified and the underlying hypervisor does not support it, an error will
be thrown.
<domainsnapshot>
<name>XYZ</name>
<creationdate>...</creationdate>
<description>
....blah....
</description>
<state>RUNNING</state>
<domain>
<uuid>XXXXX-XXXX-XXXX-XXXX-XXXXXXXXX</uuid>
</domain>
<compression>gzip</compression>
<parent>
<name>ABC</name>
</parent>
</domainsnapshot>
The virsh commands will be:
virsh snapshot-create [--compress] <dom> <xmlfile>
virsh snapshot-list <dom>
virsh snapshot-dumpxml <dom> <name>
virsh snapshot-activate <dom> <snapshotname>
virsh snapshot-deactivate <dom> <snapshotname> [--merge|--delete]
--
Chris Lalancette
14 years, 9 months
[libvirt] Unable to open virt-manager
by Doron Fediuck
Hi,
I'm trying to work remotely on a server with F12, using vnc.
When I start virt-manager, I do not get the authentication popup, and instead I get this message:
Unable to open connection to hypervisor URI 'qemu:///system':
authentication failed
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/connection.py", line 872, in _try_open
None], flags)
File "/usr/lib64/python2.6/site-packages/libvirt.py", line 102, in openAuth
if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: authentication failed
RPM versions:
libvirt-0.7.1-15.fc12.x86_64
libvirt-client-0.7.1-15.fc12.x86_64
python-virtinst-0.500.1-2.fc12.noarch
virt-viewer-0.2.0-1.fc12.x86_64
virt-manager-0.8.2-1.fc12.noarch
virt-ctrl-1.0.1-4.fc12.x86_64
libvirt-python-0.7.1-15.fc12.x86_64
Any idea what causes the popup to fail ?
14 years, 9 months