own docdir, fix non-existent NIC error
This commit is contained in:
parent
d8106ee041
commit
f8c36ac20d
|
@ -0,0 +1,43 @@
|
||||||
|
From 048294d62e2d61dfbe1e89d1dadb914371bba010 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eduardo Habkost <ehabkost@redhat.com>
|
||||||
|
Date: Tue, 6 Apr 2010 19:38:51 -0300
|
||||||
|
Subject: [PATCH] net: remove NICInfo.bootable field
|
||||||
|
|
||||||
|
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=561078
|
||||||
|
|
||||||
|
It is just set by net_set_boot_mask() and never used. The logic for rom loading
|
||||||
|
changed a lot since this field was introduced. It is not needed anymore.
|
||||||
|
|
||||||
|
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
||||||
|
---
|
||||||
|
net.c | 1 -
|
||||||
|
net.h | 1 -
|
||||||
|
2 files changed, 0 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/net.c b/net.c
|
||||||
|
index 029b0d7..4030e39 100644
|
||||||
|
--- a/net.c
|
||||||
|
+++ b/net.c
|
||||||
|
@@ -1196,7 +1196,6 @@ void net_set_boot_mask(int net_boot_mask)
|
||||||
|
|
||||||
|
for (i = 0; i < nb_nics; i++) {
|
||||||
|
if (net_boot_mask & (1 << i)) {
|
||||||
|
- nd_table[i].bootable = 1;
|
||||||
|
net_boot_mask &= ~(1 << i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/net.h b/net.h
|
||||||
|
index 673b355..508d02e 100644
|
||||||
|
--- a/net.h
|
||||||
|
+++ b/net.h
|
||||||
|
@@ -132,7 +132,6 @@ struct NICInfo {
|
||||||
|
VLANState *vlan;
|
||||||
|
VLANClientState *netdev;
|
||||||
|
int used;
|
||||||
|
- int bootable;
|
||||||
|
int nvectors;
|
||||||
|
};
|
||||||
|
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
|
@ -0,0 +1,100 @@
|
||||||
|
From a4e7898d9442efc0e9b60d5e50d531effa095b63 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eduardo Habkost <ehabkost@redhat.com>
|
||||||
|
Date: Tue, 6 Apr 2010 19:38:52 -0300
|
||||||
|
Subject: [PATCH] net: remove broken net_set_boot_mask() boot device validation
|
||||||
|
|
||||||
|
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=561078
|
||||||
|
|
||||||
|
There are many problems with net_set_boot_mask():
|
||||||
|
|
||||||
|
1) It is broken when using the device model instead of "-net nic". Example:
|
||||||
|
$ qemu-system-x86_64 -device rtl8139,vlan=0,id=net0,mac=52:54:00:82:41:fd,bus=pci.0,addr=0x4 -net user,vlan=0,name=hostnet0 -vnc 0.0.0.0:0 -boot n
|
||||||
|
Cannot boot from non-existent NIC
|
||||||
|
$
|
||||||
|
2) The mask was previously used to set which boot ROMs were supposed to be
|
||||||
|
loaded, but this was changed long time ago. Now all ROM images are loaded,
|
||||||
|
and SeaBIOS takes care of jumping to the right boot entry point depending on
|
||||||
|
the boot settings.
|
||||||
|
3) Interpretation and validation of the boot parameter letters is done on
|
||||||
|
the machine type code. Examples: PC accepts only a,b,c,d,n as valid boot
|
||||||
|
device letters. mac99 accepts only a,b,c,d,e,f.
|
||||||
|
|
||||||
|
As a side-effect of this change, qemu-kvm won't abort anymore if using "-boot n"
|
||||||
|
on a machine with no network devices. Checking if the requested boot device is
|
||||||
|
valid is now a task for the BIOS or the machine-type code.
|
||||||
|
|
||||||
|
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
||||||
|
---
|
||||||
|
net.c | 19 -------------------
|
||||||
|
net.h | 1 -
|
||||||
|
vl.c | 5 +----
|
||||||
|
3 files changed, 1 insertions(+), 24 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/net.c b/net.c
|
||||||
|
index 4030e39..28b6b43 100644
|
||||||
|
--- a/net.c
|
||||||
|
+++ b/net.c
|
||||||
|
@@ -1187,25 +1187,6 @@ void net_host_device_remove(Monitor *mon, const QDict *qdict)
|
||||||
|
qemu_del_vlan_client(vc);
|
||||||
|
}
|
||||||
|
|
||||||
|
-void net_set_boot_mask(int net_boot_mask)
|
||||||
|
-{
|
||||||
|
- int i;
|
||||||
|
-
|
||||||
|
- /* Only the first four NICs may be bootable */
|
||||||
|
- net_boot_mask = net_boot_mask & 0xF;
|
||||||
|
-
|
||||||
|
- for (i = 0; i < nb_nics; i++) {
|
||||||
|
- if (net_boot_mask & (1 << i)) {
|
||||||
|
- net_boot_mask &= ~(1 << i);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (net_boot_mask) {
|
||||||
|
- fprintf(stderr, "Cannot boot from non-existent NIC\n");
|
||||||
|
- exit(1);
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
void do_info_network(Monitor *mon)
|
||||||
|
{
|
||||||
|
VLANState *vlan;
|
||||||
|
diff --git a/net.h b/net.h
|
||||||
|
index 508d02e..be0ee12 100644
|
||||||
|
--- a/net.h
|
||||||
|
+++ b/net.h
|
||||||
|
@@ -162,7 +162,6 @@ int net_client_parse(QemuOptsList *opts_list, const char *str);
|
||||||
|
int net_init_clients(void);
|
||||||
|
void net_check_clients(void);
|
||||||
|
void net_cleanup(void);
|
||||||
|
-void net_set_boot_mask(int boot_mask);
|
||||||
|
void net_host_device_add(Monitor *mon, const QDict *qdict);
|
||||||
|
void net_host_device_remove(Monitor *mon, const QDict *qdict);
|
||||||
|
|
||||||
|
diff --git a/vl.c b/vl.c
|
||||||
|
index 59f8084..98d390e 100644
|
||||||
|
--- a/vl.c
|
||||||
|
+++ b/vl.c
|
||||||
|
@@ -4909,7 +4909,7 @@ int main(int argc, char **argv, char **envp)
|
||||||
|
const char *gdbstub_dev = NULL;
|
||||||
|
uint32_t boot_devices_bitmap = 0;
|
||||||
|
int i;
|
||||||
|
- int snapshot, linux_boot, net_boot;
|
||||||
|
+ int snapshot, linux_boot;
|
||||||
|
const char *initrd_filename;
|
||||||
|
const char *kernel_filename, *kernel_cmdline;
|
||||||
|
char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */
|
||||||
|
@@ -5948,9 +5948,6 @@ int main(int argc, char **argv, char **envp)
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
- net_boot = (boot_devices_bitmap >> ('n' - 'a')) & 0xF;
|
||||||
|
- net_set_boot_mask(net_boot);
|
||||||
|
-
|
||||||
|
/* init the bluetooth world */
|
||||||
|
if (foreach_device_config(DEV_BT, bt_parse))
|
||||||
|
exit(1);
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
From fbd17986e80087d0d686c5b13a5b39998c845f2c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eduardo Habkost <ehabkost@redhat.com>
|
||||||
|
Date: Tue, 6 Apr 2010 19:38:53 -0300
|
||||||
|
Subject: [PATCH] boot: remove unused boot_devices_bitmap variable
|
||||||
|
|
||||||
|
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=561078
|
||||||
|
|
||||||
|
In addition to removing the variable, this also renames the parse_bootdevices()
|
||||||
|
function to validate_bootdevices(), as we don't need its return value anymore.
|
||||||
|
|
||||||
|
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
||||||
|
---
|
||||||
|
vl.c | 8 +++-----
|
||||||
|
1 files changed, 3 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/vl.c b/vl.c
|
||||||
|
index 98d390e..2c97805 100644
|
||||||
|
--- a/vl.c
|
||||||
|
+++ b/vl.c
|
||||||
|
@@ -2514,7 +2514,7 @@ int qemu_boot_set(const char *boot_devices)
|
||||||
|
return boot_set_handler(boot_set_opaque, boot_devices);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int parse_bootdevices(char *devices)
|
||||||
|
+static void validate_bootdevices(char *devices)
|
||||||
|
{
|
||||||
|
/* We just do some generic consistency checks */
|
||||||
|
const char *p;
|
||||||
|
@@ -2540,7 +2540,6 @@ static int parse_bootdevices(char *devices)
|
||||||
|
}
|
||||||
|
bitmap |= 1 << (*p - 'a');
|
||||||
|
}
|
||||||
|
- return bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void restore_boot_devices(void *opaque)
|
||||||
|
@@ -4907,7 +4906,6 @@ static int virtcon_parse(const char *devname)
|
||||||
|
int main(int argc, char **argv, char **envp)
|
||||||
|
{
|
||||||
|
const char *gdbstub_dev = NULL;
|
||||||
|
- uint32_t boot_devices_bitmap = 0;
|
||||||
|
int i;
|
||||||
|
int snapshot, linux_boot;
|
||||||
|
const char *initrd_filename;
|
||||||
|
@@ -5202,13 +5200,13 @@ int main(int argc, char **argv, char **envp)
|
||||||
|
|
||||||
|
if (legacy ||
|
||||||
|
get_param_value(buf, sizeof(buf), "order", optarg)) {
|
||||||
|
- boot_devices_bitmap = parse_bootdevices(buf);
|
||||||
|
+ validate_bootdevices(buf);
|
||||||
|
pstrcpy(boot_devices, sizeof(boot_devices), buf);
|
||||||
|
}
|
||||||
|
if (!legacy) {
|
||||||
|
if (get_param_value(buf, sizeof(buf),
|
||||||
|
"once", optarg)) {
|
||||||
|
- boot_devices_bitmap |= parse_bootdevices(buf);
|
||||||
|
+ validate_bootdevices(buf);
|
||||||
|
standard_boot_devices = qemu_strdup(boot_devices);
|
||||||
|
pstrcpy(boot_devices, sizeof(boot_devices), buf);
|
||||||
|
qemu_register_reset(restore_boot_devices,
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
13
qemu.spec
13
qemu.spec
|
@ -1,7 +1,7 @@
|
||||||
Summary: QEMU is a FAST! processor emulator
|
Summary: QEMU is a FAST! processor emulator
|
||||||
Name: qemu
|
Name: qemu
|
||||||
Version: 0.12.3
|
Version: 0.12.3
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
# Epoch because we pushed a qemu-1.0 package
|
# Epoch because we pushed a qemu-1.0 package
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
License: GPLv2+ and LGPLv2+ and BSD
|
License: GPLv2+ and LGPLv2+ and BSD
|
||||||
|
@ -28,6 +28,9 @@ Patch01: 0001-block-avoid-creating-too-large-iovecs-in-multiwrite_.patch
|
||||||
Patch02: 0002-migration-Clear-fd-also-in-error-cases.patch
|
Patch02: 0002-migration-Clear-fd-also-in-error-cases.patch
|
||||||
Patch03: 0003-raw-posix-Detect-CDROM-via-ioctl-on-linux.patch
|
Patch03: 0003-raw-posix-Detect-CDROM-via-ioctl-on-linux.patch
|
||||||
Patch04: 0004-usb-linux-increase-buffer-for-USB-control-requests.patch
|
Patch04: 0004-usb-linux-increase-buffer-for-USB-control-requests.patch
|
||||||
|
Patch05: 0005-net-remove-NICInfo.bootable-field.patch
|
||||||
|
Patch06: 0006-net-remove-broken-net_set_boot_mask-boot-device-vali.patch
|
||||||
|
Patch07: 0007-boot-remove-unused-boot_devices_bitmap-variable.patch
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
BuildRequires: SDL-devel zlib-devel which texi2html gnutls-devel cyrus-sasl-devel
|
BuildRequires: SDL-devel zlib-devel which texi2html gnutls-devel cyrus-sasl-devel
|
||||||
|
@ -221,6 +224,9 @@ such as kvmtrace and kvm_stat.
|
||||||
%patch02 -p1
|
%patch02 -p1
|
||||||
%patch03 -p1
|
%patch03 -p1
|
||||||
%patch04 -p1
|
%patch04 -p1
|
||||||
|
%patch05 -p1
|
||||||
|
%patch06 -p1
|
||||||
|
%patch07 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# --build-id option is used fedora 8 onwards for giving info to the debug packages.
|
# --build-id option is used fedora 8 onwards for giving info to the debug packages.
|
||||||
|
@ -398,6 +404,7 @@ fi
|
||||||
|
|
||||||
%files common
|
%files common
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
%dir %{qemudocdir}
|
||||||
%doc %{qemudocdir}/Changelog
|
%doc %{qemudocdir}/Changelog
|
||||||
%doc %{qemudocdir}/README
|
%doc %{qemudocdir}/README
|
||||||
%doc %{qemudocdir}/TODO
|
%doc %{qemudocdir}/TODO
|
||||||
|
@ -504,6 +511,10 @@ fi
|
||||||
%{_mandir}/man1/qemu-img.1*
|
%{_mandir}/man1/qemu-img.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Apr 23 2010 Justin M. Forbes <jforbes@redhat.com> - 2:0.12.3-4
|
||||||
|
- Add ownership of docdir to qemu-common (#572110)
|
||||||
|
- Fix "Cannot boot from non-existent NIC" error when using virt-install (#577851)
|
||||||
|
|
||||||
* Tue Apr 20 2010 Justin M. Forbes <jforbes@redhat.com> - 2:0.12.3-3
|
* Tue Apr 20 2010 Justin M. Forbes <jforbes@redhat.com> - 2:0.12.3-3
|
||||||
- Require seabios-bin which is noarch.
|
- Require seabios-bin which is noarch.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue