[libvirt] [PATCH] qemu: Fix crash in qemucapsprobe
by Jiri Denemark
The qemucapsprobe helper calls virQEMUCapsInitHostCPUModel with
caps == NULL, causing the following crash:
Program received signal SIGSEGV, Segmentation fault.
#0 0x00007ffff788775f in virQEMUCapsInitHostCPUModel
(qemuCaps=qemuCaps@entry=0x649680, host=host@entry=0x10) at
src/qemu/qemu_capabilities.c:2969
#1 0x00007ffff7889dbf in virQEMUCapsNewForBinaryInternal
(caps=caps@entry=0x0, binary=<optimized out>,
libDir=libDir@entry=0x4033f6 "/tmp", cacheDir=cacheDir@entry=0x0,
runUid=runUid@entry=4294967295, runGid=runGid@entry=4294967295,
qmpOnly=true) at src/qemu/qemu_capabilities.c:4039
#2 0x0000000000401702 in main (argc=2, argv=0x7fffffffd968) at
tests/qemucapsprobe.c:73
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4d859c4..73a7fd4 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4036,7 +4036,8 @@ virQEMUCapsNewForBinaryInternal(virCapsPtr caps,
virQEMUCapsRememberCached(qemuCaps, cacheDir) < 0)
goto error;
- virQEMUCapsInitHostCPUModel(qemuCaps, &caps->host);
+ if (caps)
+ virQEMUCapsInitHostCPUModel(qemuCaps, &caps->host);
}
cleanup:
--
2.10.0
8 years, 1 month
[libvirt] [PATCH] virsh domdisplay: introduce '--all' for showing all possible graphical display
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
For one VM, it could have more than one graphical display.
Such as we coud add both vnc and spice display to a VM.
This patch introduces '--all' for showing all
possible type of graphical display for a active VM.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
tools/virsh-domain.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3829b17..7194153 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10648,6 +10648,10 @@ static const vshCmdOptDef opts_domdisplay[] = {
.help = N_("select particular graphical display "
"(e.g. \"vnc\", \"spice\", \"rdp\")")
},
+ {.name = "all",
+ .type = VSH_OT_BOOL,
+ .help = N_("show all possible graphical displays")
+ },
{.name = NULL}
};
@@ -10671,6 +10675,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
int tmp;
int flags = 0;
bool params = false;
+ bool all = false;
const char *xpath_fmt = "string(/domain/devices/graphics[@type='%s']/%s)";
virSocketAddr addr;
@@ -10685,6 +10690,9 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptBool(cmd, "include-password"))
flags |= VIR_DOMAIN_XML_SECURE;
+ if (vshCommandOptBool(cmd, "all"))
+ all = true;
+
if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
goto cleanup;
@@ -10845,7 +10853,15 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
/* We got what we came for so return successfully */
ret = true;
- break;
+ if (!all) {
+ break;
+ } else {
+ VIR_FREE(xpath);
+ VIR_FREE(passwd);
+ VIR_FREE(listen_addr);
+ VIR_FREE(output);
+ vshPrint(ctl, "\n");
+ }
}
if (!ret) {
--
1.8.3.1
8 years, 1 month
[libvirt] [PATCH] mingw: Package cputypes.rng for mingw32 too
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as trivial.
mingw-libvirt.spec.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index c8476d9..c9bf503 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -210,6 +210,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
%dir %{mingw32_datadir}/libvirt/schemas/
%{mingw32_datadir}/libvirt/schemas/basictypes.rng
%{mingw32_datadir}/libvirt/schemas/capability.rng
+%{mingw32_datadir}/libvirt/schemas/cputypes.rng
%{mingw32_datadir}/libvirt/schemas/domain.rng
%{mingw32_datadir}/libvirt/schemas/domaincaps.rng
%{mingw32_datadir}/libvirt/schemas/domaincommon.rng
--
2.10.0
8 years, 1 month
[libvirt] [PATCH] mingw: Package cputypes.rng
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as trivial.
mingw-libvirt.spec.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index 5c7183f..c8476d9 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -292,6 +292,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
%dir %{mingw64_datadir}/libvirt/schemas/
%{mingw64_datadir}/libvirt/schemas/basictypes.rng
%{mingw64_datadir}/libvirt/schemas/capability.rng
+%{mingw64_datadir}/libvirt/schemas/cputypes.rng
%{mingw64_datadir}/libvirt/schemas/domain.rng
%{mingw64_datadir}/libvirt/schemas/domaincaps.rng
%{mingw64_datadir}/libvirt/schemas/domaincommon.rng
--
2.10.0
8 years, 1 month
[libvirt] [PATCH] spec: Package cputypes.rng
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as trivial.
libvirt.spec.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index a389e88..00b95b8 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1814,6 +1814,7 @@ exit 0
%{_datadir}/libvirt/schemas/basictypes.rng
%{_datadir}/libvirt/schemas/capability.rng
+%{_datadir}/libvirt/schemas/cputypes.rng
%{_datadir}/libvirt/schemas/domain.rng
%{_datadir}/libvirt/schemas/domaincaps.rng
%{_datadir}/libvirt/schemas/domaincommon.rng
--
2.10.0
8 years, 1 month
[libvirt] [PATCH] qemu: make qemuGetCompressionProgram return int not an enum
by Daniel P. Berrange
enum types are unsigned and the qemuGetCompressionProgram
function can return -1 on error. It is therefore inappropriate
to return an enum type. This fixes a build error where the
internal 'ret' variable was used in a comparison with -1
../../src/qemu/qemu_driver.c: In function 'qemuGetCompressionProgram':
../../src/qemu/qemu_driver.c:3280:5: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
../../src/qemu/qemu_driver.c:3289:5: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
cc1: all warnings being treated as errors
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Pushed as a CI broken build fix.
src/qemu/qemu_driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index eaea96f..7873a68 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3264,13 +3264,13 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
* no there was an error, then just return RAW
* indicating none.
*/
-static virQEMUSaveFormat ATTRIBUTE_NONNULL(2)
+static int ATTRIBUTE_NONNULL(2)
qemuGetCompressionProgram(const char *imageFormat,
char **compresspath,
const char *styleFormat,
bool use_raw_on_fail)
{
- virQEMUSaveFormat ret;
+ int ret;
*compresspath = NULL;
--
2.7.4
8 years, 1 month
[libvirt] Plan for next release
by Daniel Veillard
Time flies, I didn't realized we were that close from the end of the month.
So if we want to have 2.3.0 for next Monday I think we should start the freeze
today, possibly tonight.
Does this work ? Sorry for late notice,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
8 years, 1 month
[libvirt] [PATCH] Fix coding style issues.
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
src/uml/uml_conf.h | 2 +-
src/vbox/vbox_common.h | 2 +-
tests/qemumonitorjsontest.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/uml/uml_conf.h b/src/uml/uml_conf.h
index 9a45d10..5da55e5 100644
--- a/src/uml/uml_conf.h
+++ b/src/uml/uml_conf.h
@@ -35,7 +35,7 @@
# include "vircommand.h"
# include "virhash.h"
-# define umlDebug(fmt, ...) do {} while(0)
+# define umlDebug(fmt, ...) do {} while (0)
# define UML_CPUMASK_LEN CPU_SETSIZE
diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h
index c8787c3..b178878 100644
--- a/src/vbox/vbox_common.h
+++ b/src/vbox/vbox_common.h
@@ -435,6 +435,6 @@ typedef nsISupports IKeyboard;
} else { \
result = -1; \
} \
- } while(0)
+ } while (0)
#endif /* VBOX_COMMON_H */
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index cbc39c6..9823a9d 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -721,7 +721,7 @@ testQemuMonitorJSONAttachChardev(const void *data)
goto cleanup; \
if (qemuMonitorAttachCharDev(qemuMonitorTestGetMonitor(test), \
chrID, &chr) < 0) \
- ret = fail ? ret : -1; \
+ ret = fail ? ret : -1; \
else \
ret = fail ? -1 : ret; \
--
2.1.0
8 years, 1 month
[libvirt] virsh can list ("virsh list" is empty) Guest domains created by "xl create DomU"
by Volo M.
Hi,
We use Centos 7 Xen hypervisor, start VMs with xl toolkit (libxl), but we
can't list with "virsh list" command DomUs created with "xl create ..."
command.
Can anybody, please, explain why this happens? Why does it work like this?
It worked before with "libvirt+xm" toolkits, but xm toolkit was deprecated
for latest Xen sortware on Centos 7.
Can this be fixed ever?
Thank you.
Example:
[root@c7xen2 ~]# xl create /onapp/config/w62tp7db1txk12
...
[root@c7xen2 ~]# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 400 2 r-----
102.0
w62tp7db1txk12 1 512 1 -b----
2.6
[root@c7xen2 ~]# virsh list
Id Name State
----------------------------------------------------
0 Domain-0 running
[root@c7xen2 ~]#
8 years, 1 month
[libvirt] [PATCH v2 0/4] libxl: channels support
by Joao Martins
Hey,
This v2 from channel series. Since v1 path is now autogenerated as needed,
and a few other comments from Jim that were addressed. Difference to qemu
driver would be only the autogenerated path being slightly different.
Channels have been on xen toolstack since Xen 4.5 and this small series
adds support for it, including xenconfig conversion and appropriate tests.
After this series it's possible to do this:
(assuming correct configuration of qemu agent in the guest)
$ cat domain.xml | grep -a1 channel | head -n 5 | tail -n 4
<channel type='unix'>
<source mode='bind' path='/tmp/channel'/>
<target type='xen' name='org.qemu.guest_agent.0'/>
</channel>
$ virsh create domain.xml
$ echo '{"execute":"guest-network-get-interfaces"}' | socat
stdio,ignoreeof unix-connect:/tmp/channel
{"execute":"guest-network-get-interfaces"}
{"return": [{"name": "lo", "ip-addresses": [{"ip-address-type": "ipv4",
"ip-address": "127.0.0.1", "prefix": 8}, {"ip-address-type": "ipv6",
"ip-address": "::1", "prefix": 128}], "hardware-address":
"00:00:00:00:00:00"}, {"name": "eth0", "ip-addresses":
[{"ip-address-type": "ipv4", "ip-address": "10.100.0.6", "prefix": 24},
{"ip-address-type": "ipv6", "ip-address": "fe80::216:3eff:fe40:88eb",
"prefix": 64}], "hardware-address": "00:16:3e:40:88:eb"}, {"name":
"sit0"}]}
Thanks,
Joao
Joao Martins (4):
conf: add xen type for channels
libxl: channels support
xenconfig: channels conversion support
xlconfigtest: add test for channel conversion
docs/schemas/domaincommon.rng | 11 ++
src/conf/domain_conf.c | 18 +++-
src/conf/domain_conf.h | 1 +
src/libxl/libxl_conf.c | 120 ++++++++++++++++++++-
src/libxl/libxl_conf.h | 4 +-
src/libxl/libxl_domain.c | 44 +++++++-
src/libxl/libxl_driver.c | 7 ++
src/qemu/qemu_command.c | 1 +
src/xenconfig/xen_xl.c | 176 +++++++++++++++++++++++++++++++
tests/xlconfigdata/test-channel-pty.cfg | 13 +++
tests/xlconfigdata/test-channel-pty.xml | 33 ++++++
tests/xlconfigdata/test-channel-unix.cfg | 13 +++
tests/xlconfigdata/test-channel-unix.xml | 34 ++++++
tests/xlconfigtest.c | 4 +
14 files changed, 471 insertions(+), 8 deletions(-)
create mode 100644 tests/xlconfigdata/test-channel-pty.cfg
create mode 100644 tests/xlconfigdata/test-channel-pty.xml
create mode 100644 tests/xlconfigdata/test-channel-unix.cfg
create mode 100644 tests/xlconfigdata/test-channel-unix.xml
--
2.1.4
8 years, 1 month