This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-18 14:30:47 +01:00
commit eaa3641b4f
27 files changed
+615 -284

No files matched your search

+1
View File
@@ -171,6 +171,7 @@
^tools/xentrace/tbctl$
^tools/xentrace/xenctx$
^tools/xentrace/xentrace$
^tools/xm-test/ramdisk/buildroot
^xen/BLOG$
^xen/TAGS$
^xen/arch/x86/asm-offsets\.s$
+54 -4
View File
@@ -626,12 +626,62 @@ event.
=item B<block-attach> I<domain-id> I<be-dev> I<fe-dev> I<mode> I<[bedomain-id]>
Create a new virtual block device
Create a new virtual block device. This will trigger a hotplug event
for the guest.
B<OPTIONS>
=over 4
=item I<domain-id>
The domain id of the guest domain that the device will be attached to.
=item I<be-dev>
The device in the backend domain (usually domain 0) to be exported.
This can be specified as a physical partition (phy:sda7) or as a file
mounted as loopback (file://path/to/loop.iso).
=item I<fe-dev>
How the device should be presented to the guest domain. It can be
specified as either a symbolic name, such as /dev/hdc, for common
devices, or by device id, such as 0x1400 (/dev/hdc device id in hex).
=item I<mode>
The access mode for the device from the guest domain. Supported modes
are I<rw> (read/write) or I<ro> (read-only).
=item I<bedomain-id>
The back end domain hosting the device. This defaults to domain 0.
=back
B<EXAMPLES>
=over 4
=item I<Mount an ISO as a Disk>
xm block-attach guestdomain file://path/to/dsl-2.0RC2.iso /dev/hdc ro
This will mount the dsl iso as /dev/hdc in the guestdomain as a read
only device. This will probably not be detected as a cdrom by the
guest, but mounting /dev/hdc manually will work.
=back
=item B<block-detach> I<domain-id> I<devid>
Destroy a domain's virtual block device. DevId may either be a device
ID or the device name as mounted in the guest.
Destroy a domain's virtual block device. devid B<must> be the device
id given to the device by domain 0. You will need to run I<xm
block-list> to determine that number.
FIXME: this is currently B<broken>. Even though a block device is
removed from domU, it appears to still be allocated in the domain 0.
=item B<block-list> I<domain-id>
@@ -722,7 +772,7 @@ Delete a vnet.
=head1 SEE ALSO
B<xmdomain.cfg>(5)
B<xmdomain.cfg>(5), B<xentop>(1)
BVT scheduling paper: K.J. Duda and D.R. Cheriton. Borrowed Virtual
Time (BVT) scheduling: supporting latency-sensitive threads in a
+184 -39
View File
@@ -1,6 +1,6 @@
=head1 NAME
xmdomain.cfg - xm domain create config file format
xmdomain.cfg - xm domain config file format
=head1 SYNOPSIS
@@ -10,17 +10,22 @@ xmdomain.cfg - xm domain create config file format
=head1 DESCRIPTION
The xm(1) program uses python executable config files to define
The B<xm>(1) program uses python executable config files to define
domains to create from scratch. Each of these config files needs to
contain a number of required options, and may specify many more.
Domain configuration files live in /etc/xen by default, though the
full path to the config file must be specified in the I<xm create>
command, so they can exist anywhere in the filesystem.
Domain configuration files live in /etc/xen by default, if you store
config files anywhere else the full path to the config file must be
specified in the I<xm create> command.
/etc/xen/auto is a special case however, as domain config files in
that directory will be started automatically at system boot if the
xendomain init script is enabled.
/etc/xen/auto is a special case. Domain config files in that
directory will be started automatically at system boot if the
xendomain init script is enabled. The contents of /etc/xen/auto
should be symlinks to files in /etc/xen to allow I<xm create> to be
used without full paths.
Options are specified by I<name = value> statements in the
xmdomain.cfg files.
=head1 OPTIONS
@@ -29,50 +34,157 @@ file.
=over 4
=item I<kernel>
=item B<kernel>
The kernel image used in the domain.
The kernel image for the domain. The format of the parameter is the
fully qualified path to the kernel image file,
i.e. I</boot/vmlinuz-2.6.12-xenU>.
=item I<ramdisk>
The initial ramdisk to be used in the domain. Default xen domU
kernels do not usually need a ramdisk.
=item B<ramdisk>
=item I<memory>
The initial ramdisk for the domain. The format of the parameter is
the fully qualified path to the initrd, i.e. I</boot/initrd.gz>. On
many Linux distros you will not need a ramdisk if using the default
xen kernel.
The amount of memory, in megabytes to allocate to the domain when it
=item B<memory>
The amount of RAM, in megabytes, to allocate to the domain when it
starts. Allocating insufficient memory for a domain may produce
extremely bizarre behavior.
extremely bizarre behavior. If there isn't enough free memory left on
the machine to fulfill this request, the domain will fail to start.
=item I<name>
Xen does not support overcommit of memory, so the total memory of all
guests (+ 64 MB needed for Xen) must be less than or equal to the
physical RAM in the machine.
A unique name for the domain. You can not create 2 domains with the
same name.
=item B<name>
=item I<root>
A unique name for the domain. Attempting to create two domains with
the same name will cause an error.
Root stanza for the domain (required for Linux domains).
=item B<root>
=item I<disk>
Specifies the root device for the domain. This is required for Linux
domains, and possibly other OSes.
An array of disk stanzas
=item B<nics>
=back
The number of network interfaces allocated to the domain on boot. It
defaults to 1.
A bare minimal config file example might be as follows:
=item B<disk>
kernel = "/boot/vmlinuz-2.6-xenU"
memory = 128
name = "MyLinux"
root = "/dev/hda1 ro"
An array of block device stanzas, in the form:
=head1 ADDITIONAL OPTIONS
disk = [ "stanza1", "stanza2", ... ]
Each stanza has 3 terms, seperated by commas,
"backend-dev,frontend-dev,mode".
=over 4
=item I<builder>
=item I<backend-dev>
=back
The device in the backend domain that will be exported to the guest
(frontend) domain. Supported formats include:
I<phy:device> - export the physical device listed. The device can be
in symbolic form, as in sda7, or as the hex major/minor number, as in
0x301 (which is hda1).
I<file://path/to/file> - export the file listed as a loopback device.
This will take care of the loopback setup before exporting the device.
=item I<frontend-dev>
How the device should appear in the guest domain. The device can be
in symbolic form, as in sda7, or as the hex major/minor number, as in
0x301 (which is hda1).
=item I<mode>
The access mode for the device. There are currently 2 valid options,
I<r> (read-only), I<w> (read/write).
=back
=item B<vif>
An arrray of virtual interface stanzas in the form:
vif = [ "stanza1", "stanza2", ... ]
Each stanza specifies a set of I<name = value> options separated by
commas, in the form: "name1=value1, name2=value2, ..."
B<OPTIONS>
=over 4
=item I<bridge>
The network bridge to be used for this device. This is especially
needed if multiple bridges exist on the machine.
=item I<mac>
The MAC address for the virtual interface. If mac is not specified,
one will be randomly chosen by xen with the 00:16:3e vendor id prefix.
=back
=back
=head1 ADDITIONAL OPTIONS
The following options are also supported in the config file, though
are far more rarely used.
=over 4
=item B<builder>
Which builder should be used to construct the domain. This defaults
to the I<linux> if not specified, which is the builder for
paravirtualized Linux domains.
=item B<cpu>
Specifies which CPU the domain should be started on, where 0 specifies
the first cpu, 1 the second, and so on. This defaults to -1, which
means Xen is free to pick which CPU to start on.
=item B<extra>
Extra information to append to the end of the kernel parameter line.
The format is a string, the contents of which can be anything that the
kernel supports. For instance:
extra = "4"
Will cause the domain to boot to runlevel 4.
=item B<nfs_server>
The IP address of the NFS server to use as the root device for the
domain. In order to do this you'll need to specify I<root=/dev/nfs>,
and specify I<nfs_root>.
=item B<nfs_root>
The directory on the NFS server to be used as the root filesystem.
Specified as a fully qualified path, i.e. I</full/path/to/root/dir>.
=item B<vcpus>
The number of virtual cpus to allocate to the domain. In order to use
this the xen kernel must be compiled with SMP support.
This defaults to 1, meaning running the domain as a UP.
=back
=head1 DOMAIN SHUTDOWN OPTIONS
@@ -81,17 +193,17 @@ unplanned) under certain events. The 3 events currently captured are:
=over 4
=item I<shutdown>
=item B<on_shutdown>
Triggered on either an I<xm shutdown> or graceful shutdown from inside
the DomU.
=item I<reboot>
=item B<on_reboot>
Triggered on either an I<xm reboot> or graceful reboot from inside the
DomU.
=item I<crash>
=item B<on_crash>
Triggered when a DomU goes to the crashed state for any reason.
@@ -101,23 +213,23 @@ All of them take one of 4 valid states listed below.
=over 4
=item I<destroy>
=item B<destroy>
The domain will be cleaned up completely. No attempt at respawning
will occur. This is what a typical shutdown would look like.
=item I<restart>
=item B<restart>
The domain will be restarted with the same name as the old domain.
This is what a typical reboot would look like.
=item I<preserve>
=item B<preserve>
The domain will not be cleaned up at all. This is often useful for
crash state domains which ensures that enough evidence is to debug the
real issue.
=item I<rename-restart>
=item B<rename-restart>
The old domain will not be cleaned up, but will be renamed so a new
domain can be restarted in it's place. The old domain will be renamed with
@@ -127,6 +239,39 @@ it holds, so that the new one may take them.
=back
=head1 EXAMPLES
The following are quick examples of ways that domains might be
configured. They should not be considered an exhaustive set.
=over 4
=item I<A Loopback File as Root>
kernel = "/boot/vmlinuz-2.6-xenU"
memory = 128
name = "MyLinux"
root = "/dev/hda1 ro"
disk = [ "file:/var/xen/mylinux.img,hda1,w" ]
This creates a domain called MyLinux with 128 MB of memory using a
default xen kernel, and the file /var/xen/mylinux.img loopback mounted
at hda1, which is the root filesystem.
=item I<NFS Root>
FIXME: write me
=item I<LVM Root>
FIXME: write me
=item I<Two Networks>
FIXME: write me
=back
=head1 SEE ALSO
B<xm>(1)
@@ -37,16 +37,10 @@
#include <asm-xen/balloon.h>
#include <asm-xen/xen-public/memory.h>
#include <linux/module.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/percpu.h>
#include <asm/tlbflush.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define pte_offset_kernel pte_offset
#define pud_t pgd_t
#define pud_offset(d, va) d
#elif defined(CONFIG_X86_64)
#ifdef CONFIG_X86_64
#define pmd_val_ma(v) (v).pmd
#else
#ifdef CONFIG_X86_PAE
@@ -121,11 +121,7 @@ static void init_evtchn_cpu_bindings(void)
/* Upcall to generic IRQ layer. */
#ifdef CONFIG_X86
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
extern fastcall unsigned int do_IRQ(struct pt_regs *regs);
#else
extern asmlinkage unsigned int do_IRQ(struct pt_regs *regs);
#endif
#if defined (__i386__)
#define IRQ_REG orig_eax
#elif defined (__x86_64__)
@@ -91,7 +91,6 @@ static void balloon_process(void *unused);
static DECLARE_WORK(balloon_worker, balloon_process, NULL);
static struct timer_list balloon_timer;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
/* Use the private and mapping fields of struct page as a list. */
#define PAGE_TO_LIST(p) ((struct list_head *)&p->private)
#define LIST_TO_PAGE(l) \
@@ -102,19 +101,6 @@ static struct timer_list balloon_timer;
p->mapping = NULL; \
p->private = 0; \
} while(0)
#else
/* There's a dedicated list field in struct page we can use. */
#define PAGE_TO_LIST(p) ( &p->list )
#define LIST_TO_PAGE(l) ( list_entry(l, struct page, list) )
#define UNLIST_PAGE(p) ( list_del(&p->list) )
#define pte_offset_kernel pte_offset
#define pud_t pgd_t
#define pud_offset(d, va) d
#define pud_none(d) 0
#define pud_bad(d) 0
#define subsys_initcall(_fn) __initcall(_fn)
#define pfn_to_page(_pfn) (mem_map + (_pfn))
#endif
#define IPRINTK(fmt, args...) \
printk(KERN_INFO "xen_mem: " fmt, ##args)
@@ -57,6 +57,7 @@
#define BLKIF_STATE_DISCONNECTED 0
#define BLKIF_STATE_CONNECTED 1
#define BLKIF_STATE_SUSPENDED 2
#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
(BLKIF_MAX_SEGMENTS_PER_REQUEST * BLKIF_RING_SIZE)
@@ -75,7 +76,7 @@ static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs);
static void blkif_restart_queue(void *arg);
static void blkif_recover(struct blkfront_info *);
static void blkif_completion(struct blk_shadow *);
static void blkif_free(struct blkfront_info *);
static void blkif_free(struct blkfront_info *, int);
/**
@@ -144,7 +145,7 @@ static int blkfront_resume(struct xenbus_device *dev)
DPRINTK("blkfront_resume: %s\n", dev->nodename);
blkif_free(info);
blkif_free(info, 1);
err = talk_to_backend(dev, info);
if (!err)
@@ -207,7 +208,7 @@ again:
if (message)
xenbus_dev_fatal(dev, err, "%s", message);
destroy_blkring:
blkif_free(info);
blkif_free(info, 0);
out:
return err;
}
@@ -252,7 +253,7 @@ static int setup_blkring(struct xenbus_device *dev,
return 0;
fail:
blkif_free(info);
blkif_free(info, 0);
return err;
}
@@ -295,7 +296,8 @@ static void connect(struct blkfront_info *info)
unsigned int binfo;
int err;
if (info->connected == BLKIF_STATE_CONNECTED)
if( (info->connected == BLKIF_STATE_CONNECTED) ||
(info->connected == BLKIF_STATE_SUSPENDED) )
return;
DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
@@ -354,7 +356,7 @@ static int blkfront_remove(struct xenbus_device *dev)
DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
blkif_free(info);
blkif_free(info, 0);
kfree(info);
@@ -569,6 +571,7 @@ void do_blkif_request(request_queue_t *rq)
req->nr_sectors, req->buffer,
rq_data_dir(req) ? "write" : "read");
blkdev_dequeue_request(req);
if (blkif_queue_request(req)) {
blk_requeue_request(rq, req);
@@ -643,11 +646,12 @@ static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs)
return IRQ_HANDLED;
}
static void blkif_free(struct blkfront_info *info)
static void blkif_free(struct blkfront_info *info, int suspend)
{
/* Prevent new requests being issued until we fix things up. */
spin_lock_irq(&blkif_io_lock);
info->connected = BLKIF_STATE_DISCONNECTED;
info->connected = suspend ?
BLKIF_STATE_SUSPENDED : BLKIF_STATE_DISCONNECTED;
spin_unlock_irq(&blkif_io_lock);
/* Free resources associated with old device channel. */
@@ -128,12 +128,7 @@ static spinlock_t xencons_lock = SPIN_LOCK_UNLOCKED;
/* Common transmit-kick routine. */
static void __xencons_tx_flush(void);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct tty_driver *xencons_driver;
#else
static struct tty_driver xencons_driver;
#endif
/******************** Kernel console driver ********************************/
@@ -170,18 +165,11 @@ static void kcons_write_dom0(
}
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct tty_driver *kcons_device(struct console *c, int *index)
{
*index = c->index;
return xencons_driver;
}
#else
static kdev_t kcons_device(struct console *c)
{
return MKDEV(TTY_MAJOR, (xc_mode == XC_SERIAL) ? 64 : 1);
}
#endif
static struct console kcons_info = {
.device = kcons_device,
@@ -189,13 +177,8 @@ static struct console kcons_info = {
.index = -1,
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#define __RETCODE 0
static int __init xen_console_init(void)
#else
#define __RETCODE
void xen_console_init(void)
#endif
{
if (xen_init() < 0)
return __RETCODE;
@@ -204,10 +187,8 @@ void xen_console_init(void)
if (xc_mode == XC_DEFAULT)
xc_mode = XC_SERIAL;
kcons_info.write = kcons_write_dom0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if (xc_mode == XC_SERIAL)
kcons_info.flags |= CON_ENABLED;
#endif
} else {
if (xc_mode == XC_DEFAULT)
xc_mode = XC_TTY;
@@ -237,9 +218,7 @@ void xen_console_init(void)
return __RETCODE;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
console_initcall(xen_console_init);
#endif
/*** Useful function for console debugging -- goes straight to Xen. ***/
asmlinkage int xprintk(const char *fmt, ...)
@@ -283,15 +262,8 @@ void xencons_force_flush(void)
/******************** User-space console driver (/dev/console) ************/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#define DRV(_d) (_d)
#define TTY_INDEX(_tty) ((_tty)->index)
#else
static int xencons_refcount;
static struct tty_struct *xencons_table[MAX_NR_CONSOLES];
#define DRV(_d) (&(_d))
#define TTY_INDEX(_tty) (MINOR((_tty)->device) - xencons_driver.minor_start)
#endif
static struct termios *xencons_termios[MAX_NR_CONSOLES];
static struct termios *xencons_termios_locked[MAX_NR_CONSOLES];
@@ -484,7 +456,6 @@ static inline int __xencons_put_char(int ch)
return 1;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int xencons_write(
struct tty_struct *tty,
const unsigned char *buf,
@@ -509,42 +480,6 @@ static int xencons_write(
return i;
}
#else
static int xencons_write(
struct tty_struct *tty,
int from_user,
const u_char *buf,
int count)
{
int i;
unsigned long flags;
if (from_user && verify_area(VERIFY_READ, buf, count))
return -EINVAL;
if (TTY_INDEX(tty) != 0)
return count;
spin_lock_irqsave(&xencons_lock, flags);
for (i = 0; i < count; i++) {
char ch;
if (from_user)
__get_user(ch, buf + i);
else
ch = buf[i];
if (!__xencons_put_char(ch))
break;
}
if (i != 0)
__xencons_tx_flush();
spin_unlock_irqrestore(&xencons_lock, flags);
return i;
}
#endif
static void xencons_put_char(struct tty_struct *tty, u_char ch)
{
@@ -629,7 +564,6 @@ static void xencons_close(struct tty_struct *tty, struct file *filp)
}
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct tty_operations xencons_ops = {
.open = xencons_open,
.close = xencons_close,
@@ -685,7 +619,6 @@ const struct consw xennull_con = {
.con_scrolldelta = DUMMY,
};
#endif
#endif
static int __init xencons_init(void)
{
@@ -699,19 +632,10 @@ static int __init xencons_init(void)
xencons_ring_init();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
xencons_driver = alloc_tty_driver((xc_mode == XC_SERIAL) ?
1 : MAX_NR_CONSOLES);
if (xencons_driver == NULL)
return -ENOMEM;
#else
memset(&xencons_driver, 0, sizeof(struct tty_driver));
xencons_driver.magic = TTY_DRIVER_MAGIC;
xencons_driver.refcount = &xencons_refcount;
xencons_driver.table = xencons_table;
xencons_driver.num =
(xc_mode == XC_SERIAL) ? 1 : MAX_NR_CONSOLES;
#endif
DRV(xencons_driver)->major = TTY_MAJOR;
DRV(xencons_driver)->type = TTY_DRIVER_TYPE_SERIAL;
@@ -735,37 +659,18 @@ static int __init xencons_init(void)
DRV(xencons_driver)->name_base = xc_num;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
tty_set_operations(xencons_driver, &xencons_ops);
#else
xencons_driver.open = xencons_open;
xencons_driver.close = xencons_close;
xencons_driver.write = xencons_write;
xencons_driver.write_room = xencons_write_room;
xencons_driver.put_char = xencons_put_char;
xencons_driver.flush_chars = xencons_flush_chars;
xencons_driver.chars_in_buffer = xencons_chars_in_buffer;
xencons_driver.send_xchar = xencons_send_xchar;
xencons_driver.flush_buffer = xencons_flush_buffer;
xencons_driver.throttle = xencons_throttle;
xencons_driver.unthrottle = xencons_unthrottle;
xencons_driver.wait_until_sent = xencons_wait_until_sent;
#endif
if ((rc = tty_register_driver(DRV(xencons_driver))) != 0) {
printk("WARNING: Failed to register Xen virtual "
"console driver as '%s%d'\n",
DRV(xencons_driver)->name, DRV(xencons_driver)->name_base);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
put_tty_driver(xencons_driver);
xencons_driver = NULL;
#endif
return rc;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
tty_register_device(xencons_driver, 0, NULL);
#endif
if (xen_start_info->flags & SIF_INITDOMAIN) {
xencons_priv_irq = bind_virq_to_irqhandler(
@@ -436,9 +436,7 @@ static struct miscdevice evtchn_miscdev = {
.minor = EVTCHN_MINOR,
.name = "evtchn",
.fops = &evtchn_fops,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.devfs_name = "misc/evtchn",
#endif
};
static int __init evtchn_init(void)
@@ -32,11 +32,6 @@
#include <asm-xen/xen-public/dom0_ops.h>
#include <asm-xen/xen_proc.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define pud_t pgd_t
#define pud_offset(d, va) d
#endif
static struct proc_dir_entry *privcmd_intf;
static int privcmd_ioctl(struct inode *inode, struct file *file,
@@ -39,15 +39,11 @@
#include <asm/ptrace.h>
#include <asm/page.h>
#if defined(__i386__)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
# ifdef CONFIG_X86_PAE
# include <asm-generic/pgtable-nopud.h>
# else
# include <asm-generic/pgtable-nopmd.h>
# endif
# else
# define pud_t pgd_t
# endif
#endif
extern shared_info_t *HYPERVISOR_shared_info;
@@ -113,22 +109,6 @@ void xen_tlb_flush_mask(cpumask_t *mask);
void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr);
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
/*
** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just
** include sufficient #defines to allow the below to build.
*/
#define DEFINE_PER_CPU(type, name) \
__typeof__(type) per_cpu__##name
#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
#define __get_cpu_var(var) per_cpu__##var
#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
#endif /* linux < 2.6.0 */
/* Returns zero on success else negative errno. */
int xen_create_contiguous_region(
unsigned long vstart, unsigned int order, unsigned int address_bits);
+1 -1
View File
@@ -137,7 +137,7 @@ int adlib_enabled = 1;
int gus_enabled = 1;
int pci_enabled = 1;
int prep_enabled = 0;
int rtc_utc = 1;
int rtc_utc = 0;
int cirrus_vga_enabled = 1;
int vga_accelerate = 1;
int graphic_width = 800;
+5
View File
@@ -729,6 +729,11 @@ int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
/* Domain is still running at this point */
if (live && (pt_levels != 2)) {
ERR("Live migration supported only for 32-bit non-pae");
goto out;
}
if (live) {
if (xc_shadow_control(xc_handle, dom,
+158 -69
View File
@@ -40,26 +40,81 @@ from xen.xm.opts import *
import console
# Strings for shorthelp
console_help = "console <DomId> Attach to domain DomId's console."
create_help = """create [-c] <ConfigFile>
[Name=Value].. Create a domain based on Config File"""
destroy_help = "destroy <DomId> Terminate a domain immediately"
help_help = "help Display this message"
list_help = "list [--long] [DomId, ...] List information about domains"
mem_max_help = "mem-max <DomId> <Mem> Set maximum memory reservation for a domain"
mem_set_help = "mem-set <DomId> <Mem> Adjust the current memory usage for a domain"
migrate_help = "migrate <DomId> <Host> Migrate a domain to another machine"
pause_help = "pause <DomId> Pause execution of a domain"
reboot_help = "reboot <DomId> [-w][-a] Reboot a domain"
restore_help = "restore <File> Create a domain from a saved state file"
save_help = "save <DomId> <File> Save domain state (and config) to file"
shutdown_help ="shutdown <DomId> [-w][-a][-R|-H] Shutdown a domain"
top_help = "top Monitor system and domains in real-time"
unpause_help = "unpause <DomId> Unpause a paused domain"
help_spacer = """
"""
# Strings for longhelp
sysrq_help = "sysrq <DomId> <letter> Send a sysrq to a domain"
domid_help = "domid <DomName> Converts a domain name to a domain id"
domname_help = "domname <DomId> Convert a domain id to a domain name"
set_vcpus_help = """set-vcpus <DomId> <VCPUs> Enable the specified number of VCPUs in a
domain"""
vcpu_list_help = "vcpu-list <DomId> List the VCPUs for a domain (or all domains)"
vcpu_pin_help = "vcpu-pin <DomId> <VCPU> <CPUs> Set which cpus a VCPU can use"
dmesg_help = "dmesg [--clear] Read or clear Xen's message buffer"
info_help = "info Get information about the xen host"
log_help = "log Print the xend log"
sched_bvt_help = """sched-bvt <Parameters> Set Borrowed Virtual Time scheduler
parameters"""
sched_bvt_ctxallow_help = """sched-bvt-ctxallow <Allow> Set the BVT scheduler context switch
allowance"""
sched_sedf_help = "sched-sedf <Parameters> Set simple EDF parameters"
block_attach_help = """block-attach <DomId> <BackDev> <FrontDev> <Mode>
[BackDomId] Create a new virtual block device"""
block_detach_help = """block-detach <DomId> <DevId> Destroy a domain's virtual block device,
where <DevId> may either be the device ID
or the device name as mounted in the guest"""
block_list_help = "block-list <DomId> List virtual block devices for a domain"
network_attach_help = """network-attach <DomID> [script=<script>] [ip=<ip>] [mac=<mac>]
[bridge=<bridge>] [backend=<backDomID>]
Create a new virtual network device """
network_detach_help = """network-detach <DomId> <DevId> Destroy a domain's virtual network
device, where <DevId> is the device ID."""
network_list_help = "network-list <DomId> List virtual network interfaces for a domain"
vnet_list_help = "vnet-list [-l|--long] list vnets"
vnet_create_help = "vnet-create <config> create a vnet from a config file"
vnet_delete_help = "vnet-delete <vnetid> delete a vnet"
shorthelp = """Usage: xm <subcommand> [args]
Control, list, and manipulate Xen guest instances
xm common subcommands:
console <DomId> attach to console of DomId
create <CfgFile> create a domain based on Config File
destroy <DomId> terminate a domain immediately
help display this message
list [DomId, ...] list information about domains
mem-max <DomId> <Mem> set the maximum memory reservation for a domain
mem-set <DomId> <Mem> adjust the current memory usage for a domain
migrate <DomId> <Host> migrate a domain to another machine
pause <DomId> pause execution of a domain
reboot <DomId> reboot a domain
restore <File> create a domain from a saved state file
save <DomId> <File> save domain state (and config) to file
shutdown <DomId> shutdown a domain
top monitor system and domains in real-time
unpause <DomId> unpause a paused domain
xm common subcommands:""" + help_spacer \
+ console_help + help_spacer \
+ create_help + help_spacer \
+ destroy_help + help_spacer \
+ help_help + help_spacer \
+ list_help + help_spacer \
+ mem_max_help + help_spacer \
+ mem_set_help + help_spacer \
+ migrate_help + help_spacer \
+ pause_help + help_spacer \
+ reboot_help + help_spacer \
+ restore_help + help_spacer \
+ save_help + help_spacer \
+ shutdown_help + help_spacer \
+ top_help + help_spacer \
+ unpause_help + """
<DomName> can be substituted for <DomId> in xm subcommands.
@@ -72,58 +127,51 @@ longhelp = """Usage: xm <subcommand> [args]
xm full list of subcommands:
Domain Commands:
console <DomId> attach to console of DomId
create <ConfigFile> create a domain
destroy <DomId> terminate a domain immediately
domid <DomName> convert a domain name to a domain id
domname <DomId> convert a domain id to a domain name
list list information about domains
mem-max <DomId> <Mem> set domain maximum memory limit
mem-set <DomId> <Mem> set the domain's memory dynamically
migrate <DomId> <Host> migrate a domain to another machine
pause <DomId> pause execution of a domain
reboot [-w|-a] <DomId> reboot a domain
restore <File> create a domain from a saved state file
save <DomId> <File> save domain state (and config) to file
shutdown [-w|-a] <DomId> shutdown a domain
sysrq <DomId> <letter> send a sysrq to a domain
unpause <DomId> unpause a paused domain
set-vcpus <DomId> <VCPUs> enable the specified number of VCPUs in a domain
vcpu-list <DomId> list the VCPUs for a domain
vcpu-pin <DomId> <VCPU> <CPUs> set which cpus a VCPU can use.
Domain Commands: """ + help_spacer \
+ console_help + help_spacer \
+ create_help + help_spacer \
+ destroy_help + help_spacer \
+ domid_help + help_spacer \
+ domname_help + help_spacer \
+ list_help + help_spacer \
+ mem_max_help + help_spacer \
+ mem_set_help + help_spacer \
+ migrate_help + help_spacer \
+ pause_help + help_spacer \
+ reboot_help + help_spacer \
+ restore_help + help_spacer \
+ save_help + help_spacer \
+ shutdown_help + help_spacer \
+ sysrq_help + help_spacer \
+ top_help + help_spacer \
+ unpause_help + help_spacer \
+ set_vcpus_help + help_spacer \
+ vcpu_pin_help + """
Xen Host Commands:
dmesg [--clear] read or clear Xen's message buffer
info get information about the xen host
log print the xend log
top monitor system and domains in real-time
Xen Host Commands: """ + help_spacer \
+ dmesg_help + help_spacer \
+ info_help + help_spacer \
+ log_help + help_spacer \
+ top_help + """
Scheduler Commands:
sched-bvt <options> set BVT scheduler parameters
sched-bvt-ctxallow <Allow>
Set the BVT scheduler context switch allowance
sched-sedf <options> set simple EDF parameters
Scheduler Commands: """ + help_spacer \
+ sched_bvt_help + help_spacer \
+ sched_bvt_ctxallow_help + help_spacer \
+ sched_sedf_help + """
Virtual Device Commands:
block-attach <DomId> <BackDev> <FrontDev> <Mode> [BackDomId]
Create a new virtual block device
block-detach <DomId> <DevId> Destroy a domain's virtual block device,
where <DevId> may either be the device ID
or the device name as mounted in the guest.
block-list <DomId> List virtual block devices for a domain
Virtual Device Commands:""" + help_spacer \
+ block_attach_help + help_spacer \
+ block_detach_help + help_spacer \
+ block_list_help + help_spacer \
+ network_attach_help + help_spacer \
+ network_detach_help + help_spacer \
+ network_limit_help + help_spacer \
+ network_list_help + """
network-attach <DomID> [script=<script>] [ip=<ip>] [mac=<mac>]
[bridge=<bridge>] [backend=<backDomID>]
Create a new virtual network device
network-detach <DomId> <DevId> Destroy a domain's virtual network
device, where <DevId> is the device ID.
network-list <DomId> List virtual network interfaces for a domain
Vnet commands:
vnet-list [-l|--long] list vnets
vnet-create <config> create a vnet from a config file
vnet-delete <vnetid> delete a vnet
Vnet commands: """ + help_spacer \
+ vnet_list_help + help_spacer \
+ vnet_create_help + help_spacer \
+ vnet_delete_help + """
<DomName> can be substituted for <DomId> in xm subcommands.
@@ -131,6 +179,51 @@ For a short list of subcommands run 'xm help'
For more help on xm see the xm(1) man page
For more help on xm create, see the xmdomain.cfg(5) man page"""
# array for xm help <command>
help = {
"--long": longhelp,
"console": console_help,
"create": create_help,
"destroy": destroy_help,
"domid ": domid_help,
"domname": domname_help,
"list": list_help,
"mem-max": mem_max_help,
"mem-set": mem_set_help,
"migrate": migrate_help,
"pause": pause_help,
"reboot": reboot_help,
"restore": restore_help,
"save": save_help,
"shutdown": shutdown_help,
"sysrq": sysrq_help,
"unpause": unpause_help,
"set-vcpus": set_vcpus_help,
"vcpu-list": vcpu_list_help,
"vcpu-pin": vcpu_pin_help,
# Xen Host Commands:
"dmesg": dmesg_help,
"info": info_help,
"log": log_help,
"top": top_help,
# Scheduler Commands:
"sched-bvt": sched_bvt_help,
"sched-bvt-ctxallow": sched_bvt_ctxallow_help,
"sched-sedf": sched_sedf_help,
# Virtual Device Commands:
"block-attach": block_attach_help,
"block-detach": block_detach_help,
"block-list": block_list_help,
"network-attach": network_attach_help,
"network-detach": network_detach_help,
"network-list": network_list_help,
# Vnet commands:
"vnet-list": vnet_list_help,
"vnet-create": vnet_create_help,
"vnet-delete": vnet_delete_help
}
####################################################################
#
# Utility functions
@@ -734,10 +827,6 @@ aliases = {
"vbd-list": "block-list",
}
help = {
"--long": longhelp
}
def xm_lookup_cmd(cmd):
if commands.has_key(cmd):
@@ -759,7 +848,7 @@ def deprecated(old,new):
def usage(cmd=None):
if help.has_key(cmd):
print help[cmd]
print " " + help[cmd]
else:
print shorthelp
sys.exit(1)
+3
View File
@@ -1,6 +1,9 @@
SUBDIRS = ramdisk tests
EXTRA_DIST = lib runtest.sh mkreport
existing:
$(MAKE) -C ramdisk existing
# Remove any pyc's, CVS dirs, and prune the skel dirs
dist-hook:
find $(distdir) -name '*~' -delete -print
+9 -5
View File
@@ -45,11 +45,15 @@ special files, this process must be done as root:
NB: If you have the initrd.img from another installation of xm-test,
you can copy it into the ramdisk directory to eliminate the need to
rebuild it. If you do this, there is no need to run 'make' again.
Simply copy the initrd.img file into ramdisk/ and then run the
runtest.sh script. Note that in general, you should not attempt to
use a ramdisk from a previous minor version of xm-test (i.e., don't
use a ramdisk from 0.4.0 with 0.5.0. 0.5.0 should work for 0.5.3
though)
Simply copy the initrd-X.Y.img file into ramdisk/ and then run:
# make existing
This will set up the link so that xm-test will use the existing
ramdisk. Next, just run "runtest.sh" normally. Note that in general,
you should not attempt to use a ramdisk from a previous minor version
of xm-test (i.e., don't use a ramdisk from 0.4.0 with 0.5.0. 0.5.0
should work for 0.5.3 though)
Running
+3 -2
View File
@@ -1,7 +1,7 @@
# xm-test configure.ac input script
# Basic header information
AC_INIT([xm-test], [0.5.0])
AC_INIT([xm-test], [0.6.0])
AM_INIT_AUTOMAKE([1.7 foreign])
# Check for dependencies
@@ -65,5 +65,6 @@ AC_CONFIG_FILES([
lib/XmTestLib/config.py
])
AC_OUTPUT
chmod a+x lib/XmTestReport/xmtest.py
@@ -1,3 +1,15 @@
#!/usr/bin/python
XM_TEST_VERSION = "@PACKAGE_VERSION@"
if __name__ == "__main__":
import re
match = re.match("^(\d+)\.(\d+)\.(\d+)$", XM_TEST_VERSION)
print "XM_TEST_VERSION=%s" % XM_TEST_VERSION
if match:
print "XM_TEST_MAJ=%s" % match.group(1)
print "XM_TEST_MIN=%s" % match.group(2)
print "XM_TEST_REV=%s" % match.group(3)
+15 -3
View File
@@ -1,5 +1,5 @@
EXTRA_DIST = skel configs
EXTRA_DIST = skel configs patches
BR_TAR = buildroot-20050823.tar.bz2
BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
@@ -9,6 +9,9 @@ BR_IMG = $(BR_SRC)/rootfs.i386.ext2
BR_ROOT = build_i386/root
XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/\1.\2/')
XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
all: initrd.img
$(BR_TAR):
@@ -21,12 +24,21 @@ $(BR_IMG): $(BR_SRC)
cp configs/buildroot $(BR_SRC)/.config
cp configs/busybox $(BR_SRC)/package/busybox/busybox.config
cp configs/uClibc $(BR_SRC)/toolchain/uClibc/uClibc.config
(for i in patches/buildroot/*.patch; do \
cd $(BR_SRC) && patch -p1 <../$$i; done )
cd $(BR_SRC) && make oldconfig && make
initrd.img: $(BR_IMG)
$(XMTEST_VER_IMG): $(BR_IMG)
(cd skel; tar cf - .) | (cd $(BR_SRC)/$(BR_ROOT); tar xvf -)
cd $(BR_SRC) && make
cp $(BR_IMG) initrd.img
cp $(BR_IMG) initrd-$(XMTEST_MAJ_VER).img
initrd.img: $(XMTEST_VER_IMG)
ln -sf $(XMTEST_VER_IMG) initrd.img
existing:
@[ -f $(XMTEST_VER_IMG) ] && ln -sf $(XMTEST_VER_IMG) initrd.img || \
echo Error, $(XMTEST_VER_IMG) not found
clean-local: am_config_clean-local
+1
View File
@@ -225,6 +225,7 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"
# BR2_PACKAGE_WIRELESS_TOOLS is not set
# BR2_PACKAGE_XORG is not set
# BR2_PACKAGE_ZLIB is not set
BR2_PACKAGE_HPING=y
#
# Target Options
@@ -0,0 +1,67 @@
diff -Naur buildroot.orig/package/Config.in buildroot/package/Config.in
--- buildroot.orig/package/Config.in 2005-11-15 07:30:21.000000000 -0800
+++ buildroot/package/Config.in 2005-11-15 07:30:54.000000000 -0800
@@ -118,6 +118,6 @@
source "package/wireless-tools/Config.in"
source "package/xorg/Config.in"
source "package/zlib/Config.in"
-
+source "package/hping/Config.in"
endmenu
diff -Naur buildroot.orig/package/hping/Config.in buildroot/package/hping/Config.in
--- buildroot.orig/package/hping/Config.in 1969-12-31 16:00:00.000000000 -0800
+++ buildroot/package/hping/Config.in 2005-11-14 14:13:20.000000000 -0800
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HPING
+ bool "hping"
+ default y
+ help
+ This is the hping package
diff -Naur buildroot.orig/package/hping/hping.mk buildroot/package/hping/hping.mk
--- buildroot.orig/package/hping/hping.mk 1969-12-31 16:00:00.000000000 -0800
+++ buildroot/package/hping/hping.mk 2005-11-14 15:11:06.000000000 -0800
@@ -0,0 +1,43 @@
+# Taken from the buildroot examples
+
+HPING_VERSION = 2.0.0-rc3
+HPING_TBALL = hping$(HPING_VERSION).tar.gz
+HPING_URL = http://www.hping.org/$(HPING_TBALL)
+HPING_DIR = $(BUILD_DIR)/hping2-rc3
+HPING_TARGET_BINARY = usr/bin/hping
+HPING_BINARY = hping
+
+$(DL_DIR)/$(HPING_TBALL):
+ $(WGET) -P $(DL_DIR) $(HPING_URL)
+
+$(HPING_DIR)/.source: $(DL_DIR)/$(HPING_TBALL)
+ tar xzf $(DL_DIR)/$(HPING_TBALL) -C $(BUILD_DIR)
+ touch $(HPING_DIR)/.source
+
+$(HPING_DIR)/.configured: $(HPING_DIR)/.source
+ (cd $(HPING_DIR); \
+ ./configure; )
+ cat $(HPING_DIR)/Makefile | grep -v './hping2 -v' > $(HPING_DIR)/foo
+ mv $(HPING_DIR)/foo $(HPING_DIR)/Makefile
+ touch $(HPING_DIR)/.configured
+
+$(HPING_DIR)/$(HPING_BINARY): $(HPING_DIR)/.configured
+ $(MAKE) CC=$(TARGET_CC) -C $(HPING_DIR)
+
+$(TARGET_DIR)/$(HPING_TARGET_BINARY): $(HPING_DIR)/$(HPING_BINARY)
+ cp $(HPING_DIR)/hping2 $(TARGET_DIR)/bin
+
+hping: $(TARGET_DIR)/$(HPING_TARGET_BINARY)
+
+hping-clean:
+ $(MAKE) prefix=$(TARGET_DIR)/usr -C $(HPING_DIR) uninstall
+ -$(MAKE) -C $(HPING_DIR) clean
+
+hping-dirclean:
+ rm -Rf $(HPING_DIR)
+
+ifeq ($(strip $(BR2_PACKAGE_HPING)),y)
+TARGETS += hping
+endif
+
+
+14 -2
View File
@@ -61,19 +61,31 @@ runnable_tests() {
fi
# See if the ramdisk has been built
rdsize=$(stat -c %s ramdisk/initrd.img 2>/dev/null)
rdsize=$(stat -Lc %s ramdisk/initrd.img 2>/dev/null)
if [ -z "$rdsize" ] || [ $rdsize -le 16384 ]; then
echo "Cannot find a valid ramdisk. You need to run \"make\" or"
echo "copy in a previously-built ramdisk to the ramdisk/ directory"
exit 1
fi
# Figure out the version of the ramdisk link and compare it
# to what it should be as a cheap way of making sure we're
# using the right version
realrd=$(readlink ramdisk/initrd.img)
eval $(./lib/XmTestReport/xmtest.py)
rrdver="initrd-${XM_TEST_MAJ}.${XM_TEST_MIN}.img"
if [ "$realrd" != "$rrdver" ]; then
echo "Error: ramdisk/initrd.img is from an old version"
echo "You need to build a ramdisk from at least ${XM_TEST_MAJ}.${XM_TEST_MIN}"
exit 1
fi
# See if xend is running
if ! xm list >/dev/null 2>&1; then
echo "'xm list' failed: is xend running?"
exit 1
fi
}
# Get contact info if needed
@@ -0,0 +1,66 @@
#!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
from XmTestLib import *
domain = XmTestDomain()
try:
domain.start()
except DomainError, e:
FAIL(str(e))
try:
console = XmConsole(domain.getName())
except ConsoleError, e:
FAIL(str(e))
s, o = traceCommand("xm block-list %s" % domain.getName())
if s != 0:
FAIL("block-list returned !0 when no devices attached")
if o:
FAIL("block-list without devices reported something!")
s, o = traceCommand("xm block-attach %s phy:/dev/ram0 hda1 w" % domain.getName())
if s != 0:
FAIL("Unable to attach /dev/ram0->hda1")
s, o = traceCommand("xm block-list %s" % domain.getName())
if s != 0:
FAIL("block-list failed")
if not o.find("769"):
FAIL("block-list didn't show the block device I just attached!")
s, o = traceCommand("xm block-attach %s phy:/dev/ram1 hda2 w" % domain.getName())
if s != 0:
FAIL("Unable to attach /dev/ram1->hda2")
s, o = traceCommand("xm block-list %s" % domain.getName())
if s != 0:
FAIL("block-list failed")
if not o.find("770"):
FAIL("block-list didn't show the other block device I just attached!")
s, o = traceCommand("xm block-detach %s 769" % domain.getName())
if s != 0:
FAIL("block-destroy of hda1 failed")
s, o = traceCommand("xm block-list %s" % domain.getName())
if s != 0:
FAIL("block-list failed after detaching a device")
if o.find("769"):
FAIL("hda1 still shown in block-list after detach!")
if not o.find("770"):
FAIL("hda2 not shown after detach of hda1!")
s, o = traceCommand("xm block-detach %s 770" % domain.getName())
if s != 0:
FAIL("block-list failed after detaching another device")
if o.find("770"):
FAIL("hda2 still shown in block-list after detach!")
if o:
FAIL("block-list still shows something after all devices detached!")
+2 -1
View File
@@ -5,7 +5,8 @@ TESTS = 01_block-list_pos.test \
02_block-list_attachbd_pos.test \
03_block-list_anotherbd_pos.test \
04_block-list_nodb_pos.test \
05_block-list_nonexist_neg.test
05_block-list_nonexist_neg.test \
06_block-list_checkremove_pos.test
XFAIL_TESTS =
@@ -7,7 +7,8 @@ from XmTestLib import *
MEM = 16
domain = XmTestDomain(extraOpts={"memory":"%i" % MEM})
domain = XmTestDomain(extraOpts={"memory":"%i" % MEM,
"extra" :"mem=%iM" % MEM})
try:
domain.start()
+3
View File
@@ -255,6 +255,9 @@ void arch_do_createdomain(struct vcpu *v)
struct domain *d = v->domain;
l1_pgentry_t gdt_l1e;
int vcpuid, pdpt_order;
#ifdef __x86_64__
int i;
#endif
if ( is_idle_task(d) )
return;
+2 -2
View File
@@ -60,7 +60,7 @@ extern void send_guest_pirq(struct domain *d, int pirq);
/* Note: Bitwise operations result in fast code with no branches. */
#define event_pending(v) \
((v)->vcpu_info->evtchn_upcall_pending & \
~(v)->vcpu_info->evtchn_upcall_mask)
(!!(v)->vcpu_info->evtchn_upcall_pending & \
!(v)->vcpu_info->evtchn_upcall_mask)
#endif /* __XEN_EVENT_H__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.