[libvirt] [PATCH] qemu: remove dead assignment
by Eric Blake
Detected by clang.
* src/qemu/qemu_migration.c (qemuMigrationToFile): Nothing later
uses is_reg.
---
src/qemu/qemu_migration.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 7f4b111..6c5bf66 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1311,7 +1311,6 @@ qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
if (virSecurityManagerSetFDLabel(driver->securityManager, vm,
compressor ? pipeFD[1] : fd) < 0)
goto cleanup;
- is_reg = true;
bypassSecurityDriver = true;
} else {
/* Phooey - we have to fall back on exec migration, where qemu
--
1.7.4.4
13 years, 6 months
[libvirt] [PATCH] storage: use virCommand to avoid compiler warning
by Eric Blake
clang didn't like the last increment to nargs. But why even
track nargs ourselves, when virCommand does it for us?
* src/storage/storage_backend_iscsi.c
(virStorageBackendISCSIConnection): Switch to virCommand to avoid
a dead-store warning on nargs.
---
src/storage/storage_backend_iscsi.c | 36 ++++++++--------------------------
1 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index d86f077..ec52dbc 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -42,6 +42,7 @@
#include "memory.h"
#include "logging.h"
#include "files.h"
+#include "command.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
@@ -348,28 +349,11 @@ virStorageBackendISCSIConnection(const char *portal,
"--targetname", target,
NULL
};
- int i;
- int nargs = 0;
+ virCommandPtr cmd;
char *ifacename = NULL;
- const char **cmdargv;
-
- for (i = 0 ; baseargv[i] != NULL ; i++)
- nargs++;
- for (i = 0 ; extraargv[i] != NULL ; i++)
- nargs++;
- if (initiatoriqn)
- nargs += 2;
-
- if (VIR_ALLOC_N(cmdargv, nargs+1) < 0) {
- virReportOOMError();
- return -1;
- }
- nargs = 0;
- for (i = 0 ; baseargv[i] != NULL ; i++)
- cmdargv[nargs++] = baseargv[i];
- for (i = 0 ; extraargv[i] != NULL ; i++)
- cmdargv[nargs++] = extraargv[i];
+ cmd = virCommandNewArgs(baseargv);
+ virCommandAddArgSet(cmd, extraargv);
if (initiatoriqn) {
switch (virStorageBackendIQNFound(initiatoriqn, &ifacename)) {
@@ -377,7 +361,8 @@ virStorageBackendISCSIConnection(const char *portal,
VIR_DEBUG("ifacename: '%s'", ifacename);
break;
case IQN_MISSING:
- if (virStorageBackendCreateIfaceIQN(initiatoriqn, &ifacename) != 0) {
+ if (virStorageBackendCreateIfaceIQN(initiatoriqn,
+ &ifacename) != 0) {
goto cleanup;
}
break;
@@ -385,19 +370,16 @@ virStorageBackendISCSIConnection(const char *portal,
default:
goto cleanup;
}
-
- cmdargv[nargs++] = "--interface";
- cmdargv[nargs++] = ifacename;
+ virCommandAddArgList(cmd, "--interface", ifacename, NULL);
}
- cmdargv[nargs++] = NULL;
- if (virRun(cmdargv, NULL) < 0)
+ if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
ret = 0;
cleanup:
- VIR_FREE(cmdargv);
+ virCommandFree(cmd);
VIR_FREE(ifacename);
return ret;
--
1.7.4.4
13 years, 6 months
[libvirt] pci device passthrough: Failed to assign irq
by guan qin
Hi,
I encounter a problem that the eth can't be up in the VM by using VT-d.
I boot the VM using "virsh create vt_d.xml".
The VM could recongize the NIC which was assigned .then I do in VM as
follows:
#cat /sys/class/net/eth0/operstate
down
#ifconfig eth0 up
#cat /sys/class/net/eth0/operstate
down
#ficonfig eth 10.100.0.5
#cat /sys/class/net/eth0/operstate
down
I look into the qemu log file ,find that :
LC_ALL=C PATH=/usr/local/sbin:/usr/
local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/ QEMU_AUDIO_DRV=none
/usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 512 -smp
1,sockets=1,cores=1,threads=1 -name vt_d_5 -uuid
05f608a3-f64f-2418-a90a-d611982c8336 -nodefaults -chardev
socket,id=monitor,path=/var/lib/libvirt/qemu/vt_d_5.monitor,server,nowait
-mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive
file=/home/qinguan/exp/kvm_vtd/ubuntu_1.img,if=none,id=drive-virtio-disk0,boot=on,format=raw
-device
virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0
-usb -device usb-mouse,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device
pci-assign,host=00:19.0,id=hostdev0,bus=pci.0,addr=0x4 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
maybe the VM can't access to the network because of Failed to assign irg
for "hostdev0"?
in kern.log :
May 1 12:40:07 Optiplex-780 kernel: [ 3172.784803] e1000e 0000:00:19.0: PCI
INT A disabled
May 1 12:40:07 Optiplex-780 kernel: [ 3172.784863] pci-stub 0000:00:19.0:
claimed by stub
May 1 12:40:07 Optiplex-780 kernel: [ 3173.103965] pci-stub 0000:00:19.0:
PCI INT A -> GSI 21 (level, low) -> IRQ 21
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204030] pci-stub 0000:00:19.0:
restoring config space at offset 0x6 (was 0x1, writing 0xece1)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204035] pci-stub 0000:00:19.0:
restoring config space at offset 0x5 (was 0x0, writing 0xf7ad9000)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204039] pci-stub 0000:00:19.0:
restoring config space at offset 0x4 (was 0x0, writing 0xf7ae0000)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204045] pci-stub 0000:00:19.0:
restoring config space at offset 0x1 (was 0x100000, writing 0x100103)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.435751] assign device 0:0:19.0
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568526] pci-stub 0000:00:19.0:
restoring config space at offset 0x6 (was 0x1, writing 0xece1)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568532] pci-stub 0000:00:19.0:
restoring config space at offset 0x5 (was 0x0, writing 0xf7ad9000)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568537] pci-stub 0000:00:19.0:
restoring config space at offset 0x4 (was 0x0, writing 0xf7ae0000)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568543] pci-stub 0000:00:19.0:
restoring config space at offset 0x1 (was 0x100000, writing 0x100103)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568561] pci-stub 0000:00:19.0:
PCI INT A disabled
root@Optiplex-780:/var/log/libvirt/qemu# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
0: 97 1 2 1 IO-APIC-edge timer
1: 2 0 0 0 IO-APIC-edge i8042
7: 0 0 0 0 IO-APIC-edge
parport0
8: 1 0 0 0 IO-APIC-edge rtc0
9: 0 0 0 0 IO-APIC-fasteoi acpi
12: 1 2 1 0 IO-APIC-edge i8042
16: 0 0 0 0 IO-APIC-fasteoi
uhci_hcd:usb2
17: 5822 1952 3614 2233 IO-APIC-fasteoi
uhci_hcd:usb4, uhci_hcd:usb7
18: 0 0 0 0 IO-APIC-fasteoi
uhci_hcd:usb8
22: 1 1 1 0 IO-APIC-fasteoi
ehci_hcd:usb1, uhci_hcd:usb5
23: 1461 1299 1153 912 IO-APIC-fasteoi
ehci_hcd:usb3, uhci_hcd:usb6
24: 268579 0 0 0 HPET_MSI-edge hpet2
25: 0 286310 0 0 HPET_MSI-edge hpet3
26: 0 0 210675 0 HPET_MSI-edge hpet4
27: 0 0 0 256688 HPET_MSI-edge hpet5
29: 1 0 0 0 DMAR_MSI-edge dmar1
30: 0 0 0 0 DMAR_MSI-edge dmar0
31: 0 0 0 0 DMAR_MSI-edge dmar2
35: 0 0 0 1 PCI-MSI-edge eth1
36: 1456 916 1323 1657 PCI-MSI-edge
eth1-rx-0
37: 1031 772 1459 895 PCI-MSI-edge
eth1-rx-1
38: 958 965 785 470 PCI-MSI-edge
eth1-rx-2
39: 1319 557 1007 714 PCI-MSI-edge
eth1-rx-3
40: 892 864 417 1134 PCI-MSI-edge
eth1-tx-0
41: 414 749 998 606 PCI-MSI-edge
eth1-tx-1
42: 307 921 375 332 PCI-MSI-edge
eth1-tx-2
43: 966 693 396 502 PCI-MSI-edge
eth1-tx-3
54: 7109 5755 5683 5609 PCI-MSI-edge ahci
55: 74 105 73 84 PCI-MSI-edge
hda_intel
56: 1446 927 1108 870 PCI-MSI-edge i915
NMI: 0 0 0 0 Non-maskable interrupts
LOC: 740 725 703 677 Local timer interrupts
SPU: 0 0 0 0 Spurious interrupts
PMI: 0 0 0 0 Performance monitoring
interrupts
PND: 0 0 0 0 Performance pending work
RES: 665 679 714 547 Rescheduling interrupts
CAL: 5332 408 5619 539 Function call interrupts
TLB: 1880 2843 1788 3202 TLB shootdowns
TRM: 0 0 0 0 Thermal event interrupts
THR: 0 0 0 0 Threshold APIC interrupts
MCE: 0 0 0 0 Machine check exceptions
MCP: 5 5 5 5 Machine check polls
ERR: 3
MIS: 0
root@Optiplex-780:/var/log/libvirt/qemu#
I search the similarly problems that sharing the irg but never find a
answer , and now I have no idea.
How to solve the problem ,can you help me ? thanks.
best regards,
qinguan
vt_d.xml:
<domain type='kvm'>
<name>test</name>
<description>just test using sriov!</description>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<memory>524288</memory>
<currentMemory>524288</
currentMemory>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features><pae/><acpi/><apic/></features>
<clock offset='utc'/>
<devices>
<input type='mouse' bus='usb'/>
<disk type='file' device='disk'>
<source file='/home/qinguan/exp/ubuntu_1.img'/>
<target dev='hda' bus='virtio'/>
</disk>
<emulator>/usr/bin/kvm</emulator>
<graphics type='vnc' port='-1'/>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address bus='0x0' slot='0x19' function='0x0'/>
</source>
</hostdev>
</devices>
</domain>
13 years, 6 months
[libvirt] Support for more than 32 virtio devices
by Badari Pulavarty
Hi,
How can I make use of "multifunction" functionality to support
more than 32 virtio devices in QEMU through libvirt ?
Are there corresponding changes in libvirt ?
Please let me know.
Thanks,
Badari
13 years, 6 months
[libvirt] failure to build on rawhide
by Eric Blake
I'm getting this when trying to build libvirt on rawhide (using the
package gnutls-devel-2.12.3-1.fc16.x86_64):
remote/remote_driver.c: In function 'negotiate_gnutls_on_connection':
remote/remote_driver.c:1361:9: error:
'gnutls_certificate_type_set_priority' is deprecated (declared at
/usr/include/gnutls/compat.h:347) [-Werror=deprecated-declarations]
but I can't find anything in the gnutls man pages that says why it is
deprecated or what to use in its place. Any ideas?
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
13 years, 6 months
[libvirt] [PATCH] lxc: Do not try to reconnect inactive domain when do lxcStartup
by Osier Yang
Otherwise if there are inactive lxc domains, lxcStartup will
try to reconnect to sockets of these domains, which results in
errors in libvirtd log.
---
src/lxc/lxc_driver.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index e905302..ef7827b 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1992,6 +1992,9 @@ lxcReconnectVM(void *payload, const void *name ATTRIBUTE_UNUSED, void *opaque)
virDomainObjLock(vm);
+ if (!virDomainObjIsActive(vm))
+ goto cleanup;
+
priv = vm->privateData;
if ((priv->monitor = lxcMonitorClient(driver, vm)) < 0) {
goto cleanup;
--
1.7.4
13 years, 6 months
[libvirt] libvirt tracking of hung/stopped QEMU VMs
by Ryan Harper
I've encountered an interesting scenario:
1. define a guest via virsh define <xml>
2 start this guest via virsh
3. one of the disk elements is a multipath device that is currently
misconfigured such that any io to the device hangs the calling process
4. libvirt times out when attemping to communicate via the monitor to
the guest (btw, this timeout isn't configurable AFAICT)
5. returns an error from create indicating that we failed to create the VM
At this point:
1) libvirt reports that the VM is stopped (and this is true, the qemu
process has never been issued the 'cont' command and thus won't ever
execute gues tcode)
2) the qemu process for this VM is still running (just blocked on IO)
3) it is possible that if the process becomes unblocked that the QEMU
process will be functional again, but won't be started, and the process
won't be terminated since libvirt isn't tracking this any more, and is
consuming some amount of resources that are allocated on start up.
How can we clean up from this failure scenario? Would it make sense for
libvirt to send a SIGTERM to a qemu if it failed to create? In the
above scenario, this would allow us to reap the process if it ever
became unblocked.
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh(a)us.ibm.com
13 years, 6 months
Re: [libvirt] Problem with libvirt on Fedora 14 with virt-preview repo
by Laine Stump
On 05/03/2011 04:16 PM, Scott Dowdle wrote:
> Greetings,
>
> I wasn't sure who to report this to... and I did a bugzilla search and didn't find anything... and I'm not sure where to report this to... since it isn't Fedora 14 exactly since I'm using the virt-preview repo.
I *think* the best place to report these bugs is at bugzilla.redhat.com,
Classification "Other", Product "Virtualization Tools", component
"libvirt". You could first try sending a message to
libvirt-users(a)redhat.com or libvir-list(a)redhat.com (the developers'
list) to see if it's a known problem though.
> I just did a bunch of updates on a Fedora 14 x86_64 box that has the virt-preview repo. I was using all of the new features with SPICE... but after updating I can't get libvirtd to start anymore. I get the following error message in /var/log/messages:
>
> May 3 14:20:04 virt-desk libvirtd: Could not find keytab file: /etc/libvirt/krb5.tab: No such file or directory
> May 3 14:20:04 virt-desk libvirtd: 14:20:04.854: 2746: info : libvirt version: 0.8.8, package: 4.fc14 (Unknown, 2011-04-07-15:51:18, fedora64.linuxtx.org)
> May 3 14:20:04 virt-desk libvirtd: 14:20:04.854: 2746: error : remoteCheckCertFile:288 : Cannot access CA certificate '/etc/pki/CA/cacert.pem': No such file or directory
>
> I look at the config files in /etc/libvirt/ and everything is commented out... so I'm not sure how to fix this via a config.
I'm not familiar with that part of the code, but it looks like the cert
check happens if listen_tls = 1, which is its default value. You can
disable it by uncommenting listen_tls=0 in /etc/libvirt/libvirtd.conf.
I'm not sure what undesired effects that will have on your system's
operation.
> Any help? Can anyone else reproduce this? As a result, I can't get libvirtd to start and my VMs are hosed. :( Shall I report the bug?
I'm Cc'ing this response to libvir-list. It's very likely a known
problem that I just didn't notice, and someone there will know about it.
> Scott Dowdle
> [address redacted :-)]
> Belgrade, MT 59714
Seriously? I was at MSU from 1981-1985. I'm guessing a lot has changed since then...
13 years, 6 months
[libvirt] [PATCH] qemu: silence clang false positives
by Eric Blake
Clang 2.8 wasn't quite able to follow that persistentDef was
assigned earlier if (flags & VIR_DOMAIN_MEM_CONFIG) is true.
Silence this false positive, to make clang analysis easier to use.
* src/qemu/qemu_driver.c (qemudDomainSetMemoryFlags): Add an
annotation to silence clang's claim of a NULL dereference.
---
I'm pushing this under the trivial rule - sa_assert is a no-op in
normal compilation, so this can't have any effect on the end
executable, but makes the rest of my clang analysis easier.
src/qemu/qemu_driver.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0919503..7132837 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1640,6 +1640,8 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
}
if (flags & VIR_DOMAIN_MEM_CONFIG) {
+ /* Help clang 2.8 decipher the logic flow. */
+ sa_assert(persistentDef);
persistentDef->mem.max_balloon = newmem;
if (persistentDef->mem.cur_balloon > newmem)
persistentDef->mem.cur_balloon = newmem;
@@ -1675,6 +1677,7 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
}
if (flags & VIR_DOMAIN_MEM_CONFIG) {
+ sa_assert(persistentDef);
persistentDef->mem.cur_balloon = newmem;
ret = virDomainSaveConfig(driver->configDir, persistentDef);
goto endjob;
--
1.7.4.4
13 years, 6 months
[libvirt] [PATCH] Add support for YAJL version 2 API/ABI
by Daniel P. Berrange
Version 2.0.0 or yajl changed API. It is fairly trivial for us to
cope with both APIs in libvirt, so adapt.
* configure.ac: Probe for yajl2 API
* src/util/json.c: Conditional support for yajl2 API
---
configure.ac | 8 ++++++++
src/util/json.c | 44 +++++++++++++++++++++++++++++++++++++++-----
2 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7c68bca..dc87347 100644
--- a/configure.ac
+++ b/configure.ac
@@ -878,6 +878,7 @@ AC_ARG_WITH([yajl],
YAJL_CFLAGS=
YAJL_LIBS=
+with_yajl2=no
if test "x$with_yajl" != "xno"; then
if test "x$with_yajl" != "xyes" && test "x$with_yajl" != "xcheck"; then
YAJL_CFLAGS="-I$with_yajl/include"
@@ -898,6 +899,9 @@ if test "x$with_yajl" != "xno"; then
AC_CHECK_LIB([yajl], [yajl_parse],[
YAJL_LIBS="$YAJL_LIBS -lyajl"
with_yajl=yes
+ AC_CHECK_LIB([yajl], [yajl_tree_parse],[
+ with_yajl2=yes
+ ],[])
],[
if test "x$with_yajl" = "xcheck" ; then
with_yajl=no
@@ -914,6 +918,10 @@ if test "x$with_yajl" != "xno"; then
AC_DEFINE_UNQUOTED([HAVE_YAJL], 1,
[whether YAJL is available for JSON parsing/formatting])
fi
+ if test "x$with_yajl2" = "xyes" ; then
+ AC_DEFINE_UNQUOTED([HAVE_YAJL2], 1,
+ [whether YAJL has API version 2])
+ fi
fi
AM_CONDITIONAL([HAVE_YAJL], [test "x$with_yajl" = "xyes"])
AC_SUBST([YAJL_CFLAGS])
diff --git a/src/util/json.c b/src/util/json.c
index 0daeae9..80dbca4 100644
--- a/src/util/json.c
+++ b/src/util/json.c
@@ -709,7 +709,12 @@ static int virJSONParserHandleBoolean(void * ctx, int boolean_)
static int virJSONParserHandleNumber(void * ctx,
const char * s,
- unsigned int l)
+#ifdef HAVE_YAJL2
+ size_t l
+#else
+ unsigned int l
+#endif
+ )
{
virJSONParserPtr parser = ctx;
char *str = strndup(s, l);
@@ -735,7 +740,12 @@ static int virJSONParserHandleNumber(void * ctx,
static int virJSONParserHandleString(void * ctx,
const unsigned char * stringVal,
- unsigned int stringLen)
+#ifdef HAVE_YAJL2
+ size_t stringLen
+#else
+ unsigned int stringLen
+#endif
+ )
{
virJSONParserPtr parser = ctx;
virJSONValuePtr value = virJSONValueNewStringLen((const char *)stringVal,
@@ -756,7 +766,12 @@ static int virJSONParserHandleString(void * ctx,
static int virJSONParserHandleMapKey(void * ctx,
const unsigned char * stringVal,
- unsigned int stringLen)
+#ifdef HAVE_YAJL2
+ size_t stringLen
+#else
+ unsigned int stringLen
+#endif
+ )
{
virJSONParserPtr parser = ctx;
virJSONParserStatePtr state;
@@ -894,14 +909,22 @@ static const yajl_callbacks parserCallbacks = {
/* XXX add an incremental streaming parser - yajl trivially supports it */
virJSONValuePtr virJSONValueFromString(const char *jsonstring)
{
- yajl_parser_config cfg = { 1, 1 };
yajl_handle hand;
virJSONParser parser = { NULL, NULL, 0 };
virJSONValuePtr ret = NULL;
+#ifndef HAVE_YAJL2
+ yajl_parser_config cfg = { 1, 1 };
+#endif
VIR_DEBUG("string=%s", jsonstring);
+#ifdef HAVE_YAJL2
+ hand = yajl_alloc(&parserCallbacks, NULL, &parser);
+ yajl_config(hand, yajl_allow_comments, 1);
+ yajl_config(hand, yajl_dont_validate_strings, 0);
+#else
hand = yajl_alloc(&parserCallbacks, &cfg, NULL, &parser);
+#endif
if (yajl_parse(hand,
(const unsigned char *)jsonstring,
@@ -1002,15 +1025,26 @@ static int virJSONValueToStringOne(virJSONValuePtr object,
char *virJSONValueToString(virJSONValuePtr object)
{
- yajl_gen_config conf = { 0, " " }; /* Turns off pretty printing since QEMU can't cope */
yajl_gen g;
const unsigned char *str;
char *ret = NULL;
+#ifdef HAVE_YAJL2
+ size_t len;
+#else
unsigned int len;
+ yajl_gen_config conf = { 0, " " }; /* Turns off pretty printing since QEMU can't cope */
+#endif
VIR_DEBUG("object=%p", object);
+#ifdef HAVE_YAJL2
+ g = yajl_gen_alloc(NULL);
+ yajl_gen_config(g, yajl_gen_beautify, 0);
+ yajl_gen_config(g, yajl_gen_indent_string, " ");
+ yajl_gen_config(g, yajl_gen_validate_utf8, 1);
+#else
g = yajl_gen_alloc(&conf, NULL);
+#endif
if (virJSONValueToStringOne(object, g) < 0) {
virReportOOMError();
--
1.7.4.4
13 years, 6 months