]> xenbits.xensource.com Git - people/aperard/libvirt.git/commitdiff
retry, actually do stuff in domain conf instead of libxl driver conf add-vkb_device
authorAnthony PERARD <anthony.perard@gmail.com>
Tue, 23 Jan 2024 16:31:41 +0000 (16:31 +0000)
committerAnthony PERARD <anthony.perard@gmail.com>
Tue, 23 Jan 2024 16:31:41 +0000 (16:31 +0000)
src/conf/domain_conf.h
src/libxl/libxl_conf.c
src/libxl/libxl_conf.h
src/libxl/libxl_domain.c
src/libxl/xen_common.c
src/libxl/xen_xl.c

index d176bda5f8db9477b64b2f375cd45c4e10b5047f..56414f0fd4422498b186b6528d872d1eff056538 100644 (file)
@@ -3034,6 +3034,7 @@ struct _virDomainDef {
 
     virDomainClockDef clock;
 
+    int vkb_device; // -1: default, 0: false, 1: true
     size_t ngraphics;
     virDomainGraphicsDef **graphics;
 
index 5f7ca5d55fc780e8b139445d3bafd2cbdc45de6d..75daed1fdf8095c40b0108c6bde79c17ae4104fb 100644 (file)
@@ -717,13 +717,16 @@ libxlMakeDomBuildInfo(virDomainDef *def,
         libxl_defbool_set(&b_info->u.hvm.sdl.enable, 0);
 
 #ifdef LIBXL_HAVE_BUILDINFO_VKB_DEVICE
-        if (cfg->has_vkb_device)
-            libxl_defbool_set(&b_info->u.hvm.vkb_device, cfg->vkb_device);
+        if (def->vkb_device != -1)
+            libxl_defbool_set(&b_info->u.hvm.vkb_device, def->vkb_device);
+        // maybe just disable it by default, and let libxlMakeVfbList() add
+        // the ones needed.
 #endif
 
         for (i = 0; i < def->ninputs; i++) {
             char **usbdevice;
 
+            // maybe reenable vkb_device, if bus == VIR_DOMAIN_INPUT_BUS_XEN
             if (def->inputs[i]->bus != VIR_DOMAIN_INPUT_BUS_USB)
                 continue;
 
@@ -1570,6 +1573,7 @@ libxlMakeVfbList(virPortAllocatorRange *graphicsports,
     libxl_device_vkb *x_vkbs;
     size_t i;
 
+    // handle vkb_device here?
     if (nvfbs == 0)
         return 0;
 
@@ -1864,12 +1868,6 @@ int libxlDriverConfigLoadFile(libxlDriverConfig *cfg,
     if (virConfGetValueBool(conf, "nested_hvm", &cfg->nested_hvm) < 0)
         return -1;
 
-    r = virConfGetValueBool(conf, "vkb_device", &cfg->vkb_device);
-    if (r == 1)
-        cfg->has_vkb_device = true;
-    if (r  < 0)
-        return -1;
-
     return 0;
 }
 
index c24a66564982781afb6f8b2dfc19a3a17dcb50f7..7087b41079e8bfaafd78ee2b06141681a30c35de 100644 (file)
@@ -101,9 +101,6 @@ struct _libxlDriverConfig {
 
     virFirmware **firmwares;
     size_t nfirmwares;
-
-    bool has_vkb_device;
-    bool vkb_device;
 };
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(libxlDriverConfig, virObjectUnref);
index 670fd2881eb43deecb39dfaf3e3a6a91a668d41c..ef4e4a012d65616a14718a3ed113afe8f43e1505 100644 (file)
@@ -266,6 +266,7 @@ libxlDomainDefPostParse(virDomainDef *def,
     }
 
     /* add implicit input devices */
+    // maybe remove that when vkb_device
     if (xenDomainDefAddImplicitInputDevice(def) < 0)
         return -1;
 
index d5a0399613fadc3594574c1b1956de3c78230266..3163cb0d9bbe79d88d7d93dc66181e914f8e5a59 100644 (file)
@@ -655,6 +655,8 @@ xenParseVfb(virConf *conf, virDomainDef *def)
     int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
     virDomainGraphicsDef *graphics = NULL;
 
+    // handle vkb_device here?
+
     if (hvm) {
         if (xenConfigGetBool(conf, "vnc", &val, 0) < 0)
             goto cleanup;
index f1753593077aac5557bd92228acffab76d6a392d..e44d5b3f47710c1f7f1901db76edf06c3534906f 100644 (file)
@@ -196,6 +196,9 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
                     return -1;
             }
         }
+
+        if (xenConfigGetBool(conf, "vkb_device", &def->vkb_device, -1) < 0)
+            return -1;
     } else {
         if (xenConfigCopyStringOpt(conf, "bootloader", &def->os.bootloader) < 0)
             return -1;