mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
xenconfig: don't use "kernel" for hvmloader
In xl config, hvmloader is implied for hvm guests. It is not specified with the "kernel" option like xm config. The "kernel" option, along with "ramdisk" and "extra", is used for HVM direct kernel boot. Instead of using "kernel" option to populate virDomainDef object's os.loader->path, use hvmloader discovered when gathering capabilities. This change required fixing initialization of capabilities in the test utils and removing 'kernel = "/usr/lib/xen/boot/hvmloader"' from the test config files.
This commit is contained in:
parent
717a92513d
commit
0fe504f15a
@ -59,16 +59,22 @@ extern int xlu_disk_parse(XLU_Config *cfg,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xenParseXLOS(virConfPtr conf, virDomainDefPtr def)
|
xenParseXLOS(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (STREQ(def->os.type, "hvm")) {
|
if (STREQ(def->os.type, "hvm")) {
|
||||||
const char *boot;
|
const char *boot;
|
||||||
|
|
||||||
if (VIR_ALLOC(def->os.loader) < 0 ||
|
for (i = 0; i < caps->nguests; i++) {
|
||||||
xenConfigCopyString(conf, "kernel", &def->os.loader->path) < 0)
|
if (STREQ(caps->guests[i]->ostype, "hvm") &&
|
||||||
return -1;
|
caps->guests[i]->arch.id == def->os.arch) {
|
||||||
|
if (VIR_ALLOC(def->os.loader) < 0 ||
|
||||||
|
VIR_STRDUP(def->os.loader->path,
|
||||||
|
caps->guests[i]->arch.defaultInfo.loader) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (xenConfigGetString(conf, "boot", &boot, "c") < 0)
|
if (xenConfigGetString(conf, "boot", &boot, "c") < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -423,7 +429,7 @@ xenParseXL(virConfPtr conf, virCapsPtr caps, int xendConfigVersion)
|
|||||||
if (xenParseConfigCommon(conf, def, caps, xendConfigVersion) < 0)
|
if (xenParseConfigCommon(conf, def, caps, xendConfigVersion) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (xenParseXLOS(conf, def) < 0)
|
if (xenParseXLOS(conf, def, caps) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (xenParseXLDisk(conf, def) < 0)
|
if (xenParseXLDisk(conf, def) < 0)
|
||||||
@ -453,10 +459,6 @@ xenFormatXLOS(virConfPtr conf, virDomainDefPtr def)
|
|||||||
if (xenConfigSetString(conf, "builder", "hvm") < 0)
|
if (xenConfigSetString(conf, "builder", "hvm") < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (def->os.loader && def->os.loader->path &&
|
|
||||||
xenConfigSetString(conf, "kernel", def->os.loader->path) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
for (i = 0; i < def->os.nBootDevs; i++) {
|
for (i = 0; i < def->os.nBootDevs; i++) {
|
||||||
switch (def->os.bootDevs[i]) {
|
switch (def->os.bootDevs[i]) {
|
||||||
case VIR_DOMAIN_BOOT_FLOPPY:
|
case VIR_DOMAIN_BOOT_FLOPPY:
|
||||||
|
@ -92,7 +92,8 @@ testXLInitCaps(void)
|
|||||||
if ((machines = virCapabilitiesAllocMachines(x86_machines, nmachines)) == NULL)
|
if ((machines = virCapabilitiesAllocMachines(x86_machines, nmachines)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_X86_64,
|
if ((guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_X86_64,
|
||||||
"/usr/lib/xen/bin/qemu-dm", NULL,
|
"/usr/lib/xen/bin/qemu-system-i386",
|
||||||
|
"/usr/lib/xen/boot/hvmloader",
|
||||||
nmachines, machines)) == NULL)
|
nmachines, machines)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
@ -104,8 +105,9 @@ testXLInitCaps(void)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, "xen", VIR_ARCH_X86_64,
|
if ((guest = virCapabilitiesAddGuest(caps, "xen", VIR_ARCH_X86_64,
|
||||||
"/usr/lib/xen/bin/qemu-dm", NULL,
|
"/usr/lib/xen/bin/qemu-system-i386",
|
||||||
nmachines, machines)) == NULL)
|
NULL,
|
||||||
|
nmachines, machines)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=
|
|||||||
parallel = "none"
|
parallel = "none"
|
||||||
serial = "none"
|
serial = "none"
|
||||||
builder = "hvm"
|
builder = "hvm"
|
||||||
kernel = "/usr/lib/xen/boot/hvmloader"
|
|
||||||
boot = "d"
|
boot = "d"
|
||||||
disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
|
disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
|
||||||
usb = 1
|
usb = 1
|
||||||
|
@ -21,6 +21,5 @@ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=
|
|||||||
parallel = "none"
|
parallel = "none"
|
||||||
serial = "none"
|
serial = "none"
|
||||||
builder = "hvm"
|
builder = "hvm"
|
||||||
kernel = "/usr/lib/xen/boot/hvmloader"
|
|
||||||
boot = "d"
|
boot = "d"
|
||||||
disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/var/lib/libvirt/images/XenGuest2-home,qcow2,hdb,w,backendtype=qdisk", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
|
disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/var/lib/libvirt/images/XenGuest2-home,qcow2,hdb,w,backendtype=qdisk", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
|
||||||
|
@ -17,7 +17,6 @@ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=
|
|||||||
parallel = "none"
|
parallel = "none"
|
||||||
serial = "none"
|
serial = "none"
|
||||||
builder = "hvm"
|
builder = "hvm"
|
||||||
kernel = "/usr/lib/xen/boot/hvmloader"
|
|
||||||
boot = "d"
|
boot = "d"
|
||||||
disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
|
disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
|
||||||
sdl = 0
|
sdl = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user