[libvirt] [PATCH] qemu: Allow setting boot menu on/off
by Cole Robinson
Add a new element to the <os> block:
<bootmenu enable="yes|no"/>
Which maps to -boot,menu=on|off on the QEMU command line.
I decided to use an explicit 'enable' attribute rather than just make the
bootmenu element boolean. This allows us to treat lack of a bootmenu element
as 'use hypervisor default'.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
docs/formatdomain.html.in | 8 +++++
docs/schemas/domain.rng | 10 ++++++
src/conf/domain_conf.c | 18 ++++++++++++
src/conf/domain_conf.h | 8 ++++-
src/qemu/qemu_conf.c | 27 ++++++++++++++++-
src/qemu/qemu_conf.h | 1 +
tests/qemuhelptest.c | 9 ++++--
.../qemuxml2argv-boot-menu-disable.args | 1 +
.../qemuxml2argv-boot-menu-disable.xml | 27 ++++++++++++++++++
.../qemuxml2argvdata/qemuxml2argv-boot-multi.args | 1 +
tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml | 30 ++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 +
tests/qemuxml2xmltest.c | 2 +
13 files changed, 138 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 3e80312..c79b606 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -79,6 +79,8 @@
<type>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='hd'/>
+ <boot dev='cdrom'/>
+ <bootmenu enable='yes'/>
</os>
...</pre>
@@ -104,6 +106,12 @@
times to setup a priority list of boot devices to try in turn.
<span class="since">Since 0.1.3</span>
</dd>
+ <dt><code>bootmenu</code></dt>
+ <dd> Whether or not to enable an interactive boot menu prompt on guest
+ startup. The <code>enable</code> attribute can be either "yes" or "no".
+ If not specified, the hypervisor default is used. <span class="since">
+ Since 0.8.3</span>
+ </dd>
</dl>
<h4><a name="elementsOSBootloader">Host bootloader</a></h4>
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 2d22ce4..f36bb1f 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -122,6 +122,16 @@
<ref name="osbootdev"/>
</oneOrMore>
</choice>
+ <optional>
+ <element name="bootmenu">
+ <attribute name="enable">
+ <choice>
+ <value>yes</value>
+ <value>no</value>
+ </choice>
+ </attribute>
+ </element>
+ </optional>
</interleave>
</element>
</define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5b59c01..dc775e8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4300,6 +4300,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
}
if (STREQ(def->os.type, "hvm")) {
+ char *bootstr;
+
/* analysis of the boot devices */
if ((n = virXPathNodeSet("./os/boot", ctxt, &nodes)) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
@@ -4329,6 +4331,15 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
def->os.bootDevs[0] = VIR_DOMAIN_BOOT_DISK;
}
VIR_FREE(nodes);
+
+ bootstr = virXPathString("string(./os/bootmenu[1]/@enable)", ctxt);
+ if (bootstr) {
+ if (STREQ(bootstr, "yes"))
+ def->os.bootmenu = VIR_DOMAIN_BOOT_MENU_ENABLED;
+ else
+ def->os.bootmenu = VIR_DOMAIN_BOOT_MENU_DISABLED;
+ VIR_FREE(bootstr);
+ }
}
def->emulator = virXPathString("string(./devices/emulator[1])", ctxt);
@@ -6275,6 +6286,13 @@ char *virDomainDefFormat(virDomainDefPtr def,
}
virBufferVSprintf(&buf, " <boot dev='%s'/>\n", boottype);
}
+
+ if (def->os.bootmenu != VIR_DOMAIN_BOOT_MENU_DEFAULT) {
+ const char *enabled = (def->os.bootmenu ==
+ VIR_DOMAIN_BOOT_MENU_ENABLED ? "yes"
+ : "no");
+ virBufferVSprintf(&buf, " <bootmenu enable='%s'/>\n", enabled);
+ }
}
virBufferAddLit(&buf, " </os>\n");
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 9ef687b..afd172f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -615,7 +615,6 @@ struct _virDomainDeviceDef {
# define VIR_DOMAIN_MAX_BOOT_DEVS 4
-/* 3 possible boot devices */
enum virDomainBootOrder {
VIR_DOMAIN_BOOT_FLOPPY,
VIR_DOMAIN_BOOT_CDROM,
@@ -625,6 +624,12 @@ enum virDomainBootOrder {
VIR_DOMAIN_BOOT_LAST,
};
+enum virDomainBootMenu {
+ VIR_DOMAIN_BOOT_MENU_DEFAULT = 0,
+ VIR_DOMAIN_BOOT_MENU_ENABLED,
+ VIR_DOMAIN_BOOT_MENU_DISABLED,
+};
+
enum virDomainFeature {
VIR_DOMAIN_FEATURE_ACPI,
VIR_DOMAIN_FEATURE_APIC,
@@ -651,6 +656,7 @@ struct _virDomainOSDef {
char *machine;
int nBootDevs;
int bootDevs[VIR_DOMAIN_BOOT_LAST];
+ int bootmenu;
char *init;
char *kernel;
char *initrd;
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 05ad67d..1db504d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1205,6 +1205,8 @@ static unsigned long long qemudComputeCmdFlags(const char *help,
flags |= QEMUD_CMD_FLAG_NO_KVM_PIT;
if (strstr(help, "-tdf"))
flags |= QEMUD_CMD_FLAG_TDF;
+ if (strstr(help, ",menu=on"))
+ flags |= QEMUD_CMD_FLAG_BOOT_MENU;
/* Keep disabled till we're actually ready to turn on netdev mode
* The plan is todo it in 0.13.0 QEMU, but lets wait & see... */
@@ -4078,9 +4080,25 @@ int qemudBuildCommandLine(virConnectPtr conn,
}
}
if (def->os.nBootDevs) {
+ virBuffer boot_buf = VIR_BUFFER_INITIALIZER;
+
boot[def->os.nBootDevs] = '\0';
- ADD_ARG_LIT("-boot");
- ADD_ARG_LIT(boot);
+ virBufferVSprintf(&boot_buf, "-boot %s", boot);
+
+ if (qemuCmdFlags & QEMUD_CMD_FLAG_BOOT_MENU &&
+ def->os.bootmenu != VIR_DOMAIN_BOOT_MENU_DEFAULT) {
+ if (def->os.bootmenu == VIR_DOMAIN_BOOT_MENU_ENABLED)
+ virBufferAddLit(&boot_buf, ",menu=on");
+ else if (def->os.bootmenu == VIR_DOMAIN_BOOT_MENU_DISABLED)
+ virBufferAddLit(&boot_buf, ",menu=off");
+ }
+
+ if (virBufferError(&boot_buf)) {
+ virReportOOMError();
+ goto error;
+ }
+
+ ADD_ARG_LIT(virBufferContentAndReset(&boot_buf));
}
if (def->os.kernel) {
@@ -6207,8 +6225,13 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
def->os.bootDevs[b++] = VIR_DOMAIN_BOOT_CDROM;
else if (val[n] == 'n')
def->os.bootDevs[b++] = VIR_DOMAIN_BOOT_NET;
+ else if (val[n] == ',')
+ break;
}
def->os.nBootDevs = b;
+
+ if (strstr(val, "menu=on"))
+ def->os.bootmenu = 1;
} else if (STREQ(arg, "-name")) {
WANT_VALUE();
if (!(def->name = strdup(val)))
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 8c17e26..1aa9d2e 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -91,6 +91,7 @@ enum qemud_cmd_flags {
QEMUD_CMD_FLAG_TDF = (1LL << 35), /* -tdf flag (user-mode pit catchup) */
QEMUD_CMD_FLAG_PCI_CONFIGFD = (1LL << 36), /* pci-assign.configfd */
QEMUD_CMD_FLAG_NODEFCONFIG = (1LL << 37), /* -nodefconfig */
+ QEMUD_CMD_FLAG_BOOT_MENU = (1LL << 38), /* -boot menu=on support */
};
/* Main driver state */
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 517a8fe..56a49fd 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -220,7 +220,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_RTC_TD_HACK |
QEMUD_CMD_FLAG_NO_HPET |
QEMUD_CMD_FLAG_NO_KVM_PIT |
- QEMUD_CMD_FLAG_TDF,
+ QEMUD_CMD_FLAG_TDF |
+ QEMUD_CMD_FLAG_BOOT_MENU,
10092, 1, 0);
DO_TEST("qemu-0.12.1",
QEMUD_CMD_FLAG_VNC_COLON |
@@ -244,7 +245,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_DEVICE |
QEMUD_CMD_FLAG_SMP_TOPOLOGY |
QEMUD_CMD_FLAG_RTC |
- QEMUD_CMD_FLAG_NO_HPET,
+ QEMUD_CMD_FLAG_NO_HPET |
+ QEMUD_CMD_FLAG_BOOT_MENU,
12001, 0, 0);
DO_TEST("qemu-kvm-0.12.3",
QEMUD_CMD_FLAG_VNC_COLON |
@@ -274,7 +276,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_VNET_HOST |
QEMUD_CMD_FLAG_NO_HPET |
QEMUD_CMD_FLAG_NO_KVM_PIT |
- QEMUD_CMD_FLAG_TDF,
+ QEMUD_CMD_FLAG_TDF |
+ QEMUD_CMD_FLAG_BOOT_MENU,
12003, 1, 0);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args
new file mode 100644
index 0000000..1c773fd
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args
@@ -0,0 +1 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot d,menu=off -cdrom /dev/cdrom -net none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml
new file mode 100644
index 0000000..ceb109c
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ <bootmenu enable='no'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='cdrom'>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args
new file mode 100644
index 0000000..85b74d1
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args
@@ -0,0 +1 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot dcna,menu=on -cdrom /dev/cdrom -net none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml
new file mode 100644
index 0000000..48f27aa
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ <boot dev='hd'/>
+ <boot dev='network'/>
+ <boot dev='fd'/>
+ <bootmenu enable='yes'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='cdrom'>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3d6c583..0ca9804 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -223,6 +223,8 @@ mymain(int argc, char **argv)
DO_TEST("boot-cdrom", 0);
DO_TEST("boot-network", 0);
DO_TEST("boot-floppy", 0);
+ DO_TEST("boot-multi", QEMUD_CMD_FLAG_BOOT_MENU);
+ DO_TEST("boot-menu-disable", QEMUD_CMD_FLAG_BOOT_MENU);
DO_TEST("bootloader", QEMUD_CMD_FLAG_DOMID);
DO_TEST("clock-utc", 0);
DO_TEST("clock-localtime", 0);
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 69829b1..00b3a1b 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -89,6 +89,8 @@ mymain(int argc, char **argv)
DO_TEST("boot-cdrom");
DO_TEST("boot-network");
DO_TEST("boot-floppy");
+ DO_TEST("boot-multi");
+ DO_TEST("boot-menu-disable");
DO_TEST("bootloader");
DO_TEST("clock-utc");
DO_TEST("clock-localtime");
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] docs: Link wiki FAQ to main page
by Cole Robinson
Since DV recommended keeping the build instructions distributed with the
source, move them from the old FAQ to the downloads page.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
docs/FAQ.html.in | 144 ------------------------------------------------
docs/Makefile.am | 3 +-
docs/downloads.html.in | 29 ++++++++++
docs/search.php | 2 +-
docs/sitemap.html.in | 2 +-
5 files changed, 32 insertions(+), 148 deletions(-)
delete mode 100644 docs/FAQ.html.in
diff --git a/docs/FAQ.html.in b/docs/FAQ.html.in
deleted file mode 100644
index 50f798d..0000000
--- a/docs/FAQ.html.in
+++ /dev/null
@@ -1,144 +0,0 @@
-<?xml version="1.0"?>
-<html>
- <body>
- <h1 >FAQ</h1>
- <p>Table of Contents:</p>
- <ul>
- <li>
- <a href="FAQ.html#License">License(s)</a>
- </li>
- <li>
- <a href="FAQ.html#Installati">Installation</a>
- </li>
- <li>
- <a href="FAQ.html#Compilatio">Compilation</a>
- </li>
- <li>
- <a href="FAQ.html#Developer">Developer corner</a>
- </li>
- </ul>
- <h3><a name="License" id="License">License</a>(s)</h3>
- <ol>
- <li>
- <em>Licensing Terms for libvirt</em>
- <p>libvirt is released under the <a href="http://www.opensource.org/licenses/lgpl-license.html">GNU Lesser
- General Public License</a>, see the file COPYING.LIB in the distribution
- for the precise wording. The only library that libvirt depends upon is
- the Xen store access library which is also licenced under the LGPL.</p>
- </li>
- <li>
- <em>Can I embed libvirt in a proprietary application ?</em>
- <p>Yes. The LGPL allows you to embed libvirt into a proprietary
- application. It would be graceful to send-back bug fixes and improvements
- as patches for possible incorporation in the main development tree. It
- will decrease your maintenance costs anyway if you do so.</p>
- </li>
- </ol>
- <h3>
- <a name="Installati" id="Installati">Installation</a>
- </h3>
- <ol>
- <li><em>Where can I get libvirt</em> ?
- <p>The original distribution comes from <a href="ftp://libvirt.org/libvirt/">ftp://libvirt.org/libvirt/</a>.</p>
- </li>
- <li>
- <em>I can't install the libvirt/libvirt-devel RPM packages due to
- failed dependencies</em>
- <p>The most generic solution is to re-fetch the latest src.rpm , and
- rebuild it locally with</p>
- <p><code>rpm --rebuild libvirt-xxx.src.rpm</code>.</p>
- <p>If everything goes well it will generate two binary rpm packages (one
- providing the shared libs and virsh, and the other one, the -devel
- package, providing includes, static libraries and scripts needed to build
- applications with libvirt that you can install locally.</p>
- <p>One can also rebuild the RPMs from a tarball:</p>
- <p>
- <code>rpmbuild -ta libdir-xxx.tar.gz</code>
- </p>
- <p>Or from a configured tree with:</p>
- <p>
- <code>make rpm</code>
- </p>
- </li>
- <li>
- <em>Failure to use the API for non-root users</em>
- <p>Large parts of the API may only be accessible with root privileges,
- however the read only access to the xenstore data doesnot have to be
- forbidden to user, at least for monitoring purposes. If "virsh dominfo"
- fails to run as an user, change the mode of the xenstore read-only socket
- with:</p>
- <p>
- <code>chmod 666 /var/run/xenstored/socket_ro</code>
- </p>
- <p>and also make sure that the Xen Daemon is running correctly with local
- HTTP server enabled, this is defined in
- <code>/etc/xen/xend-config.sxp</code> which need the following line to be
- enabled:</p>
- <p>
- <code>(xend-http-server yes)</code>
- </p>
- <p>If needed restart the xend daemon after making the change with the
- following command run as root:</p>
- <p>
- <code>service xend restart</code>
- </p>
- </li>
- </ol>
- <h3>
- <a name="Compilatio" id="Compilatio">Compilation</a>
- </h3>
- <ol>
- <li>
- <em>What is the process to compile libvirt ?</em>
- <p>As most UNIX libraries libvirt follows the "standard":</p>
- <p>
- <code>gunzip -c libvirt-xxx.tar.gz | tar xvf -</code>
- </p>
- <p>
- <code>cd libvirt-xxxx</code>
- </p>
- <p>
- <code>./configure --help</code>
- </p>
- <p>to see the options, then the compilation/installation proper</p>
- <p>
- <code>./configure [possible options]</code>
- </p>
- <p>
- <code>make</code>
- </p>
- <p>
- <code>make install</code>
- </p>
- <p>At that point you may have to rerun ldconfig or a similar utility to
- update your list of installed shared libs.</p>
- </li>
- <li>
- <em>What other libraries are needed to compile/install libvirt ?</em>
- <p>Libvirt requires libxenstore, which is usually provided by the xen
- packages as well as the public headers to compile against libxenstore.</p>
- </li>
- <li>
- <em>I use the GIT version and there is no configure script</em>
- <p>The configure script (and other Makefiles) are generated. Use the
- autogen.sh script to regenerate the configure script and Makefiles,
- like:</p>
- <p>
- <code>./autogen.sh --prefix=/usr --disable-shared</code>
- </p>
- </li>
- </ol>
- <h3><a name="Developer" id="Developer">Developer</a> corner</h3>
- <ol>
- <li>
- <em>Troubles compiling or linking programs using libvirt</em>
- <p>To simplify the process of reusing the library, libvirt comes with
- pkgconfig support, which can be used directly from autoconf support or
- via the pkg-config command line tool, like:</p>
- <p>
- <code>pkg-config libvirt --libs</code>
- </p>
- </li>
- </ol>
- </body>
-</html>
diff --git a/docs/Makefile.am b/docs/Makefile.am
index a6a6d07..114ea1f 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -159,8 +159,7 @@ rebuild: api all
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
- -$(INSTALL) -m 0644 $(srcdir)/FAQ.html \
- $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
+ -$(INSTALL) -m 0644 $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
for h in $(apihtml); do \
$(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
diff --git a/docs/downloads.html.in b/docs/downloads.html.in
index a0cb6fc..04fd16c 100644
--- a/docs/downloads.html.in
+++ b/docs/downloads.html.in
@@ -43,6 +43,35 @@
<a href="http://libvirt.org/git/?p=libvirt.git;a=summary">http://libvirt.org/git/?p=libvirt.git;a=summary</a>
</pre>
+
+ <h1>Installation</h1>
+ <h2>
+ <a name="Compilatio" id="Compilatio">Compilation</a>
+ </h2>
+ <p>As most UNIX libraries libvirt follows the "standard":</p>
+ <p>
+ <code>gunzip -c libvirt-xxx.tar.gz | tar xvf -</code>
+ </p>
+ <p>
+ <code>cd libvirt-xxxx</code>
+ </p>
+ <p>
+ <code>./configure --help</code>
+ </p>
+ <p>to see the options, then the compilation/installation proper</p>
+ <p>
+ <code>./configure [possible options]</code>
+ </p>
+ <p>
+ <code>make</code>
+ </p>
+ <p>
+ <code>make install</code>
+ </p>
+ <p>At that point you may have to rerun ldconfig or a similar utility to
+ update your list of installed shared libs.</p>
+ </p>
+
<h2>Building from a source code checkout</h2>
<p> The libvirt build process uses GNU autotools, so after obtaining a
checkout it is necessary to generate the configure script and Makefile.in
diff --git a/docs/search.php b/docs/search.php
index a6c1def..bbd652a 100644
--- a/docs/search.php
+++ b/docs/search.php
@@ -258,7 +258,7 @@
</li><li>
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
</li><li>
- <a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
+ <a title="Frequently asked questions" class="inactive" href="http://wiki.libvirt.org/page/FAQ">FAQ</a>
</li><li>
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
</li><li>
diff --git a/docs/sitemap.html.in b/docs/sitemap.html.in
index 404ce5a..e9ab591 100644
--- a/docs/sitemap.html.in
+++ b/docs/sitemap.html.in
@@ -265,7 +265,7 @@
<span>User contributed content</span>
</li>
<li>
- <a href="FAQ.html">FAQ</a>
+ <a href="http://wiki.libvirt.org/page/FAQ">FAQ</a>
<span>Frequently asked questions</span>
</li>
<li>
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] qemu: Error on unsupported graphics config
by Cole Robinson
Throw an explicit error if multiple graphics devices are specified, or
an unsupported type is specified (rdp).
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/qemu/qemu_conf.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 0dbab48..05ad67d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -4542,6 +4542,12 @@ int qemudBuildCommandLine(virConnectPtr conn,
}
}
+ if (def->ngraphics > 1) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("only 1 graphics device is supported"));
+ goto error;
+ }
+
if ((def->ngraphics == 1) &&
def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virBuffer opt = VIR_BUFFER_INITIALIZER;
@@ -4641,6 +4647,12 @@ int qemudBuildCommandLine(virConnectPtr conn,
* default, since the default changes :-( */
if (qemuCmdFlags & QEMUD_CMD_FLAG_SDL)
ADD_ARG_LIT("-sdl");
+
+ } else if ((def->ngraphics == 1)) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unsupported graphics type '%s'"),
+ virDomainGraphicsTypeToString(def->graphics[0]->type));
+ goto error;
}
if (def->nvideos) {
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] libvirt-guests: Don't throw errors if libvirtd is not installed
by Jiri Denemark
When only client parts of libvirt are installed (i.e., no libvirtd
daemon), libvirt-guests init script in its default configuration would
throw seriously looking errors during host shutdown:
Running guests on default URI: error: unable to connect to
'/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No
such file or directory
error: failed to connect to the hypervisor
This patch changes the script to print rather harmless message in that
situation:
Running guests on default URI: libvirtd not installed; skipping this
URI.
---
daemon/libvirt-guests.init.in | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/daemon/libvirt-guests.init.in b/daemon/libvirt-guests.init.in
index f99c070..d2ec96a 100644
--- a/daemon/libvirt-guests.init.in
+++ b/daemon/libvirt-guests.init.in
@@ -25,6 +25,7 @@
sysconfdir=@sysconfdir@
localstatedir=@localstatedir@
+libvirtd=@sbindir@/libvirtd
# Source function library.
. "$sysconfdir"/rc.d/init.d/functions
@@ -232,6 +233,12 @@ stop() {
: >"$LISTFILE"
for uri in $URIS; do
echo -n $"Running guests on $uri URI: "
+
+ if [ "x$uri" = xdefault ] && [ ! -x "$libvirtd" ]; then
+ echo $"libvirtd not installed; skipping this URI."
+ continue
+ fi
+
list=$(list_guests $uri)
if [ $? -eq 0 ]; then
empty=true
--
1.7.2
14 years, 4 months
[libvirt] Virt-install Error and kvm
by cris rock
Hi guys, I hope you can help me on this issue with kvm/libvirt:
using this command to install a kvm virtual machine:
virt-install --connect qemu:///system \
--name p3k0401 \
--ram 2048 \
--file //dev/VolGroup01/p3k0401logvol \
--accelerate \
-s 10 \
--nographics \
--hvm \
--location='http://10.1.4.80'
I get:
Starting install...
Retrieving file vmlinuz... | 1.8 MB 00:00
Retrieving file initrd.img... | 7.1 MB 00:00
ERROR internal error Domain p3k0401 didn't show up
Domain installation may not have been
successful. If it was, you can restart your domain
by running 'virsh start p3k0401'; otherwise, please
restart your installation.
ERROR internal error Domain p3k0401 didn't show up
Traceback (most recent call last):
File "/usr/sbin/virt-install", line 889, in ?
main()
File "/usr/sbin/virt-install", line 751, in main
start_time, guest.start_install)
File "/usr/sbin/virt-install", line 813, in do_install
dom = install_func(conscb, progresscb, wait=(not wait))
File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 541, in
start_install
return self._do_install(consolecb, meter, removeOld, wait)
File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 633, in
_do_install
self.domain = self.conn.createLinux(install_xml, 0)
File "/usr/lib64/python2.4/site-packages/libvirt.py", line 974, in
createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed',
conn=self)
libvirtError: internal error Domain p3k0401 didn't show up
On the /var/log/libvirt/qemu/p3k0401.log:
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/
/usr/bin/qemu-system-x86_64 -S -M rhel5.4.0 -m 1024 -smp 1 -name p3k0401
-uuid 7658c102-0738-724c-40eb-e1c58b2c2369 -domid 3 -nographic -monitor
pty -pidfile /var/run/libvirt/qemu//p3k0401.pid -no-reboot -boot c
-kernel /var/lib/libvirt/boot/virtinst-vmlinuz.O_SOVo -initrd
/var/lib/libvirt/boot/virtinst-initrd.img.0ba0Fp -append
method=http://10.1.4.80 -drive
file=//dev/VolGroup01/p3k0401logvol,if=ide,index=0,cache=none -net
nic,macaddr=54:52:00:15:c4:50,vlan=0 -net
tap,fd=16,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb
Supported machines are:
pc Standard PC (alias of pc-0.12)
pc-0.12 Standard PC (default)
pc-0.11 Standard PC, qemu 0.11
pc-0.10 Standard PC, qemu 0.10
isapc ISA-only PC
xenpv Xen Para-virtualized PC
And my packages installed:
# rpm -qa | grep qemu
qemu-0.12.4-1.el5.rf
# rpm -qa | grep kvm
etherboot-zroms-kvm-5.4.4-13.el5.centos
kmod-kvm-83-164.el5_5.12
kvm-83-164.el5_5.12
# rpm -qa | grep libvirt
libvirt-0.6.3-33.el5_5.1
libvirt-0.6.3-33.el5_5.1
libvirt-python-0.6.3-33.el5_5.1
# uname -a
Linux gs1p304 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64
x86_64 x86_64 GNU/Linux
Please any pointer is appreciated...
thanks!
cris
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969
14 years, 4 months
[libvirt] [PATCH 0/5] qemu: support virtio console
by Cole Robinson
The following series adds virtio console XML and qemu driver support.
The first 3 patches are just cleanups/improvements. Patch 4 adds XML
support for more than 1 console device (not strictly required for
virtio console, but it's a valid use case). Patch 5 actually adds virtio
console support.
Thanks,
Cole
Cole Robinson (5):
docs: domain: Document virtio <channel>
domain conf: Rename character prop targetType -> deviceType
domain conf: char: Add an explicit targetType field
domain conf: Support multiple <console> devices
qemu: virtio console support
docs/formatdomain.html.in | 31 +++-
docs/schemas/domain.rng | 14 ++-
src/conf/domain_conf.c | 192 ++++++++++++--------
src/conf/domain_conf.h | 26 ++-
src/esx/esx_vmx.c | 4 +-
src/libvirt_private.syms | 1 +
src/lxc/lxc_driver.c | 8 +-
src/qemu/qemu_conf.c | 48 +++++-
src/qemu/qemu_driver.c | 3 +-
src/uml/uml_conf.c | 4 +-
src/uml/uml_driver.c | 6 +-
src/vbox/vbox_tmpl.c | 4 +-
src/xen/xend_internal.c | 16 ++-
src/xen/xm_internal.c | 19 ++-
.../qemuxml2argv-console-virtio.args | 1 +
.../qemuxml2argv-console-virtio.xml | 30 +++
tests/qemuxml2argvtest.c | 2 +
.../xml2sexprdata/xml2sexpr-pv-multi-console.sexpr | 1 +
tests/xml2sexprdata/xml2sexpr-pv-multi-console.xml | 24 +++
tests/xml2sexprtest.c | 1 +
20 files changed, 324 insertions(+), 111 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio.xml
create mode 100644 tests/xml2sexprdata/xml2sexpr-pv-multi-console.sexpr
create mode 100644 tests/xml2sexprdata/xml2sexpr-pv-multi-console.xml
14 years, 4 months
[libvirt] [PATCH] Invert logic for checking for QEMU disk cache options
by Daniel P. Berrange
QEMU has had two different syntax for disk cache options
Old: on|off
New: writeback|writethrough|none
QEMU recently added another 'unsafe' option which broke the
libvirt check. We can avoid this & future breakage, if we
do a negative check for the old syntax, instead of a positive
check for the new syntax
* src/qemu/qemu_conf.c: Invert cache option check
---
src/qemu/qemu_conf.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 0dbab48..db60ca3 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1170,7 +1170,8 @@ static unsigned long long qemudComputeCmdFlags(const char *help,
flags |= QEMUD_CMD_FLAG_DOMID;
if (strstr(help, "-drive")) {
flags |= QEMUD_CMD_FLAG_DRIVE;
- if (strstr(help, "cache=writethrough|writeback|none"))
+ if (strstr(help, "cache=") &&
+ !strstr(help, "cache=on|off"))
flags |= QEMUD_CMD_FLAG_DRIVE_CACHE_V2;
if (strstr(help, "format="))
flags |= QEMUD_CMD_FLAG_DRIVE_FORMAT;
--
1.7.1.1
14 years, 4 months