]> xenbits.xensource.com Git - libvirt.git/commitdiff
xenconfig: don't use "kernel" for hvmloader
authorJim Fehlig <jfehlig@suse.com>
Fri, 20 Mar 2015 01:03:08 +0000 (19:03 -0600)
committerJim Fehlig <jfehlig@suse.com>
Thu, 16 Apr 2015 22:11:01 +0000 (16:11 -0600)
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.

src/xenconfig/xen_xl.c
tests/testutilsxen.c
tests/xlconfigdata/test-fullvirt-multiusb.cfg
tests/xlconfigdata/test-new-disk.cfg
tests/xlconfigdata/test-spice.cfg

index 1af162a5e40a929a914ec8e4ffc0c5ce5c5a6245..12050f3bf7c367d0f48eb81d2c2d061a8a74279e 100644 (file)
@@ -59,16 +59,22 @@ extern int xlu_disk_parse(XLU_Config *cfg,
 #endif
 
 static int
-xenParseXLOS(virConfPtr conf, virDomainDefPtr def)
+xenParseXLOS(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
 {
     size_t i;
 
     if (STREQ(def->os.type, "hvm")) {
         const char *boot;
 
-        if (VIR_ALLOC(def->os.loader) < 0 ||
-            xenConfigCopyString(conf, "kernel", &def->os.loader->path) < 0)
-            return -1;
+        for (i = 0; i < caps->nguests; i++) {
+            if (STREQ(caps->guests[i]->ostype, "hvm") &&
+                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)
             return -1;
@@ -423,7 +429,7 @@ xenParseXL(virConfPtr conf, virCapsPtr caps, int xendConfigVersion)
     if (xenParseConfigCommon(conf, def, caps, xendConfigVersion) < 0)
         goto cleanup;
 
-    if (xenParseXLOS(conf, def) < 0)
+    if (xenParseXLOS(conf, def, caps) < 0)
         goto cleanup;
 
     if (xenParseXLDisk(conf, def) < 0)
@@ -453,10 +459,6 @@ xenFormatXLOS(virConfPtr conf, virDomainDefPtr def)
         if (xenConfigSetString(conf, "builder", "hvm") < 0)
             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++) {
             switch (def->os.bootDevs[i]) {
             case VIR_DOMAIN_BOOT_FLOPPY:
index df1d1243b2e7ea1a92bb1426dd2cb468c52e8262..c60e32419a7288d4d1667321acb40caecbc99911 100644 (file)
@@ -92,7 +92,8 @@ testXLInitCaps(void)
     if ((machines = virCapabilitiesAllocMachines(x86_machines, nmachines)) == NULL)
         goto cleanup;
     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)
         goto cleanup;
     machines = NULL;
@@ -104,8 +105,9 @@ testXLInitCaps(void)
         goto cleanup;
 
     if ((guest = virCapabilitiesAddGuest(caps, "xen", VIR_ARCH_X86_64,
-                                        "/usr/lib/xen/bin/qemu-dm", NULL,
-                                        nmachines, machines)) == NULL)
+                                         "/usr/lib/xen/bin/qemu-system-i386",
+                                         NULL,
+                                         nmachines, machines)) == NULL)
         goto cleanup;
     machines = NULL;
 
index b9e1b0a8c49b6b02c46322826ee4d002a408f8e8..68a2614eb3abadfb80c4e5223cc9f80b19fd484b 100755 (executable)
@@ -22,7 +22,6 @@ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=
 parallel = "none"
 serial = "none"
 builder = "hvm"
-kernel = "/usr/lib/xen/boot/hvmloader"
 boot = "d"
 disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
 usb = 1
index 180ce924b0fb8c732305d8fe909cc59e1b3432e5..9e9f1066e73ca89f3e444029ee298bb0bacdcc80 100644 (file)
@@ -21,6 +21,5 @@ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=
 parallel = "none"
 serial = "none"
 builder = "hvm"
-kernel = "/usr/lib/xen/boot/hvmloader"
 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" ]
index a97cd20a0a607c8fee300124f0685d94224a78a6..21f0e55afda2a402e9eee481f9dce2cc357d20ff 100644 (file)
@@ -17,7 +17,6 @@ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=
 parallel = "none"
 serial = "none"
 builder = "hvm"
-kernel = "/usr/lib/xen/boot/hvmloader"
 boot = "d"
 disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
 sdl = 0