[libvirt] [PATCH] Adjust backslash alignment syntax-check
by Martin Kletzander
We have a check for backslash alignment that checks for two blanks preceding a
backslash. However there can be alignment done using a tabulator and in some
cases one might be enough. There are none currently, but I found out that was
the case before. at some point. so let's check for \t preceding the final
backslash as well.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
cfg.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cfg.mk b/cfg.mk
index 5321a52b7ee2..ea10ca19f512 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1038,7 +1038,7 @@ sc_prohibit_http_urls:
$(_sc_search_regexp)
sc_prohibit_backslash_alignment:
- @prohibit='[[:blank:]][[:blank:]]\\$$' \
+ @prohibit='([[:blank:]][[:blank:]]| )\\$$' \
in_vc_files='*\.([chx]|am|mk)$$' \
halt='Do not attempt to right-align backslashes' \
$(_sc_search_regexp)
--
2.15.0
6 years, 11 months
[libvirt] [PATCH jenkins-ci] Make args to 'go test' configurable
by Daniel P. Berrange
Each module has its own set of tags it may wish to pass to 'go test',
so set it based on an env variable
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
jobs/go.yaml | 2 +-
projects/libvirt-go-xml.yaml | 2 ++
projects/libvirt-go.yaml | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/jobs/go.yaml b/jobs/go.yaml
index 93b61ca..29a9f51 100644
--- a/jobs/go.yaml
+++ b/jobs/go.yaml
@@ -80,7 +80,7 @@
- shell: |
{global_env}
{local_env}
- go test -tags api
+ go test $TEST_ARGS
publishers:
- email:
recipients: '{obj:spam}'
diff --git a/projects/libvirt-go-xml.yaml b/projects/libvirt-go-xml.yaml
index 1c42e3d..3083b9f 100644
--- a/projects/libvirt-go-xml.yaml
+++ b/projects/libvirt-go-xml.yaml
@@ -11,6 +11,8 @@
- libvirt-freebsd-10
- libvirt-freebsd-11
title: Libvirt Go XML
+ local_env: |
+ export TEST_ARGS="-tags xmlroundtrip"
jobs:
- go-build-job:
parent_jobs:
diff --git a/projects/libvirt-go.yaml b/projects/libvirt-go.yaml
index faa5265..141c862 100644
--- a/projects/libvirt-go.yaml
+++ b/projects/libvirt-go.yaml
@@ -11,6 +11,8 @@
- libvirt-freebsd-10
- libvirt-freebsd-11
title: Libvirt Go
+ local_env: |
+ export TEST_ARGS="-tags api"
jobs:
- go-build-job:
parent_jobs: 'libvirt-master-build'
--
2.14.3
6 years, 11 months
[libvirt] [PATCH 0/3] Adjust some formatting for numa distance code and resolve a memory leak
by John Ferlan
While reviewing the recent distance adjustments for Michal, I noted a
couple of minor formatting things as well as a memory leak when removing
the distances.
John Ferlan (3):
conf: Clean up virDomainNumaDefNodeDistanceParseXML
conf: Clean up virDomainNumaDefCPUFormatXML
conf: Fix memory leak for distances in virDomainNumaFree
src/conf/numa_conf.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--
2.13.6
6 years, 11 months
[libvirt] [PATCH v3 REBASE v2 0/2] qemu: report block job errors from qemu to the user
by Nikolay Shirokovskiy
So that you can see nice report on migration:
"error: operation failed: migration of disk sda failed: No space left on device"
diff from v2:
============
1. split into 2 patches
2. change formal documentation where it is present accordingly
3. add variable initialization for safety
Nikolay Shirokovskiy (2):
qemu: prepare blockjob complete event error usage
qemu: report drive mirror errors on migration
src/qemu/qemu_blockjob.c | 14 +++++++++--
src/qemu/qemu_blockjob.h | 3 ++-
src/qemu/qemu_domain.c | 10 +++++++-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_migration.c | 55 +++++++++++++++++++++++++++++++-------------
src/qemu/qemu_monitor.c | 5 ++--
src/qemu/qemu_monitor.h | 4 +++-
src/qemu/qemu_monitor_json.c | 4 +++-
src/qemu/qemu_process.c | 4 ++++
10 files changed, 78 insertions(+), 26 deletions(-)
--
1.8.3.1
6 years, 11 months
[libvirt] [PATCH] conf: fix migratable XML for graphics if socket is generated based on config
by Pavel Hrdina
The graphics code is complex and there are a lot of exceptions and
backward compatible combinations. One of them is the possibility
to configure "spice_auto_unix_socket" in qemu.conf which will convert
all spice graphics with listen type "address" without any address
specified to listen type "socket" when the guest is started.
We don't format this generated socket into migratable XML to make
migration work with older libvirt. However, spice has another
exception that if autoport='no' and there is no port configured
it is converted to listen type "none". Because of this we need
to format autoport='yes' to make sure that the listen type will
be the same as the offline XML.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511407
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/conf/domain_conf.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b31917dad9..6b35ebf2e9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -25159,6 +25159,18 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
+ /* If socket is auto-generated based on config option we don't
+ * add any listen element into migratable XML because the original
+ * listen type is "address".
+ * We need to set autoport to make sure that libvirt on destination
+ * will parse it as listen type "address", without autoport it is
+ * parsed as listen type "none". */
+ if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) &&
+ glisten->fromConfig) {
+ virBufferAddStr(buf, " autoport='yes'");
+ }
+ break;
+
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST:
break;
}
--
2.14.3
6 years, 11 months
[libvirt] [PATCH 0/4] Fix hotplug after daemon restart
by Ján Tomko
The logic in virQEMUCapsHasPCIMultiBus cannot be reasonably fixed
for already running domains, since we dropped the MULTIBUS capability,
so only resort to calling it if the domain is using user aliases.
That way only hotplug on PPC machines other than pseries with QEMU < 2.0
(possibly older) that have a user alias on pci-root controller stays broken.
Ján Tomko (4):
Move USER_ALIAS_PREFIX to the header file
qemu: prefer the PCI bus alias from status XML
virQEMUCapsHasPCIMultiBus: use def->os.arch
virQEMUCapsHasPCIMultiBus: assume true if we have no version
information
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 2 ++
src/qemu/qemu_capabilities.c | 18 +++++-----
src/qemu/qemu_capspriv.h | 4 ---
src/qemu/qemu_command.c | 42 +++++++++++-----------
.../ppc64-modern-bulk-result-live.xml | 2 +-
.../ppc64-modern-individual-result-live.xml | 2 +-
.../x86-modern-bulk-result-live.xml | 2 +-
.../x86-modern-individual-add-result-live.xml | 2 +-
.../x86-old-bulk-result-live.xml | 2 +-
tests/qemuxml2argvtest.c | 5 ---
11 files changed, 39 insertions(+), 45 deletions(-)
--
2.13.6
6 years, 11 months
[libvirt] [PATCH 0/3] qemu: Yet another backingStore terminator fix (blockdev-add saga)
by Peter Krempa
Raw images would not get the <backingStore/> terminator due to the
changes.
Peter Krempa (3):
qemu: domain: Refactor control flow in qemuDomainDetermineDiskChain
qemu: process: Move handling of non-backing files into
qemuDomainDetermineDiskChain
qemu: domain: Fix backing store terminator for non-backing local files
src/qemu/qemu_domain.c | 59 ++++++++++++++--------
src/qemu/qemu_process.c | 10 ----
.../qemuhotplug-base-ccw-live+ccw-virtio.xml | 1 +
...live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 2 +
...qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 1 +
...-live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 1 +
...-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 1 +
...-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml | 1 +
.../qemuhotplug-base-live+disk-scsi.xml | 1 +
.../qemuhotplug-base-live+disk-usb.xml | 1 +
.../qemuhotplug-base-live+disk-virtio.xml | 1 +
...se-without-scsi-controller-live+disk-scsi-2.xml | 1 +
12 files changed, 50 insertions(+), 30 deletions(-)
--
2.14.3
6 years, 11 months
[libvirt] [PATCH] qemu: forbid user aliases for implicit pci-root controllers
by Ján Tomko
For implicit controllers, we do not format user aliases on the command
line so we provide a translation between the user alias and the qemu
alias.
However for pci-root controllers, the logic determining whether to use
'pci' or 'pci.0' depends on:
* domain architecture
* machine type
* QEMU version (for PPC)
Since we do not store the QEMU version in status XML and as of
commit 5b783379 we no longer have the QEMU_CAPS_PCI_MULTIBUS
capability formatted there either, we can only rely on the alias
of the controller formatted there.
Forbid user aliases for the implicit pci-root controllers so that
we retain this information.
This allows us to drop the call to virQEMUCapsHasPCIMultiBus,
and fixing hotplug after daemon restart, since virQEMUCapsHasPCIMultiBus
relies on qemuCaps->arch which is not filled out by reading
the status XML either.
Partially reverts commit 937f3195 which added the user alias ->
qemu alias mapping for implicit PCI controllers.
https://bugzilla.redhat.com/show_bug.cgi?id=1518148
---
While we cannot reliably map user aliases to qemu aliases in
every corner case, I am not sure where to draw the line.
For x86_64, HasPCIMultiBus could be fixed by using def->os.arch instead
of qemuCaps->arch. So only PPC is unfixable, but this looked like the option
with the least amount of exceptions.
src/conf/domain_conf.c | 3 +--
src/conf/domain_conf.h | 2 ++
src/qemu/qemu_command.c | 16 +++++--------
src/qemu/qemu_domain.c | 26 +++++++++++++++++++++-
.../qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 4 +---
5 files changed, 35 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 66536653b..d3cd598c8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6623,7 +6623,6 @@ virDomainDeviceAddressParseXML(xmlNodePtr address,
}
-#define USER_ALIAS_PREFIX "ua-"
#define USER_ALIAS_CHARS \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"
@@ -6680,7 +6679,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED,
if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) ||
(xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_USER_ALIAS &&
- STRPREFIX(aliasStr, USER_ALIAS_PREFIX) &&
+ STRPREFIX(aliasStr, VIR_DOMAIN_USER_ALIAS_PREFIX) &&
strspn(aliasStr, USER_ALIAS_CHARS) == strlen(aliasStr)))
VIR_STEAL_PTR(info->alias, aliasStr);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index dabbff1c2..de34fb163 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -57,6 +57,8 @@
# include "virtypedparam.h"
# include "virsavecookie.h"
+# define VIR_DOMAIN_USER_ALIAS_PREFIX "ua-"
+
/* forward declarations of all device types, required by
* virDomainDeviceDef
*/
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0eb591253..89e8b5350 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -321,16 +321,12 @@ qemuBuildDeviceAddressStr(virBufferPtr buf,
contIsPHB = virDomainControllerIsPSeriesPHB(cont);
contTargetIndex = cont->opts.pciopts.targetIndex;
- /* When domain has builtin pci-root controller we don't put it
- * onto cmd line. Therefore we can't set its alias. In that
- * case, use the default one. */
- if (!qemuDomainIsPSeries(domainDef) &&
- cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) {
- if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef))
- contAlias = "pci.0";
- else
- contAlias = "pci";
- } else if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) {
+ /* The builtin pcie-root controller is not put on the command line.
+ * We cannot set a user alias, but we can reliably predict the one
+ * qemu will use.
+ * For builtin pci-root controllers we cannot do that once a domain
+ * is started, but user aliases are forbidden for those. */
+ if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) {
contAlias = "pcie.0";
} else {
contAlias = cont->info.alias;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9dab6b24b..ec33f3bad 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3718,6 +3718,27 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk)
static int
+qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller,
+ const virDomainDef *def)
+{
+ /* Forbid user aliases for implicit controllers where
+ * the qemu's device alias depends on the version and therefore
+ * we cannot figure it out for an already running domain. */
+ if (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT &&
+ !qemuDomainIsPSeries(def) &&
+ controller->info.alias &&
+ STRPREFIX(controller->info.alias, VIR_DOMAIN_USER_ALIAS_PREFIX)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("user aliases are not available for "
+ "implicit pci-root controller"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int
qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
const virDomainDef *def,
void *opaque ATTRIBUTE_UNUSED)
@@ -3761,11 +3782,14 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
ret = qemuDomainDeviceDefValidateDisk(dev->data.disk);
break;
+ case VIR_DOMAIN_DEVICE_CONTROLLER:
+ ret = qemuDomainDeviceDefValidateController(dev->data.controller, def);
+ break;
+
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_FS:
case VIR_DOMAIN_DEVICE_INPUT:
case VIR_DOMAIN_DEVICE_SOUND:
- case VIR_DOMAIN_DEVICE_CONTROLLER:
case VIR_DOMAIN_DEVICE_GRAPHICS:
case VIR_DOMAIN_DEVICE_HUB:
case VIR_DOMAIN_DEVICE_MEMBALLOON:
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
index c760098fe..d1cb8fea6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
@@ -74,9 +74,7 @@
<alias name='ua-SomeWeirdController'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <controller type='pci' index='0' model='pci-root'>
- <alias name='ua-MyPCIRootController'/>
- </controller>
+ <controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<alias name='ua-DoesAnybodyStillUseIDE'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
--
2.13.6
6 years, 11 months
[libvirt] [PATCH] qemu_agent: report VIR_ERR_AGENT_UNSYNCED if guest_sync failed.
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
Commit 5e5019bf removed this kind of error.
But we've already protected race condition by qemuDomainObjEnterAgent,
it was very unlikely to revieve a sync from other calls.
For call from virDomain*, it's better to show this error
if we really got a mismatch sync.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
src/qemu/qemu_agent.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 5d125c413..cdcacf5c8 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -354,7 +354,9 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
if (msg->id != id) {
VIR_DEBUG("Guest agent returned ID: %llu instead of %llu",
id, msg->id);
- ret = 0;
+ virReportError(VIR_ERR_AGENT_UNSYNCED,
+ _("Guest agent returned ID: %llu "
+ "instead of %llu"), id, msg->id);
goto cleanup;
}
}
--
2.14.3
6 years, 11 months