[libvirt] [PATCH 0/3] Fix VirtualBox registration
by Michal Privoznik
This is supposed to fix bug report which appeared on the list [1]. The driver
registration ordering is back as it was, but the subdrivers are registered
before. Unfortunately, if we don't want to dig vbox network and storage code
out, we have to compile the sources couple of times.
Michal Privoznik (3):
virdrivermoduletest: Test all the modules
virDriverLoadModule: Honor libvirt func name tranlsation
vbox: Register per partes
daemon/libvirtd.c | 16 +++++++++++++--
src/Makefile.am | 41 ++++++++++++++++++++++++++++++++++---
src/driver.c | 19 +++++++++++++++--
src/vbox/vbox_driver.c | 50 ++++++++++++++++++++++++++++++++++++++++-----
src/vbox/vbox_driver.h | 10 +++++++++
tests/virdrivermoduletest.c | 18 ++++++++++------
6 files changed, 136 insertions(+), 18 deletions(-)
--
1.8.5.5
10 years, 4 months
[libvirt] [PATCH] blockcopy: allow larger buf-size
by Eric Blake
While qemu definitely caps granularity to 64 MiB, it places no
limits on buf-size. On a machine beefy enough for lots of
memory, a buf-size larger than 2 GiB is feasible, so we should
pass a 64-bit parameter.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_COPY_BUF_SIZE):
Allow 64 bits.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Based on Peter's review of my patch series; until we have an
implementation, it is just a doc bug, but I'd rather document
it correctly and avoid baking in a too-small API.
include/libvirt/libvirt.h.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index e79c9ad..e80634e 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -2663,8 +2663,8 @@ typedef enum {
* VIR_DOMAIN_BLOCK_COPY_BUF_SIZE:
* Macro for the virDomainBlockCopy buffer size tunable: it represents
* how much data in bytes can be in flight between source and destination,
- * as an unsigned int. Specifying 0 is the same as omitting this parameter,
- * to request the hypervisor default.
+ * as an unsigned long long. Specifying 0 is the same as omitting this
+ * parameter, to request the hypervisor default.
*/
#define VIR_DOMAIN_BLOCK_COPY_BUF_SIZE "buf-size"
--
1.9.3
10 years, 4 months
[libvirt] [PATCH v2 0/8] new virDomainBlockCopy API
by Eric Blake
v2: finish the series for local files, address Peter's doc suggestions
on patch 1, and make several tweaks to many of the patches to fix
issues that I found in testing the final product.
Not included - patches to actually target a gluster destination. But
those can be delayed until 1.2.9.
Eric Blake (8):
blockcopy: virDomainBlockCopy with XML destination, typed params
blockcopy: split out virsh implementation
blockcopy: expose new API in virsh
blockcopy: remote implementation for new API
blockcopy: tweak how rebase calls into copy
blockcopy: add a way to parse disk source
blockcopy: add qemu implementation of new API
blockcopy: add qemu implementation of new tunables
include/libvirt/libvirt.h.in | 61 +++++++++++++--
src/conf/domain_conf.c | 147 +++++++++++++++++++++++------------
src/conf/domain_conf.h | 4 +
src/driver.h | 11 ++-
src/libvirt.c | 120 ++++++++++++++++++++++++++++-
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 5 ++
src/qemu/qemu_driver.c | 177 ++++++++++++++++++++++++++++++++-----------
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_monitor.c | 8 +-
src/qemu/qemu_monitor.h | 2 +
src/qemu/qemu_monitor_json.c | 3 +
src/qemu/qemu_monitor_json.h | 2 +
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 18 ++++-
src/remote_protocol-structs | 11 +++
tests/qemumonitorjsontest.c | 2 +-
tools/virsh-domain.c | 153 +++++++++++++++++++++++++++++++------
tools/virsh.pod | 35 +++++----
19 files changed, 623 insertions(+), 140 deletions(-)
--
1.9.3
10 years, 4 months
[libvirt] [RFC PATCH 0/3] Introduce virDomainOpenGraphicsFD API
by Ján Tomko
Introduce virDomainOpenGraphicsFD which returns a socket fd
created by the daemon, unlike virDomainOpenGraphics, where
it's created by client.
This should be usable by virt-viewer under SELinux, but
I was not able to verify that yet.
Ján Tomko (3):
Introduce virDomainOpenGraphicsFD API
Add RPC implementation for virDomainOpenGraphicsFd
Wire up virDomainOpenGraphicsFD in QEMU driver
daemon/remote.c | 42 +++++++++++++++++++++++
include/libvirt/libvirt.h.in | 5 +++
src/driver.h | 7 ++++
src/libvirt.c | 58 ++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 5 +++
src/qemu/qemu_driver.c | 80 ++++++++++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 39 +++++++++++++++++++++
src/remote/remote_protocol.x | 15 ++++++++-
src/rpc/virnetmessage.c | 26 ++++++++++++++
src/rpc/virnetmessage.h | 3 ++
10 files changed, 279 insertions(+), 1 deletion(-)
--
1.8.5.5
10 years, 4 months
[libvirt] Plan for the next release
by Daniel Veillard
We already have a number of commits in, over 150, I can't freeze next
monday but I could do this next Tuesday (the 26) for a planned release
around Sep 1st,
So unless there is a good reason to change this, that's the plan :)
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
10 years, 4 months
[libvirt] [libvirt-python PATCH] Implement virDomainOpenGraphicsFD
by Ján Tomko
---
generator.py | 1 +
libvirt-override-api.xml | 7 +++++++
libvirt-override.c | 37 +++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+)
diff --git a/generator.py b/generator.py
index a12c52b..32ae34d 100755
--- a/generator.py
+++ b/generator.py
@@ -464,6 +464,7 @@ skip_impl = (
'virConnectGetCPUModelNames',
'virNodeGetFreePages',
'virNetworkGetDHCPLeases',
+ 'virDomainOpenGraphicsFD',
)
lxc_skip_impl = (
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml
index 09bbbf8..c7b6152 100644
--- a/libvirt-override-api.xml
+++ b/libvirt-override-api.xml
@@ -640,5 +640,12 @@
<arg name='flags' type='unsigned int' info='unused, pass 0'/>
<return type='char *' info="list of leases"/>
</function>
+ <function name="virDomainOpenGraphicsFD" file='python'>
+ <info>Returns a file descriptor connected to the graphics framebuffer </info>
+ <arg name='domain' type='virDomainPtr' info='a domain object'/>
+ <arg name='idx' type='int' info='index of the graphics framebuffer'/>
+ <arg name='flags' type='unsigned int' info='bitwise OR of virDomainOpenGraphicsFlags'/>
+ <return type='char *' info="list of fds"/>
+ </function>
</symbols>
</api>
diff --git a/libvirt-override.c b/libvirt-override.c
index b2271ae..42a4b05 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7955,6 +7955,40 @@ libvirt_virNetworkGetDHCPLeases(PyObject *self ATTRIBUTE_UNUSED,
#endif /* LIBVIR_CHECK_VERSION(1, 2, 6) */
+
+#if LIBVIR_CHECK_VERSION(1, 2, 8)
+
+static PyObject *
+libvirt_virDomainOpenGraphicsFD(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
+{
+ PyObject *py_retval;
+ int c_retval;
+ virDomainPtr domain;
+ PyObject *pyobj_domain;
+ int idx;
+ int fd;
+ unsigned int flags;
+
+ if (!PyArg_ParseTuple(args, (char *)"Oii:virDomainOpenGraphicsFD",
+ &pyobj_domain, &idx, &flags))
+ return NULL;
+
+ domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virDomainOpenGraphicsFD(domain, idx, &fd, flags);
+ LIBVIRT_END_ALLOW_THREADS;
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ py_retval = PyList_New(1);
+ PyList_SetItem(py_retval, 0, libvirt_intWrap(fd));
+ return py_retval;
+}
+
+#endif /* LIBVIR_CHECK_VERSION(1, 2, 8) */
+
+
/************************************************************************
* *
* The registration stuff *
@@ -8140,6 +8174,9 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virNodeGetFreePages", libvirt_virNodeGetFreePages, METH_VARARGS, NULL},
{(char *) "virNetworkGetDHCPLeases", libvirt_virNetworkGetDHCPLeases, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(1, 2, 6) */
+#if LIBVIR_CHECK_VERSION(1, 2, 8)
+ {(char *) "virDomainOpenGraphicsFD", libvirt_virDomainOpenGraphicsFD, METH_VARARGS, NULL},
+#endif /* LIBVIR_CHECK_VERSION(1, 2, 8) */
{NULL, NULL, 0, NULL}
};
--
1.8.5.5
10 years, 4 months
[libvirt] [PATCHv2 0/5] Bulk domain stats query API
by Peter Krempa
This version adds implementation in the qemu driver and virsh and fixes the following bugs from v1:
*bad type of typed param count
*off-by-one when counting and verifying domain objects in libvirt.c
*off-by-one when allocating returned array in remote driver
*the all domain stats func not working as the return value wasn't handled properly
Peter Krempa (5):
lib: Introduce API for retrieving bulk domain stats
remote: Implement bulk domain stats APIs in the remote driver
qemu: Implement bulk stats API and one of the stats groups to return
virsh: domain: Split out code to lookup domain from string
virsh: Implement command to excercise the bulk stats APIs
daemon/remote.c | 91 ++++++++++++++++++++++
include/libvirt/libvirt.h.in | 26 +++++++
src/driver.h | 9 +++
src/libvirt.c | 180 +++++++++++++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 7 ++
src/qemu/qemu_driver.c | 175 +++++++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 88 +++++++++++++++++++++
src/remote/remote_protocol.x | 26 ++++++-
src/remote_protocol-structs | 23 ++++++
tools/virsh-domain-monitor.c | 140 +++++++++++++++++++++++++++++++++
tools/virsh-domain.c | 80 ++++++++++++-------
tools/virsh-domain.h | 4 +
12 files changed, 819 insertions(+), 30 deletions(-)
--
2.0.2
10 years, 4 months
[libvirt] [Libvirt] segfault with patch "libxl: fix framebuffer port setting for HVM domains"
by Chris
Hello,
I encountered segfaults with libvirt + libxl with this specific patch :
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b55cc5f4e31b488c4f9c...
My Libvirt/Xen environment (on a slackware64-14.1) :
virsh # version
Compiled against library: libvirt 1.2.6
Using library: libvirt 1.2.6
Using API: Xen 1.2.6
Running hypervisor: Xen 4.4.0
My Libvirt "configure line" :
./configure \
--prefix=/usr \
--libdir=/usr/lib64 \
--bindir=/usr/sbin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/libvirt-1.2.6 \
--enable-static=no \
--enable-shared=yes \
--with-yajl \
--with-qemu-group=root \
--with-init-script=none \
--without-xen \
--without-xenapi \
--with-libxl
The XML of my VM :
<domain type='xen'>
<name>vm.infra.ld</name>
<uuid>0b648359-099a-4d64-ba7a-12f32fb4f3dc</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='network'/>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<hap/>
<viridian/>
</features>
<clock offset='variable' adjustment='0' basis='utc'>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/data/vm.infra.ld-disk'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
<interface type='bridge'>
<mac address='00:16:3e:xx:xx:xx'/>
<source bridge='xenbr0'/>
<script path='/etc/xen/scripts/vif-openvswitch'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='fr'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<video>
<model type='cirrus' vram='9216' heads='1'/>
</video>
</devices>
</domain>
The VM starts fine with "virsh start" (cf attached libxl log), the VNC process is listening as requested on 0.0.0.0 but whenever I open a new virsh cli and send a command (e.g. "list"), libvirtd segfaults. I attached a gdb trace to this mail.
If I rebuild libvirt without the patch mentioned earlier, no more segfaults, but of course the VNC process is listening on 127.0.0.1 instead of requested 0.0.0.0 when I start the VM.
I may have done something wrong but don't understand what.
Regards,
Chris
10 years, 4 months
[libvirt] [PATCHv2] blkdeviotune: check for overflow when parsing XML
by Erik Skultety
According to docs/schemas/domaincommon.rng and _virDomainBlockIoTuneInfo
all the iotune values are interpreted as unsigned long long, however
according to qemu_monitor_json.c, qemu silently truncates numbers
larger than LLONG_MAX. There's really not much of a usage for such
large numbers anyway yet. This patch provides the same overflow
check during a domain start as it does during setting
a blkdeviotune element in qemu_driver.c and thus reports an error when
a larger number than LLONG_MAX is detected.
---
src/qemu/qemu_command.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6dac9d3..9213a60 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3620,6 +3620,18 @@ qemuBuildDriveStr(virConnectPtr conn,
goto error;
}
+ if (disk->blkdeviotune.total_bytes_sec > LLONG_MAX ||
+ disk->blkdeviotune.read_bytes_sec > LLONG_MAX ||
+ disk->blkdeviotune.write_bytes_sec > LLONG_MAX ||
+ disk->blkdeviotune.total_iops_sec > LLONG_MAX ||
+ disk->blkdeviotune.read_iops_sec > LLONG_MAX ||
+ disk->blkdeviotune.write_iops_sec > LLONG_MAX) {
+ virReportError(VIR_ERR_OVERFLOW,
+ _("block I/O throttle limit must "
+ "be less than %llu using QEMU"), LLONG_MAX);
+ goto error;
+ }
+
if (disk->blkdeviotune.total_bytes_sec) {
virBufferAsprintf(&opt, ",bps=%llu",
disk->blkdeviotune.total_bytes_sec);
--
1.9.3
10 years, 4 months
[libvirt] [PATCH] virsh: fix password auth failed on ssh connection
by Seyeong Kim
When try to connect to another host using virsh with password auth on ssh env,
can't put password properly because it's waiting IO from STDIN.
This patch check if it's in pts so make that doesn't poll from STDIN.
---
tools/virsh-domain.c | 3 +++
tools/virsh.c | 11 +++++++++++
tools/virsh.h | 2 ++
3 files changed, 16 insertions(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 2562326..b079261 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -3698,6 +3698,9 @@ vshWatchJob(vshControl *ctl,
/* don't poll on STDIN if we are not using a terminal */
if (!vshTTYAvailable(ctl))
npollfd = 1;
+ /* don't poll on STDIN if we are using a pseudo terminal slave */
+ if (vshPTSAvailable(ctl))
+ npollfd = 1;
GETTIMEOFDAY(&start);
while (1) {
diff --git a/tools/virsh.c b/tools/virsh.c
index 30a84c1..84f9500 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2429,6 +2429,13 @@ vshTTYAvailable(vshControl *ctl)
}
+bool
+vshPTSAvailable(vshControl *ctl)
+{
+ return ctl->ispts;
+}
+
+
int
vshTTYDisableInterrupt(vshControl *ctl ATTRIBUTE_UNUSED)
{
@@ -3646,6 +3653,10 @@ main(int argc, char **argv)
if (isatty(STDIN_FILENO)) {
ctl->istty = true;
+ char* tty_name = ttyname(STDIN_FILENO);
+ if (strstr(tty_name, "pts"))
+ ctl->ispts = true;
+
#ifndef WIN32
if (tcgetattr(STDIN_FILENO, &ctl->termattr) < 0)
ctl->istty = false;
diff --git a/tools/virsh.h b/tools/virsh.h
index b4df24b..700c786 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -256,6 +256,7 @@ struct _vshControl {
struct termios termattr; /* settings of the tty terminal */
# endif
bool istty; /* is the terminal a tty */
+ bool ispts; /* is the terminal a pts */
};
struct _vshCmdGrp {
@@ -386,6 +387,7 @@ int vshTTYDisableInterrupt(vshControl *ctl);
int vshTTYRestore(vshControl *ctl);
int vshTTYMakeRaw(vshControl *ctl, bool report_errors);
bool vshTTYAvailable(vshControl *ctl);
+bool vshPTSAvailable(vshControl *ctl);
/* waiting for events */
enum {
--
1.9.1
10 years, 4 months