[libvirt] [PATCH 0/2] Cleanup storage migration code a bit
by Jiri Denemark
Jiri Denemark (2):
qemu: Keep track of what disks are being migrated
qemu: Don't give up on first error in qemuMigrationCancelDriverMirror
src/conf/domain_conf.h | 2 ++
src/qemu/qemu_migration.c | 36 +++++++++++++++++-------------------
2 files changed, 19 insertions(+), 19 deletions(-)
--
2.4.0
9 years, 7 months
[libvirt] [PATCH] daemon: logging: Suppress logging of VIR_ERR_NO_DOMAIN_METADATA
by Peter Krempa
Similarly to other error codes that notify the user that the object does
not exist lower the priority of VIR_ERR_NO_DOMAIN_METADATA to
VIR_LOG_DEBUG when writing the log entry.
---
daemon/libvirtd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 107b88d..3e7f87c 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -320,6 +320,7 @@ static int daemonErrorLogFilter(virErrorPtr err, int priority)
case VIR_ERR_NO_SECRET:
case VIR_ERR_NO_DOMAIN_SNAPSHOT:
case VIR_ERR_OPERATION_INVALID:
+ case VIR_ERR_NO_DOMAIN_METADATA:
return VIR_LOG_DEBUG;
}
--
2.3.5
9 years, 7 months
[libvirt] [PATCH 0/2] remove 2 unused functions
by Zhang Bo
From: YueWenyuan <yuewenyuan(a)huawei.com>
remove unused functions virTimeFieldsNow() and virTimeFieldsNowRaw()
YueWenyuan (2):
remove unused function virTimeFieldsNow
remove unused function virTimeFieldsNowRaw
src/libvirt_private.syms | 2 --
src/util/virtime.c | 43 -------------------------------------------
src/util/virtime.h | 4 ----
3 files changed, 49 deletions(-)
--
1.7.12.4
9 years, 7 months
[libvirt] [PATCH v2] XML: escape strings where we should do it
by Pavel Hrdina
There is a lot of places, were it's pretty ease for user to enter some
characters that we need to escape to create a valid XML description.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1197580
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Previous version:
https://www.redhat.com/archives/libvir-list/2015-May/msg00110.html
I've went through all the usage of virBufferAsprintf and hopefully I didn't miss
any wrong usage.
src/conf/capabilities.c | 6 ++--
src/conf/cpu_conf.c | 6 ++--
src/conf/domain_capabilities.c | 2 +-
src/conf/domain_conf.c | 63 +++++++++++++++++++++---------------------
src/conf/network_conf.c | 17 ++++++------
src/conf/node_device_conf.c | 4 +--
6 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index c43bfb3..6bd06e5 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -682,9 +682,9 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
virBufferAsprintf(&buf, "domaintype=%s ",
virDomainVirtTypeToString(domaintype));
if (emulator)
- virBufferAsprintf(&buf, "emulator=%s ", emulator);
+ virBufferEscapeString(&buf, "emulator=%s ", emulator);
if (machinetype)
- virBufferAsprintf(&buf, "machine=%s ", machinetype);
+ virBufferEscapeString(&buf, "machine=%s ", machinetype);
if (virBufferCurrentContent(&buf) &&
!virBufferCurrentContent(&buf)[0])
virBufferAsprintf(&buf, "%s", _("any configuration"));
@@ -903,7 +903,7 @@ virCapabilitiesFormatXML(virCapsPtr caps)
virBufferAdjustIndent(&buf, 2);
for (i = 0; i < caps->host.nmigrateTrans; i++) {
virBufferAsprintf(&buf, "<uri_transport>%s</uri_transport>\n",
- caps->host.migrateTrans[i]);
+ caps->host.migrateTrans[i]);
}
virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</uri_transports>\n");
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index e959ecc..1ba1d82 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -544,17 +544,17 @@ virCPUDefFormatBuf(virBufferPtr buf,
}
virBufferAsprintf(buf, " fallback='%s'", fallback);
if (def->vendor_id)
- virBufferAsprintf(buf, " vendor_id='%s'", def->vendor_id);
+ virBufferEscapeString(buf, " vendor_id='%s'", def->vendor_id);
}
if (formatModel && def->model) {
- virBufferAsprintf(buf, ">%s</model>\n", def->model);
+ virBufferEscapeString(buf, ">%s</model>\n", def->model);
} else {
virBufferAddLit(buf, "/>\n");
}
}
if (formatModel && def->vendor)
- virBufferAsprintf(buf, "<vendor>%s</vendor>\n", def->vendor);
+ virBufferEscapeString(buf, "<vendor>%s</vendor>\n", def->vendor);
if (def->sockets && def->cores && def->threads) {
virBufferAddLit(buf, "<topology");
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 7c59912..0e32f52 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -272,7 +272,7 @@ virDomainCapsFormatInternal(virBufferPtr buf,
virBufferAddLit(buf, "<domainCapabilities>\n");
virBufferAdjustIndent(buf, 2);
- virBufferAsprintf(buf, "<path>%s</path>\n", caps->path);
+ virBufferEscapeString(buf, "<path>%s</path>\n", caps->path);
virBufferAsprintf(buf, "<domain>%s</domain>\n", virttype_str);
virBufferAsprintf(buf, "<machine>%s</machine>\n", caps->machine);
virBufferAsprintf(buf, "<arch>%s</arch>\n", arch_str);
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e3e0f63..4c3f46f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3724,7 +3724,7 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
virBufferAsprintf(buf, " bar='%s'", rombar);
}
if (info->romfile)
- virBufferAsprintf(buf, " file='%s'", info->romfile);
+ virBufferEscapeString(buf, " file='%s'", info->romfile);
virBufferAddLit(buf, "/>\n");
}
@@ -17712,7 +17712,7 @@ virSecurityDeviceLabelDefFormat(virBufferPtr buf,
virBufferAddLit(buf, "<seclabel");
if (def->model)
- virBufferAsprintf(buf, " model='%s'", def->model);
+ virBufferEscapeString(buf, " model='%s'", def->model);
if (def->labelskip)
virBufferAddLit(buf, " labelskip='yes'");
@@ -19246,50 +19246,51 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
break;
case VIR_DOMAIN_CHR_TYPE_NMDM:
- virBufferAsprintf(buf, "<source master='%s' slave='%s'/>\n",
- def->data.nmdm.master,
- def->data.nmdm.slave);
+ virBufferEscapeString(buf, "<source master='%s' ",
+ def->data.nmdm.master);
+ virBufferEscapeString(buf, "slave='%s'/>\n", def->data.nmdm.slave);
break;
case VIR_DOMAIN_CHR_TYPE_UDP:
if (def->data.udp.bindService &&
def->data.udp.bindHost) {
- virBufferAsprintf(buf,
- "<source mode='bind' host='%s' "
- "service='%s'/>\n",
- def->data.udp.bindHost,
- def->data.udp.bindService);
+ virBufferEscapeString(buf,
+ "<source mode='bind' host='%s' ",
+ def->data.udp.bindHost);
+ virBufferEscapeString(buf,
+ "service='%s'/>\n",
+ def->data.udp.bindService);
} else if (def->data.udp.bindHost) {
- virBufferAsprintf(buf, "<source mode='bind' host='%s'/>\n",
- def->data.udp.bindHost);
+ virBufferEscapeString(buf, "<source mode='bind' host='%s'/>\n",
+ def->data.udp.bindHost);
} else if (def->data.udp.bindService) {
- virBufferAsprintf(buf, "<source mode='bind' service='%s'/>\n",
- def->data.udp.bindService);
+ virBufferEscapeString(buf, "<source mode='bind' service='%s'/>\n",
+ def->data.udp.bindService);
}
if (def->data.udp.connectService &&
def->data.udp.connectHost) {
- virBufferAsprintf(buf,
- "<source mode='connect' host='%s' "
- "service='%s'/>\n",
- def->data.udp.connectHost,
- def->data.udp.connectService);
+ virBufferEscapeString(buf,
+ "<source mode='connect' host='%s' ",
+ def->data.udp.connectHost);
+ virBufferEscapeString(buf,
+ "service='%s'/>\n",
+ def->data.udp.connectService);
} else if (def->data.udp.connectHost) {
- virBufferAsprintf(buf, "<source mode='connect' host='%s'/>\n",
- def->data.udp.connectHost);
+ virBufferEscapeString(buf, "<source mode='connect' host='%s'/>\n",
+ def->data.udp.connectHost);
} else if (def->data.udp.connectService) {
- virBufferAsprintf(buf,
- "<source mode='connect' service='%s'/>\n",
- def->data.udp.connectService);
+ virBufferEscapeString(buf,
+ "<source mode='connect' service='%s'/>\n",
+ def->data.udp.connectService);
}
break;
case VIR_DOMAIN_CHR_TYPE_TCP:
- virBufferAsprintf(buf,
- "<source mode='%s' host='%s' service='%s'/>\n",
- def->data.tcp.listen ? "bind" : "connect",
- def->data.tcp.host,
- def->data.tcp.service);
+ virBufferAsprintf(buf, "<source mode='%s' ",
+ def->data.tcp.listen ? "bind" : "connect");
+ virBufferEscapeString(buf, "host='%s' ", def->data.tcp.host);
+ virBufferEscapeString(buf, "service='%s'/>\n", def->data.tcp.service);
virBufferAsprintf(buf, "<protocol type='%s'/>\n",
virDomainChrTcpProtocolTypeToString(
def->data.tcp.protocol));
@@ -19303,8 +19304,8 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
break;
case VIR_DOMAIN_CHR_TYPE_SPICEPORT:
- virBufferAsprintf(buf, "<source channel='%s'/>\n",
- def->data.spiceport.channel);
+ virBufferEscapeString(buf, "<source channel='%s'/>\n",
+ def->data.spiceport.channel);
break;
}
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 5b734f2..aa607a8 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -2422,21 +2422,20 @@ virNetworkDNSDefFormat(virBufferPtr buf,
}
for (i = 0; i < def->ntxts; i++) {
- virBufferAsprintf(buf, "<txt name='%s' value='%s'/>\n",
- def->txts[i].name,
- def->txts[i].value);
+ virBufferEscapeString(buf, "<txt name='%s' ", def->txts[i].name);
+ virBufferEscapeString(buf, "value='%s'/>\n", def->txts[i].value);
}
for (i = 0; i < def->nsrvs; i++) {
if (def->srvs[i].service && def->srvs[i].protocol) {
- virBufferAsprintf(buf, "<srv service='%s' protocol='%s'",
- def->srvs[i].service,
- def->srvs[i].protocol);
+ virBufferEscapeString(buf, "<srv service='%s' ",
+ def->srvs[i].service);
+ virBufferEscapeString(buf, "protocol='%s'", def->srvs[i].protocol);
if (def->srvs[i].domain)
virBufferAsprintf(buf, " domain='%s'", def->srvs[i].domain);
if (def->srvs[i].target)
- virBufferAsprintf(buf, " target='%s'", def->srvs[i].target);
+ virBufferEscapeString(buf, " target='%s'", def->srvs[i].target);
if (def->srvs[i].port)
virBufferAsprintf(buf, " port='%d'", def->srvs[i].port);
if (def->srvs[i].priority)
@@ -2455,8 +2454,8 @@ virNetworkDNSDefFormat(virBufferPtr buf,
virBufferAsprintf(buf, "<host ip='%s'>\n", ip);
virBufferAdjustIndent(buf, 2);
for (j = 0; j < def->hosts[i].nnames; j++)
- virBufferAsprintf(buf, "<hostname>%s</hostname>\n",
- def->hosts[i].names[j]);
+ virBufferEscapeString(buf, "<hostname>%s</hostname>\n",
+ def->hosts[i].names[j]);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</host>\n");
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index a286847..feae3d4 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -514,8 +514,8 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDef *def)
virBufferEscapeString(&buf, "<vendor>%s</vendor>\n",
data->storage.vendor);
if (data->storage.serial)
- virBufferAsprintf(&buf, "<serial>%s</serial>\n",
- data->storage.serial);
+ virBufferEscapeString(&buf, "<serial>%s</serial>\n",
+ data->storage.serial);
if (data->storage.flags & VIR_NODE_DEV_CAP_STORAGE_REMOVABLE) {
int avl = data->storage.flags &
VIR_NODE_DEV_CAP_STORAGE_REMOVABLE_MEDIA_AVAILABLE;
--
2.3.6
9 years, 7 months
[libvirt] [PATCH] libvirt-guests: Initialize SYNC_TIME
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1191227
Since 0fa15b19 we have this variable SYNC_TIME which allows users to
synchronize time on domain resume. However, despite what documentation
says, it's by default on because it's never initialized. Fix this by
setting it to zero at the beginning of the libvirt-guests script.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/libvirt-guests.sh.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index 9aa06fa..7f74b85 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -39,6 +39,7 @@ START_DELAY=0
BYPASS_CACHE=0
CONNECT_RETRIES=10
RETRIES_SLEEP=1
+SYNC_TIME=0
test -f "$sysconfdir"/sysconfig/libvirt-guests &&
. "$sysconfdir"/sysconfig/libvirt-guests
--
2.3.6
9 years, 7 months
[libvirt] Plans for supporting smbios type 2 ( baseboard/module info ) in libvirt
by Soumik Bhattacharya
Hi Experts,
Just wondering if there are plans to implement smbios type 2 parameters
in libvirt ? I am
trying to pass a couple of critical parameters ( especially 'location' ) to
qemu via libvirt but
it's failing ( silently ignored ) currently due to libvirt not supporting
smbios type 2 ( yet ), even
though qemu does support it.
Libvirt version used = 1.2.2
Qemu version used = 2.0.0
Thanks & regards,
Soumik
9 years, 7 months
[libvirt] [PATCH] maint: increase stack frame size limit
by Roman Bogorodskiy
Currently the stack frame size limit is set to 4096 and it started to
cause an error like this:
virshtest.c:253:1: error: stack frame size of 5512 bytes in function
'mymain' [-Werror,-Wframe-larger-than=]
mymain(void)
^
1 error generated.
Increase it to 6144.
---
m4/virt-compile-warnings.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 8aebdb0..1478753 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -153,7 +153,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
# This should be < 256 really. Currently we're down to 4096,
# but using 1024 bytes sized buffers (mostly for virStrerror)
# stops us from going down further
- wantwarn="$wantwarn -Wframe-larger-than=4096"
+ wantwarn="$wantwarn -Wframe-larger-than=6144"
dnl wantwarn="$wantwarn -Wframe-larger-than=256"
# Extra special flags
--
2.3.7
9 years, 7 months
[libvirt] [PATCH 0/2] FreeBSD/gcc fixes
by Roman Bogorodskiy
Due to clang problems[1] I've switched to gcc from FreeBSD ports.
That involves some minor fixes provided in this series.
Roman Bogorodskiy (2):
bhyve: fix bhyvexml2argvtest build with gcc
maint: extend PIE support check
m4/virt-compile-pie.m4 | 4 ++--
tests/bhyvexml2argvtest.c | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)
--
2.3.7
9 years, 7 months
[libvirt] [PATCH 0/2] Introduce pci-serial
by Michal Privoznik
It's very similar to usb-serial. You wouldn't guess the difference :-P
Michal Privoznik (2):
Introduce pci-serial
qemu: Implement pci-serial
docs/formatdomain.html.in | 16 ++++++----
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 18 +++++++++++
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
.../qemuxml2argv-pci-serial-dev-chardev.args | 7 ++++
.../qemuxml2argv-pci-serial-dev-chardev.xml | 37 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
tests/qemuxml2xmltest.c | 1 +
17 files changed, 89 insertions(+), 7 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-serial-dev-chardev.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-serial-dev-chardev.xml
--
2.3.6
9 years, 7 months
[libvirt] [PATCH] Assign virtio-serial addresses after coldplugging a device
by Ján Tomko
Otherwise we might allow coldplugging a device
that uses an address that is already occupied, creating
an unstartable domain.
https://bugzilla.redhat.com/show_bug.cgi?id=1076708#c10
---
src/qemu/qemu_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d173aa1..bab20c6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8326,6 +8326,8 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
dev->data.chr = NULL;
if (virDomainDefAddImplicitControllers(vmdef) < 0)
return -1;
+ if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
+ return -1;
break;
case VIR_DOMAIN_DEVICE_FS:
--
2.0.5
9 years, 7 months