die("Unable to initialize virtio 9p");
if (virtio_9p__register(kvm, "/", "hostfs") < 0)
die("Unable to initialize virtio 9p");
+ kvm_setup_resolv(arg);
using_rootfs = custom_rootfs = 1;
return 0;
}
char tmp[PATH_MAX];
kvm_setup_create_new("default");
+ kvm_setup_resolv("default");
snprintf(tmp, PATH_MAX, "%s%s%s", HOME_DIR, KVM_PID_FILE_PATH, "default");
if (virtio_9p__register(kvm, tmp, "/dev/root") < 0)
make_dir(name);
}
+void kvm_setup_resolv(const char *guestfs_name)
+{
+ char path[PATH_MAX];
+
+ snprintf(path, PATH_MAX, "%s%s%s/etc/resolv.conf", HOME_DIR, KVM_PID_FILE_PATH, guestfs_name);
+
+ copy_file("/etc/resolv.conf", path);
+}
+
static int do_setup(const char *guestfs_name)
{
unsigned int i;
int kvm_cmd_setup(int argc, const char **argv, const char *prefix);
void kvm_setup_help(void);
int kvm_setup_create_new(const char *guestfs_name);
+void kvm_setup_resolv(const char *guestfs_name);
#endif