mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
* src/xend_internal.c: applied patch from Jim Fehlig when parsing
domain S-Expr the kernel may not be provided (Dom0) Daniel
This commit is contained in:
parent
91b0ae89dd
commit
be54328be3
@ -1,3 +1,8 @@
|
|||||||
|
Tue Apr 25 13:37:22 EDT 2006 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/xend_internal.c: applied patch from Jim Fehlig when parsing
|
||||||
|
domain S-Expr the kernel may not be provided (Dom0)
|
||||||
|
|
||||||
Mon Apr 24 18:23:29 EDT 2006 Daniel Veillard <veillard@redhat.com>
|
Mon Apr 24 18:23:29 EDT 2006 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/hash.c src/internal.h: add virGetDomainByID() to speed up
|
* src/hash.c src/internal.h: add virGetDomainByID() to speed up
|
||||||
|
@ -1350,28 +1350,30 @@ xend_parse_sexp_desc(struct sexpr *root)
|
|||||||
tmp = sexpr_node(root, "domain/bootloader");
|
tmp = sexpr_node(root, "domain/bootloader");
|
||||||
if (tmp != NULL)
|
if (tmp != NULL)
|
||||||
virBufferVSprintf(&buf, " <bootloader>%s</bootloader>\n", tmp);
|
virBufferVSprintf(&buf, " <bootloader>%s</bootloader>\n", tmp);
|
||||||
tmp = sexpr_node(root, "domain/image/linux/kernel");
|
if (sexpr_lookup(root, "domain/image")) {
|
||||||
if (tmp == NULL) {
|
tmp = sexpr_node(root, "domain/image/linux/kernel");
|
||||||
/*
|
if (tmp == NULL) {
|
||||||
* TODO: we will need some fallback here for other guest OSes
|
/*
|
||||||
*/
|
* TODO: we will need some fallback here for other guest OSes
|
||||||
virXendError(NULL, VIR_ERR_INTERNAL_ERROR,
|
*/
|
||||||
"domain informations incomplete, missing kernel");
|
virXendError(NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
goto error;
|
"domain informations incomplete, missing kernel");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
virBufferAdd(&buf, " <os>\n", 7);
|
||||||
|
virBufferVSprintf(&buf, " <type>linux</type>\n");
|
||||||
|
virBufferVSprintf(&buf, " <kernel>%s</kernel>\n", tmp);
|
||||||
|
tmp = sexpr_node(root, "domain/image/linux/ramdisk");
|
||||||
|
if ((tmp != NULL) && (tmp[0] != 0))
|
||||||
|
virBufferVSprintf(&buf, " <initrd>%s</initrd>\n", tmp);
|
||||||
|
tmp = sexpr_node(root, "domain/image/linux/root");
|
||||||
|
if ((tmp != NULL) && (tmp[0] != 0))
|
||||||
|
virBufferVSprintf(&buf, " <root>%s</root>\n", tmp);
|
||||||
|
tmp = sexpr_node(root, "domain/image/linux/args");
|
||||||
|
if ((tmp != NULL) && (tmp[0] != 0))
|
||||||
|
virBufferVSprintf(&buf, " <cmdline>%s</cmdline>\n", tmp);
|
||||||
|
virBufferAdd(&buf, " </os>\n", 8);
|
||||||
}
|
}
|
||||||
virBufferAdd(&buf, " <os>\n", 7);
|
|
||||||
virBufferVSprintf(&buf, " <type>linux</type>\n");
|
|
||||||
virBufferVSprintf(&buf, " <kernel>%s</kernel>\n", tmp);
|
|
||||||
tmp = sexpr_node(root, "domain/image/linux/ramdisk");
|
|
||||||
if ((tmp != NULL) && (tmp[0] != 0))
|
|
||||||
virBufferVSprintf(&buf, " <initrd>%s</initrd>\n", tmp);
|
|
||||||
tmp = sexpr_node(root, "domain/image/linux/root");
|
|
||||||
if ((tmp != NULL) && (tmp[0] != 0))
|
|
||||||
virBufferVSprintf(&buf, " <root>%s</root>\n", tmp);
|
|
||||||
tmp = sexpr_node(root, "domain/image/linux/args");
|
|
||||||
if ((tmp != NULL) && (tmp[0] != 0))
|
|
||||||
virBufferVSprintf(&buf, " <cmdline>%s</cmdline>\n", tmp);
|
|
||||||
virBufferAdd(&buf, " </os>\n", 8);
|
|
||||||
virBufferVSprintf(&buf, " <memory>%d</memory>\n",
|
virBufferVSprintf(&buf, " <memory>%d</memory>\n",
|
||||||
(int) (sexpr_u64(root, "domain/maxmem") << 10));
|
(int) (sexpr_u64(root, "domain/maxmem") << 10));
|
||||||
virBufferVSprintf(&buf, " <vcpu>%d</vcpu>\n",
|
virBufferVSprintf(&buf, " <vcpu>%d</vcpu>\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user