[libvirt] [PATCH v2] schema: Allow multiple machines for VMs
by Martin Kletzander
Use the same pattern for all OS types.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/schemas/domaincommon.rng | 160 ++----------------------------------------
1 file changed, 4 insertions(+), 156 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 03fd541..cb21df7 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -328,152 +328,17 @@
<define name="ostypehvm">
<element name="type">
<optional>
- <choice>
- <ref name="hvmx86"/>
- <ref name="hvmmips"/>
- <ref name="hvmsparc"/>
- <ref name="hvmppc"/>
- <ref name="hvmppc64"/>
- <ref name="hvms390"/>
- <ref name="hvmarm"/>
- <ref name="hvmaarch64"/>
- </choice>
- </optional>
- <value>hvm</value>
- </element>
- </define>
- <define name="hvmx86">
- <group>
- <optional>
<attribute name="arch">
<choice>
<value>i686</value>
<value>x86_64</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="machine">
- <data type="string">
- <param name="pattern">[a-zA-Z0-9_\.\-]+</param>
- </data>
- </attribute>
- </optional>
- </group>
- </define>
- <define name="hvmmips">
- <group>
- <optional>
- <attribute name="arch">
- <value>mips</value>
- </attribute>
- </optional>
- <optional>
- <attribute name="machine">
- <value>mips</value>
- </attribute>
- </optional>
- </group>
- </define>
- <define name="hvmsparc">
- <group>
- <optional>
- <attribute name="arch">
- <value>sparc</value>
- </attribute>
- </optional>
- <optional>
- <attribute name="machine">
- <value>sun4m</value>
- </attribute>
- </optional>
- </group>
- </define>
- <define name="hvmppc">
- <group>
- <optional>
- <attribute name="arch">
- <value>ppc</value>
- </attribute>
- </optional>
- <optional>
- <attribute name="machine">
- <choice>
- <value>g3beige</value>
- <value>mac99</value>
- <value>prep</value>
- <value>ppce500</value>
- </choice>
- </attribute>
- </optional>
- </group>
- </define>
- <define name="hvmppc64">
- <group>
- <optional>
- <attribute name="arch">
- <choice>
+ <value>mips</value>
+ <value>ppc</value>
<value>ppc64</value>
<value>ppc64le</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="machine">
- <choice>
- <value>pseries</value>
- <value>pseries-2.1</value>
- <value>pseries-2.2</value>
- </choice>
- </attribute>
- </optional>
- </group>
- </define>
- <define name="hvms390">
- <group>
- <optional>
- <attribute name="arch">
- <choice>
<value>s390</value>
<value>s390x</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="machine">
- <choice>
- <value>s390</value>
- <value>s390-virtio</value>
- <value>s390-ccw</value>
- <value>s390-ccw-virtio</value>
- </choice>
- </attribute>
- </optional>
- </group>
- </define>
- <define name="hvmarm">
- <group>
- <optional>
- <attribute name="arch">
- <choice>
<value>armv7l</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="machine">
- <data type="string">
- <param name="pattern">[a-zA-Z0-9_\.\-]+</param>
- </data>
- </attribute>
- </optional>
- </group>
- </define>
- <define name="hvmaarch64">
- <group>
- <optional>
- <attribute name="arch">
- <choice>
<value>aarch64</value>
</choice>
</attribute>
@@ -485,25 +350,6 @@
</data>
</attribute>
</optional>
- </group>
- </define>
- <define name="osexe">
- <element name="os">
- <element name="type">
- <optional>
- <attribute name="arch">
- <choice>
- <value>i686</value>
- <value>x86_64</value>
- <value>ppc</value>
- <value>ppc64</value>
- <value>mips</value>
- <value>sparc</value>
- </choice>
- </attribute>
- </optional>
- <value>exe</value>
- </element>
<interleave>
<optional>
<element name="init">
@@ -516,8 +362,10 @@
</element>
</zeroOrMore>
</interleave>
+ <value>hvm</value>
</element>
</define>
+
<!--
The Identifiers can be:
- an optional id attribute with a number on the domain element
--
2.3.5
9 years, 7 months
[libvirt] [PATCH 0/2] qemu: add VIR_DOMAIN_EVENT_ID_DEVICE_ADDED event
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1206114
Ján Tomko (2):
Add VIR_DOMAIN_EVENT_ID_DEVICE_ADDED event
Emit VIR_DOMAIN_EVENT_ID_DEVICE_ADDED in the QEMU driver
daemon/remote.c | 37 +++++++++++++++++++
include/libvirt/libvirt-domain.h | 18 ++++++++++
src/conf/domain_event.c | 77 ++++++++++++++++++++++++++++++++++++++++
src/conf/domain_event.h | 6 ++++
src/libvirt_private.syms | 2 ++
src/qemu/qemu_driver.c | 17 ++++++++-
src/qemu/qemu_hotplug.c | 5 +++
src/remote/remote_driver.c | 29 +++++++++++++++
src/remote/remote_protocol.x | 14 +++++++-
src/remote_protocol-structs | 6 ++++
tools/virsh-domain.c | 20 +++++++++++
11 files changed, 229 insertions(+), 2 deletions(-)
--
2.0.5
9 years, 7 months
[libvirt] [PATCH v2 0/8] Duplicate storage pool source refactoring and checks
by John Ferlan
v1 here:
http://www.redhat.com/archives/libvir-list/2015-April/msg00141.html
Changes:
Patches 1-3 are refactored into just 1 patch now
Patch 2 is the old patch 4 and renames the function as requested
and removes the comment
Patch 3 is new - it adds a check for different port #'s to the
new host source matching function.
Patch 4 is the old patch 5, already ACK'd and only changed to use
the new name
Patch 5 is the old patch 6, already ACK'd
Patches 6 & 7 are the old patches 7 & 8. They use the new name and
the commit comment is adjusted
Patch 8 is the old patch 9 and is unchanged, already ACK'd
John Ferlan (8):
storage: Refactor iSCSI Source matching
storage: Create virStoragePoolSourceMatchSingleHost
storage: Add check for different ports for host duplicate matching
storage: Use virStoragePoolSourceMatchSingleHost for NETFS
storage: Remove default from switch in
virStoragePoolSourceFindDuplicate
storage: Add duplicate host check for Sheepdog pool def
storage: Add duplicate host check for Gluster pool def
storage: Add duplicate devices check for zfs pool def
src/conf/storage_conf.c | 62 ++++++++++++++++++++++++++++++++++++-------------
1 file changed, 46 insertions(+), 16 deletions(-)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH 0/5] Tiny miscellaneous clean-ups
by Martin Kletzander
Just a few things I stumbled upon that are needed for future work.
Martin Kletzander (5):
configure: Align messages
Link libvirt_util with datatypes
closeCallback is already lockable, initialize it as such
Change virConnectPtr into virObjectLocklable
json: export non-static functions
configure.ac | 4 ++--
src/Makefile.am | 7 ++++---
src/datatypes.c | 16 ++++------------
src/datatypes.h | 12 +++++-------
src/libvirt-host.c | 18 +++++++++---------
src/libvirt_private.syms | 2 ++
src/util/virerror.c | 18 +++++++++---------
7 files changed, 35 insertions(+), 42 deletions(-)
--
2.3.5
9 years, 7 months
[libvirt] macvtap - no incoming ipv6 traffic processed on kvm host unless i start tcpdump on interface
by Stefan Bauer
Dear folks,
I'm using for the first time macvtap interface for my virtual machines in bridged mode.
VM -> HOST -> Router -> INTERNET
This works fine for ipv4 connectivity.
For ipv6 my virtual machines receive appropriate v6 address from radvd but are not able to receive answer packages from outside (ping -t -6 google.de was started inside VM).
I see the ping request/response on my router:
14:10:52.147834 IP6 2a01:198:200:8350:dc8b:cd82:144e:14eb > 2a00:1450:4001:806::1018: ICMP6, echo request, seq 108, length 40
14:10:52.182073 IP6 2a00:1450:4001:806::1018 > 2a01:198:200:8350:dc8b:cd82:144e:14eb: ICMP6, echo reply, seq 108, length 40
14:10:55.179874 IP6 2a01:198:200:350::2 > 2a00:1450:4001:806::1018: ICMP6, destination unreachable, unreachable address 2a01:198:200:8350:dc8b:cd82:144e:14eb, length 88
But i do not receive the reply on the VM.
However on the KVM host - when i start a tcpdump on the macvtap interface with
root@s1:~# tcpdump -ni macvtap0 ip6
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on macvtap0, link-type EN10MB (Ethernet), capture size 262144 bytes
14:12:37.134516 IP6 2a01:198:200:8350:dc8b:cd82:144e:14eb > 2a00:1450:4001:806::1018: ICMP6, echo request, seq 129, length 40
14:12:37.188529 IP6 fe80::12fe:edff:fee6:cfa > ff02::1:ff4e:14eb: ICMP6, neighbor solicitation, who has 2a01:198:200:8350:dc8b:cd82:144e:14eb, length 32
14:12:37.189040 IP6 2a01:198:200:8350:dc8b:cd82:144e:14eb > fe80::12fe:edff:fee6:cfa: ICMP6, neighbor advertisement, tgt is 2a01:198:200:8350:dc8b:cd82:144e:14eb, length 32
14:12:37.189202 IP6 2a00:1450:4001:806::1018 > 2a01:198:200:8350:dc8b:cd82:144e:14eb: ICMP6, echo reply, seq 129, length 40
packages starting to get processed and VM receives replies.
Any idea what is happening here?
Cheers,
Stefan
9 years, 7 months
[libvirt] [PATCH 0/9] Duplicate storage pool source refactoring and checks
by John Ferlan
A precursor to some changes I'm working on - I figured it was better not to
hoard the patches and then drop a 15 patch series...
Anyway, patches 1-4 refactor the iSCSI <source> duplicate checks into
a separate subroutine. While I was at it, I realized the Host checks
are duplicate of the NETFS check - so I further separated things out.
As I was looking at other possible defs I realized not all of the proposed
storage pool defs go through duplicate checks because the switch statement
had the 'default:' case - so I removed that, added all the options with the
hope that new storage pool types will add their own checking.
This left me with a bit of sleuthing for cases I added. I was able to
determine that Sheepdog and Gluster both have the possibility of "a"
single source host, so I added that check as it doesn't seem like it
would be a good idea to have two storage pools looking at the same
gluster/sheepdog source
For the zfs pool it seems that it's like the DISK, LOGICAL, and FS
pools with regard to not having duplicate devices in the pool
For mpath there doesn't seem to be any need, but I could be wrong
For rbd it wasn't completely clear what to check since multiple hosts
are allowed for a single pool - I suppose a proposed definition should
check that none of it's definitions match, but then again I'm not clear
so I left it alone
John Ferlan (9):
storage: Refactor iSCSI Source matching
storage: Refactor matchISCSISource
storage: Invert logic for matchISCSISource
storage: Create matchPoolSourceHost
storage: Use matchPoolSourceHost for NETFS
storage: Remove default from switch in
virStoragePoolSourceFindDuplicate
storage: Add duplicate host check for Sheepdog pool def
storage: Add duplicate host check for Gluster pool def
storage: Add duplicate devices check for zfs pool def
src/conf/storage_conf.c | 59 +++++++++++++++++++++++++++++++++++--------------
1 file changed, 43 insertions(+), 16 deletions(-)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] tools: improve the error info when fail to parse parameter --soft-limit of memtune
by Shanzhi Yu
When set guest memory with a invalid parameter of --soft-limit, it posts weird error:
$ virsh memtune r7 --hard-limit 20417224 --soft-limit 9007199254740992 --swap-hard-limit 35417224
error: Unable to parse integer parameter 'NAME
Change it to
error: Unable to parse integer parameter soft-limit
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1211550
Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
tools/virsh-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3e2c420..ebdf398 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8417,7 +8417,7 @@ cmdMemtune(vshControl *ctl, const vshCmd *cmd)
#define PARSE_MEMTUNE_PARAM(NAME, FIELD) \
if ((rc = vshMemtuneGetSize(cmd, NAME, &tmpVal)) < 0) { \
- vshError(ctl, "%s", _("Unable to parse integer parameter 'NAME'")); \
+ vshError(ctl, _("Unable to parse integer parameter %s"), NAME); \
goto cleanup; \
} \
if (rc == 1) { \
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] build: provide virNetDevSysfsFile on non-Linux
by Eric Blake
Commit 49ed6cff is broken on mingw and other non-linux platforms:
CCLD libvirt.la
Cannot export virNetDevSysfsFile: symbol not defined
collect2: error: ld returned 1 exit status
* src/util/virnetdev.c: Provide virNetDevSysfsFile fallback.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
src/util/virnetdev.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 6ee692d..9ef75f2 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1877,6 +1877,17 @@ virNetDevGetVirtualFunctionInfo(const char *vfname ATTRIBUTE_UNUSED,
_("Unable to get virtual function info on this platform"));
return -1;
}
+
+int
+virNetDevSysfsFile(char **pf_sysfs_device_link ATTRIBUTE_UNUSED,
+ const char *ifname ATTRIBUTE_UNUSED,
+ const char *file ATTRIBUTE_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Unable to get sysfs info on this platform"));
+ return -1;
+}
+
#endif /* !__linux__ */
#if defined(__linux__) && defined(HAVE_LIBNL) && defined(IFLA_VF_MAX)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] build: include correct header for time()
by Eric Blake
Found by ./autobuild.sh during a mingw cross-compile:
Commit 8a96e87 was not innocuous - glibc happens to leak the
definition of time() through other headers, so that even without
<sys/select.h>, virrandom.c compiled just fine. But on mingw,
we were not so lucky; <sys/select.h> was important for its side
effect of dragging in <time.h>, and we now have nothing providing
the declaration of time():
../../src/util/virrandom.c: In function 'virRandomOnceInit':
../../src/util/virrandom.c:65:5: error: implicit declaration of function 'time' [-Werror=implicit-function-declaration]
unsigned int seed = time(NULL) ^ getpid();
^
../../src/util/virrandom.c:65:5: error: nested extern declaration of 'time' [-Werror=nested-externs]
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
src/util/virrandom.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/util/virrandom.c b/src/util/virrandom.c
index 4301f3f..67a8bd0 100644
--- a/src/util/virrandom.c
+++ b/src/util/virrandom.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2014 Red Hat, Inc.
+ * Copyright (C) 2012-2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -25,6 +25,7 @@
#include <inttypes.h>
#include <math.h>
#include <strings.h>
+#include <time.h>
#include "virrandom.h"
#include "virthread.h"
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] qemu: monitor: Add check that monitor is non-null to specific commands
by Peter Krempa
Our monitor locking and cleanup code is weird as it allows to remove the
monitor object pointer while we are in the monitor. Additionally EVERY
api is using the vm private data after @vm was unlocked. This leads to
an unpleasant situation, where when qemu crashes during a monitor
session while a command is executed (and locks are down), the priv->mon
pointer gets cleared (@vm is unlocked).
The next monitor call then crashes on commands that did not check if the
monitor is non-NULL.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1209813 and few
other possible crashes
---
Since this is a workaround rather than a proper fix I'd normally not go this
way, but untangling the monitor mess won't be easy so I'll fix the symptoms
first.
src/qemu/qemu_monitor.c | 42 ++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.h | 12 +++++-------
2 files changed, 47 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 2b0e1a5..e8403be 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1171,6 +1171,12 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon,
int ret = -1;
char *path = NULL;
+ if (!mon) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
if (mon->json) {
ret = qemuMonitorFindObjectPath(mon, "/", videoName, &path);
if (ret < 0) {
@@ -1886,6 +1892,12 @@ qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
{
VIR_DEBUG("mon=%p, stats=%p, backing=%d", mon, stats, backingChain);
+ if (!mon) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
if (!mon->json) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("block capacity/size info requires JSON monitor"));
@@ -3246,6 +3258,12 @@ qemuMonitorAddObject(qemuMonitorPtr mon,
mon, type, objalias, props);
int ret = -1;
+ if (!mon) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
if (mon->json) {
ret = qemuMonitorJSONAddObject(mon, type, objalias, props);
} else {
@@ -3265,6 +3283,12 @@ qemuMonitorDelObject(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p objalias=%s", mon, objalias);
int ret = -1;
+ if (!mon) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
if (mon->json)
ret = qemuMonitorJSONDelObject(mon, objalias);
else
@@ -3453,6 +3477,12 @@ qemuMonitorBlockCommit(qemuMonitorPtr mon, const char *device,
"bandwidth=%llu",
mon, device, top, base, NULLSTR(backingName), bandwidth);
+ if (!mon) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
if (mon->json)
ret = qemuMonitorJSONBlockCommit(mon, device, top, base,
backingName, bandwidth);
@@ -3482,6 +3512,12 @@ qemuMonitorDiskNameLookup(qemuMonitorPtr mon,
virStorageSourcePtr top,
virStorageSourcePtr target)
{
+ if (!mon) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return NULL;
+ }
+
if (!mon->json) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("JSON monitor is required"));
@@ -3592,6 +3628,12 @@ qemuMonitorBlockJob(qemuMonitorPtr mon,
mon, device, NULLSTR(base), NULLSTR(backingName),
bandwidth, mode, modern);
+ if (!mon) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
if (mon->json)
ret = qemuMonitorJSONBlockJob(mon, device, base, backingName,
bandwidth, mode, modern);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index a3514cf..7e62139 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -246,7 +246,7 @@ void qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options)
int qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon,
virDomainVideoDefPtr video,
const char *videName)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon,
const char *cmd,
int scm_fd,
@@ -381,7 +381,7 @@ int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon,
int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
virHashTablePtr stats,
bool backingChain)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ ATTRIBUTE_NONNULL(2);
int qemuMonitorGetBlockExtent(qemuMonitorPtr mon,
const char *dev_name,
@@ -730,15 +730,13 @@ int qemuMonitorBlockCommit(qemuMonitorPtr mon,
const char *base,
const char *backingName,
unsigned long long bandwidth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4);
+ ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
bool qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon);
char *qemuMonitorDiskNameLookup(qemuMonitorPtr mon,
const char *device,
virStorageSourcePtr top,
virStorageSourcePtr target)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4);
+ ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
int qemuMonitorArbitraryCommand(qemuMonitorPtr mon,
const char *cmd,
@@ -774,7 +772,7 @@ int qemuMonitorBlockJobInfo(qemuMonitorPtr mon,
const char *device,
virDomainBlockJobInfoPtr info,
unsigned long long *bandwidth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int qemuMonitorOpenGraphics(qemuMonitorPtr mon,
const char *protocol,
--
2.3.5
9 years, 7 months