[libvirt] [PATCH] libxl: add PV console if not explicitly specified
by Jim Fehlig
Xen PV domains always have a PV console, so add one to the domain
config via post-parse callback if not explicitly specified in
the XML. The legacy Xen driver behaves similarly, causing a
regression when switching to the new Xen toolstack. I.e.
virsh console pv-domain
will no longer work after upgrading a xm/xend stack to xl/libxl.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_domain.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index da3f241..0c86601 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -503,9 +503,38 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
return 0;
}
+static int
+libxlDomainDefPostParse(virDomainDefPtr def,
+ virCapsPtr caps ATTRIBUTE_UNUSED,
+ void *opaque ATTRIBUTE_UNUSED)
+{
+ if (STREQ(def->os.type, "hvm"))
+ return 0;
+
+ if (def->nconsoles == 0) {
+ virDomainChrDefPtr chrdef;
+
+ if (!(chrdef = virDomainChrDefNew()))
+ return -1;
+
+ chrdef->source.type = VIR_DOMAIN_CHR_TYPE_PTY;
+ chrdef->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
+ chrdef->target.port = 0;
+ chrdef->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
+
+ if (VIR_ALLOC_N(def->consoles, 1) < 0)
+ return -1;
+
+ def->nconsoles = 1;
+ def->consoles[0] = chrdef;
+ }
+ return 0;
+}
+
virDomainDefParserConfig libxlDomainDefParserConfig = {
.macPrefix = { 0x00, 0x16, 0x3e },
.devicesPostParseCallback = libxlDomainDeviceDefPostParse,
+ .domainPostParseCallback = libxlDomainDefPostParse,
};
--
1.8.4.5
10 years, 4 months
[libvirt] [PATCH] build: fix 'make syntax-check' after commit c6cf5df3
by Jim Fehlig
The commit caused prohibit_long_lines to fail in src/Makefile.am.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Pushing under the build-breaker rule.
src/Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 10c35d7..35720be 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1143,7 +1143,9 @@ libvirt_driver_vbox_impl_la_CFLAGS = \
-I$(top_srcdir)/src/conf \
$(AM_CFLAGS)
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
-libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS)
+libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) \
+ $(MSCOM_LIBS) \
+ $(LIBXML_LIBS)
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
endif WITH_VBOX
--
1.8.4.5
10 years, 4 months
[libvirt] [PATCH] vbox: fix linker error
by Jim Fehlig
Noticed the following error when building the vbox driver
in the openSUSE build service
CCLD vboxsnapshotxmltest
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
../src/.libs/libvirt_driver_vbox_impl.a
(libvirt_driver_vbox_impl_la-vbox_snapshot_conf.o):
undefined reference to symbol 'xmlXPathRegisterNs@(a)LIBXML2_2.4.30'
/usr/lib64/libxml2.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Fixed by adding LIBXML_LIBS to libvirt_driver_vbox_impl_la_LIBADD
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Oddly, I don't see this when doing local builds, but haven't really
found out what is different between my build environments.
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 2b9ac61..10c35d7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1143,7 +1143,7 @@ libvirt_driver_vbox_impl_la_CFLAGS = \
-I$(top_srcdir)/src/conf \
$(AM_CFLAGS)
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
-libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS)
+libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS)
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
endif WITH_VBOX
--
1.8.4.5
10 years, 4 months