[libvirt] [PATCH] vz: support disabled items in prlsdk boot order
by Nikolay Shirokovskiy
---
src/vz/vz_sdk.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 8ccd7ea..a6eb0dd 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1736,11 +1736,8 @@ prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def)
pret = PrlBootDev_IsInUse(bootDev, &inUse);
prlsdkCheckRetGoto(pret, cleanup);
- if (!inUse) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Boot ordering with disabled items is not supported"));
- goto cleanup;
- }
+ if (!inUse)
+ continue;
pret = PrlBootDev_GetSequenceIndex(bootDev, &bootIndex);
prlsdkCheckRetGoto(pret, cleanup);
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH] vz: fix vz driver compilation
by Mikhail Feoktistov
- add argument xmlopt for virDomainDefCheckABIStability
- nseclabels is moved to virDomainChrSourceDefPtr
---
src/vz/vz_driver.c | 2 +-
src/vz/vz_sdk.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index d47774c..6f4aee3 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -872,7 +872,7 @@ vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
* So forbid this operation, if config is changed. If it's
* not changed - just do nothing. */
- if (!virDomainDefCheckABIStability(dom->def, def)) {
+ if (!virDomainDefCheckABIStability(dom->def, def, driver->xmlopt)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("Can't change domain configuration "
"in managed save state"));
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index a62b310..0aa1a30 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2894,7 +2894,7 @@ static int prlsdkCheckSerialUnsupportedParams(virDomainChrDefPtr chr)
return -1;
}
- if (chr->nseclabels > 0) {
+ if (chr->source->nseclabels > 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Setting security labels is not "
"supported by vz driver."));
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH] docs: news: Add entries for my recent changes
by Peter Krempa
---
docs/news.xml | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 27562e12b..f0c902fa4 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -48,8 +48,40 @@
</change>
</section>
<section title="Improvements">
+ <change>
+ <summary>
+ block copy job can be used with persistent domains
+ </summary>
+ <description>
+ Users who can tolerate that the block copy job might not be recovered
+ if a VM is shutdown until it finishes now may specify the
+ VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB flag to make block copy work for
+ persistent VMs too.
+ </description>
+ </change>
+ <change>
+ <summary>
+ JSON pseudo-protocol backing store parser supports new format of qemu 2.9
+ </summary>
+ <description>
+ QEMU 2.9 modified a few structures corresponding to the JSON format
+ of specifying a backing store for a disk image. Libvirt now implements
+ the new format.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
+ <change>
+ <summary>
+ block commit is now able to keep relative backing chain after snapshot again
+ </summary>
+ <description>
+ An external snapshot created with VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT
+ would not be scanned for metadata and thus if users specified a
+ relative path to the backing image this would not be detected. Block
+ commit operation then was unable to keep the relative relationship.
+ </description>
+ </change>
</section>
</release>
<release version="v3.4.0" date="2017-06-02">
--
2.12.2
7 years, 5 months
[libvirt] [PATCH v4] virsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND
by Daniel Liu
The option allows someone to run domain-to-native on already existing
domain without the need of supplying their XML. It is basically
wrapper around 'virsh dumpxml | virsh domxml-to-native /dev/stdin'.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=835476
Signed-off-by: Daniel Liu <srwx4096(a)gmail.com>
---
tools/virsh-domain.c | 51 ++++++++++++++++++++++++++++++++++++++-------------
tools/virsh.pod | 7 ++++---
2 files changed, 42 insertions(+), 16 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index ccb514ef9..3496359c5 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9848,9 +9848,13 @@ static const vshCmdOptDef opts_domxmltonative[] = {
.flags = VSH_OFLAG_REQ,
.help = N_("target config data type format")
},
+ {.name = "domain",
+ .type = VSH_OT_DATA,
+ .flags = VSH_OFLAG_REQ_OPT,
+ .help = N_("domain name, id or uuid")
+ },
{.name = "xml",
.type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
.help = N_("xml data file to export from")
},
{.name = NULL}
@@ -9859,30 +9863,51 @@ static const vshCmdOptDef opts_domxmltonative[] = {
static bool
cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
{
- bool ret = true;
+ bool ret = false;
const char *format = NULL;
- const char *xmlFile = NULL;
- char *configData;
- char *xmlData;
+ const char *xml = NULL;
+ char *xmlData = NULL;
+ char *configData = NULL;
unsigned int flags = 0;
virshControlPtr priv = ctl->privData;
+ virDomainPtr dom = NULL;
if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "xml", &xmlFile) < 0)
+ vshCommandOptStringReq(ctl, cmd, "xml", &xml) < 0)
return false;
- if (virFileReadAll(xmlFile, VSH_MAX_XML_FILE, &xmlData) < 0)
- return false;
+ VSH_EXCLUSIVE_OPTIONS("domain", "xml");
- configData = virConnectDomainXMLToNative(priv->conn, format, xmlData, flags);
- if (configData != NULL) {
- vshPrint(ctl, "%s", configData);
- VIR_FREE(configData);
+ if (vshCommandOptBool(cmd, "domain") &&
+ (!(dom = virshCommandOptDomain(ctl, cmd, NULL))))
+ return false;
+
+ if (dom) {
+ xmlData = virDomainGetXMLDesc(dom, flags);
+ } else if (xml) {
+ if (virFileReadAll(xml, VSH_MAX_XML_FILE, &xmlData) < 0)
+ goto cleanup;
} else {
- ret = false;
+ vshError(ctl, "%s", _("need either domain or domain XML"));
+ goto cleanup;
+ }
+
+ if (!xmlData) {
+ vshError(ctl, "%s", _("failed to retrieve XML"));
+ goto cleanup;
}
+ if (!(configData = virConnectDomainXMLToNative(priv->conn, format, xmlData, flags))) {
+ goto cleanup;
+ } else {
+ vshPrint(ctl, "%s", configData);
+ ret = true;
+ }
+
+ cleanup:
+ virshDomainFree(dom);
VIR_FREE(xmlData);
+ VIR_FREE(configData);
return ret;
}
diff --git a/tools/virsh.pod b/tools/virsh.pod
index aee964689..049c2f3c7 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1433,10 +1433,11 @@ the I<format> argument must be B<qemu-argv>. For Xen hypervisor, the
I<format> argument may be B<xen-xm>, B<xen-xl>, or B<xen-sxpr>. For
LXC hypervisor, the I<format> argument must be B<lxc-tools>.
-=item B<domxml-to-native> I<format> I<xml>
+=item B<domxml-to-native> I<format>
+{ I<--domain> I<domain-name-or-id-or-uuid> | [I<--xml>] I<xml> }
-Convert the file I<xml> in domain XML format to the native guest
-configuration format named by I<format>. For QEMU/KVM hypervisor,
+Convert the file I<xml> in domain XML format or existing domain to the
+native guest configuration format named by I<format>. For QEMU/KVM hypervisor,
the I<format> argument must be B<qemu-argv>. For Xen hypervisor, the
I<format> argument may be B<xen-xm>, B<xen-xl>, or B<xen-sxpr>. For
LXC hypervisor, the I<format> argument must be B<lxc-tools>.
--
2.13.0
7 years, 5 months
[libvirt] [PATCH] util: netdevbridge: Refactor error handling in virNetDevBridgeCreate
by Peter Krempa
Replace the switch statement with a simpler if statement. This also
removes the fallthrough path that coverity was complaining about.
---
src/util/virnetdevbridge.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index 11b03b426..cfb7ebae9 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -468,22 +468,17 @@ virNetDevBridgeCreate(const char *brname)
if (resp->nlmsg_len < NLMSG_LENGTH(sizeof(*err)))
goto malformed_resp;
- switch (err->error) {
- case 0:
- break;
- case -EOPNOTSUPP:
+ if (err->error < 0) {
# if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR)
- /* fallback to ioctl if netlink doesn't support creating
- * bridges
- */
- rc = virNetDevBridgeCreateWithIoctl(brname);
- goto cleanup;
+ if (err->error == -EOPNOTSUPP) {
+ /* fallback to ioctl if netlink doesn't support creating
+ * bridges
+ */
+ rc = virNetDevBridgeCreateWithIoctl(brname);
+ goto cleanup;
+ }
# endif
- /* intentionally fall through if virNetDevBridgeCreateWithIoctl()
- * isn't available.
- */
- ATTRIBUTE_FALLTHROUGH;
- default:
+
virReportSystemError(-err->error,
_("error creating bridge interface %s"),
brname);
--
2.12.2
7 years, 5 months
[libvirt] [PATCH 0/4] Resolve a few Coverity found issues
by John Ferlan
Was actually hoping the nodedev series would get reviewed, but since it
didn't the first patch fixes a problem that Coverity noted... The other
3 patches are also things Coverity has noted and I've been holding onto
in my wait for enough Coverity issues to surface before posting queue of
things to do. The really strange thing about patch 2 is Coverity complained
on the second one, but not the first mainly because of the net->ifname
check a few lines earlier. By moving things - the complaint went away,
but the code looked better with a helper so I kept it that way. Patch 3
is based on newer code that caught the attention, while patch 4 is a
much older change which just got buried amongst 30 others that I keep
in a false positive branch
John Ferlan (4):
nodedev: Add check for NULL obj before call Unlock
hotplug: Create helper to remove vport
util: Adjust the #ifdef logic in virNetDevBridgeCreate
test: Fix possible ap leak for VIR_TEST_PRELOAD
src/node_device/node_device_driver.c | 3 ++-
src/qemu/qemu_hotplug.c | 41 +++++++++++++++++-------------------
src/util/virnetdevbridge.c | 3 ++-
tests/qemucapsprobe.c | 2 +-
tests/testutils.c | 4 ++--
tests/testutils.h | 6 +++++-
6 files changed, 31 insertions(+), 28 deletions(-)
--
2.9.4
7 years, 5 months
[libvirt] [PATCH] qemu: hotplug: Disallow modification of vcpu 0 in inactive config
by Peter Krempa
vcpu 0 must be always enabled and non-hotpluggable, thus you can't
modify it using the vcpu hotplug APIs. Disallow it so that users can't
create invalid configurations.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1459785
---
src/qemu/qemu_hotplug.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index a486fb4fe..dd030d3d9 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5884,18 +5884,17 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def,
static int
qemuDomainVcpuValidateConfig(virDomainDefPtr def,
- virBitmapPtr map,
- bool state)
+ virBitmapPtr map)
{
virDomainVcpuDefPtr vcpu;
size_t maxvcpus = virDomainDefGetVcpusMax(def);
ssize_t next;
ssize_t firstvcpu = -1;
- /* vcpu 0 can't be disabled */
- if (!state && virBitmapIsBitSet(map, 0)) {
+ /* vcpu 0 can't be modified */
+ if (virBitmapIsBitSet(map, 0)) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("vCPU '0' must be enabled"));
+ _("vCPU '0' can't be modified"));
return -1;
}
@@ -5959,7 +5958,7 @@ qemuDomainSetVcpuInternal(virQEMUDriverPtr driver,
}
if (persistentDef) {
- if (qemuDomainVcpuValidateConfig(persistentDef, map, state) < 0)
+ if (qemuDomainVcpuValidateConfig(persistentDef, map) < 0)
goto cleanup;
}
--
2.12.2
7 years, 5 months
[libvirt] [PATCH 0/2] Two news bits for this release
by Martin Kletzander
Martin Kletzander (2):
news: Add live coalesce settings to new features
news: Add CAT capability information into improvements
docs/news.xml | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
--
2.13.2
7 years, 5 months
[libvirt] [PATCH v2] Fix documentation errors about the path of conf files
by Lily Zhu
The default conf files, for example, libvirtd.conf, virtlockd.conf
and virtlogd.conf, should be located under the directory
"/etc/libvirt" when root as root, rather than "/etc".
When run as non-root, the configuration file should be located
under "$XDG_CONFIG_HOME/libvirt/", rather than
"XDG_CONFIG_HOME".
Signed-off-by: Lily Zhu <lizhu(a)redhat.com>
---
daemon/libvirtd.pod | 4 ++--
src/locking/virtlockd.pod | 4 ++--
src/logging/virtlogd.pod | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemon/libvirtd.pod b/daemon/libvirtd.pod
index 3b819a2..9f5a17d 100644
--- a/daemon/libvirtd.pod
+++ b/daemon/libvirtd.pod
@@ -81,7 +81,7 @@ On receipt of B<SIGHUP> libvirtd will reload its configuration.
=over
-=item F<SYSCONFDIR/libvirtd.conf>
+=item F<SYSCONFDIR/libvirt/libvirtd.conf>
The default configuration file used by libvirtd, unless overridden on the
command line using the B<-f>|B<--config> option.
@@ -114,7 +114,7 @@ The PID file to use, unless overridden by the B<-p>|B<--pid-file> option.
=over
-=item F<$XDG_CONFIG_HOME/libvirtd.conf>
+=item F<$XDG_CONFIG_HOME/libvirt/libvirtd.conf>
The default configuration file used by libvirtd, unless overridden on the
command line using the B<-f>|B<--config> option.
diff --git a/src/locking/virtlockd.pod b/src/locking/virtlockd.pod
index a3bb268..355d974 100644
--- a/src/locking/virtlockd.pod
+++ b/src/locking/virtlockd.pod
@@ -67,7 +67,7 @@ upgrades of the virtlockd service.
=over
-=item F<SYSCONFDIR/virtlockd.conf>
+=item F<SYSCONFDIR/libvirt/virtlockd.conf>
The default configuration file used by virtlockd, unless overridden on the
command line using the B<-f>|B<--config> option.
@@ -86,7 +86,7 @@ The PID file to use, unless overridden by the B<-p>|B<--pid-file> option.
=over
-=item F<$XDG_CONFIG_HOME/virtlockd.conf>
+=item F<$XDG_CONFIG_HOME/libvirt/virtlockd.conf>
The default configuration file used by libvirtd, unless overridden on the
command line using the B<-f>|B<--config> option.
diff --git a/src/logging/virtlogd.pod b/src/logging/virtlogd.pod
index 7e55c9e..9e7212c 100644
--- a/src/logging/virtlogd.pod
+++ b/src/logging/virtlogd.pod
@@ -67,7 +67,7 @@ upgrades of the virtlogd service.
=over
-=item F<SYSCONFDIR/virtlogd.conf>
+=item F<SYSCONFDIR/libvirt/virtlogd.conf>
The default configuration file used by virtlogd, unless overridden on the
command line using the B<-f>|B<--config> option.
@@ -86,7 +86,7 @@ The PID file to use, unless overridden by the B<-p>|B<--pid-file> option.
=over
-=item F<$XDG_CONFIG_HOME/virtlogd.conf>
+=item F<$XDG_CONFIG_HOME/libvirt/virtlogd.conf>
The default configuration file used by libvirtd, unless overridden on the
command line using the B<-f>|B<--config> option.
--
1.8.3.1
7 years, 5 months